382 Commits

Author SHA1 Message Date
Christian Svensson
1f920f6b15 Fix endian conversions to work for big-endian
Before:
```
Current status for hub 3 [6b1d:0200 Linux 6.1.98 xhci-hcd xHCI Host Controller 0000:01:00.0, USB 0.02, 2 ports, ppps]
  Port 1: 0305 power lowspeed suspend connect [9911:c068 Sierra Wireless, Incorporated MC7304-CP]
  Port 2: 0301 power lowspeed connect [0304:0160 FTDI FT232R USB UART A10OEDEW]
```

After:

```
Current status for hub 1 [1d6b:0002 Linux 6.1.98 ehci_hcd EHCI Host Controller 16f0000000000.ehci, USB 2.00, 2 ports, nops]
  Port 1: 0503 power highspeed enable connect [0424:2240 Generic Ultra Fast Media 000000225001]
  Port 2: 0100 power
Current status for hub 3 [1d6b:0002 Linux 6.1.98 xhci-hcd xHCI Host Controller 0000:01:00.0, USB 2.00, 2 ports, ppps]
  Port 1: 0503 power highspeed enable connect [1199:68c0 Sierra Wireless, Incorporated MC7304-CP]
  Port 2: 0103 power enable connect [0403:6001 FTDI FT232R USB UART A10OEDEW]
```

Tested on both x86-64 and MIPS64.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2024-08-04 19:59:56 -07:00
mvp
746891d888 Add VirtualHere USB3 4-port hub as compatible device
Closes #571.
2024-06-05 16:26:20 -07:00
mvp
83f624f3b5 Removed Plugable USB3-HUB7-81X from supported list
Closes #559.
2024-05-21 11:14:23 -07:00
Hans Märki
61fd83ff10 Add Rosonway A10, and ST07C as compatible device (#567) 2024-05-21 11:06:36 -07:00
Jan Lübbe
cd99f0de34 Add labgrid to README as project using uhubctl (#566)
labgrid uses uhubctl in the USBPowerDriver to control power for boards
connected on switchable USB hubs [1].

[1] https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/powerdriver.py
2024-05-06 00:57:57 -07:00
Vadim Mikhailov
3d804c1ab7 Add support for Raspberry Pi 5
Added hack to support Raspberry Pi 5.
Updated README with recipe how to control power on RPi5.

Closes #547.
2024-04-19 16:08:19 -07:00
Vadim Mikhailov
3e86729800 Add Lenovo USB-C to 4 Port USB-A Hub as compatible device
Closes #561.
2024-04-19 16:06:29 -07:00
Vadim Mikhailov
d556081fbb Add LG 27GL850-B as compatible device
Closes #560.
2024-04-19 16:02:47 -07:00
Vadim Mikhailov
1199b9ddbc Add Targus PA095UZ as compatible device
Closes #558.
2024-04-19 15:59:46 -07:00
Vadim Mikhailov
f70c2ced96 Fix build on Mac
Recent libusb seems to have removed extra symlink `libusb-1.0/libusb.h`,
which breaks build on Mac.

TODO: consider always using `<libusb.h>`, but that would
put hard dependency on `pkg-config` usage.
2024-04-19 15:49:19 -07:00
Vadim Mikhailov
4deae1731c Update README, bump copyright year
* Remove mention of MacOS bug only applicable to old MacOS 12.4 x86
* Simplify docs related to Linux kernel 6.0 fixes
* Bump copyright year
2024-02-20 22:40:28 -08:00
Vadim Mikhailov
5cc9f154e1 Remove Cyberpower CP-H420P from supported list
Removing CP-H420P because it does not seem to support Vbus control.

Closes #557.
2024-02-20 22:08:08 -08:00
mvp
7a0fbd266f Update README.md (#553)
Fix devices sorting order
2024-01-24 11:48:24 -08:00
Nicolai
e18434cd2e Add Revolution Pi to list of supported devices (#552)
Revolution Pi Core and Connect family implement per port power switching
for all USB ports.

Signed-off-by: Nicolai Buchwitz <nb+github@tipi-net.de>
2024-01-24 11:42:36 -08:00
mvp
a34319a6d4 Add Gigabyte G27Q as compatible device
Closes #551.
2024-01-21 17:34:39 -08:00
mvp
d18db0d2be Add Acer BE270U as compatible device
Closes #550.
2024-01-21 17:29:02 -08:00
mvp
f37dcb5cbf Update EOL dates for some hubs
Updated EOL date for B+B SmartWorx USH304 to 2019.
https://www.mouser.com/PCN/Advantech_Corporation_EOL_BB_USH304.pdf.
Updated EOL date for Delock 62537, last available date seems to be 2021.

Closes #528.
2023-10-07 12:53:45 -07:00
mvp
5bb7197f51 Remove Anker AK-A83650A1 from supported list
There are multiple reports in #361 that Anker PowerExpand 6-in-1 USB-C hub
does not support vbus off - removing it from supported list.
2023-09-23 10:36:18 -07:00
mvp
5b2c40db83 Add Sugoi USB2-HUB4X as compatible device
Closes #525.
2023-09-21 20:25:07 -07:00
mvp
0d28753bcf Add Das Keyboard 4 as compatible device
Closes #522.
2023-09-21 20:12:35 -07:00
mvp
54ab9e72d4 Add Dell Wyse 3040 as compatible device
Dell Wyse 3040 is odd - it has 6 ports advertised on USB2 and 7 ports on USB3,
and both USB2+USB3 do not advertise power switching support.
However, using -f it seems that power switching does work.
I assume it needs separate control for USB2+USB3 using -e as well.

Closes #512.
2023-07-30 16:26:33 -07:00
mvp
b16ba1b36d Add Coolgear USBG-12U2ML as compatible device
Closes #514.
2023-07-17 22:40:50 -07:00
mvp
30372ce59f Add open source hardware hub design based on CH335F to notable projects
Closes #516.
2023-07-17 21:13:50 -07:00
Vadim Mikhailov
a9f2e7832d Use another URL shortener, GFM relative links do not seem to work correctly 2023-05-23 13:58:27 -07:00
Vadim Mikhailov
cec0435144 Use different issue linking method 2023-05-23 13:54:09 -07:00
Vadim Mikhailov
586b424557 Fix issue relative link 2023-05-23 13:50:24 -07:00
Vadim Mikhailov
1d3b841429 Add a warning link for StarTech HB30A4AIB different batch
Add a warning link for StarTech HB30A4AIB - new hardware is using
different USB chipset and different USB vid:pid,
which does not support power switching correctly.

Closes #509.
2023-05-23 13:39:04 -07:00
Vadim Mikhailov
2f45ac6138 Add Microchip EVB9512 as compatible device
Closes #505.
2023-05-02 11:55:33 -07:00
Vadim Mikhailov
4c235868eb Remove ExSys EX-1113HMS from supported list
ExSys EX-1113HMS was tested to not support turning VBUS off.
Remove from supported list.

Closes #502.
2023-04-05 22:46:29 -07:00
Vadim Mikhailov
33f1ecb2dd Add explicit void prototypes to make modern compilers happy 2023-03-31 14:44:54 -07:00
Vadim Mikhailov
8f355837b7 Add StarTech HB30A4AIB as compatible device
Closes #497.
2023-03-31 14:37:43 -07:00
Vadim Mikhailov
f2d97a3aad Add Belkin F5U238UKCRL-MOB as compatible device
Closes #492.
2023-02-13 21:31:06 -08:00
Vadim Mikhailov
e847dc461d Revert "Fixed brew sha256 for v2.5.0.tar.gz"
This reverts commit 61fd84b0ad.

It should fix issue #490.
2023-01-31 16:08:06 -08:00
Vadim Mikhailov
61fd84b0ad Fixed brew sha256 for v2.5.0.tar.gz
This used to work fine, perhaps something has changed in how Github
creates archives so archive checksum does not match anymore?
Confirmed that actual file content at https://github.com/mvp/uhubctl/archive/v2.5.0.tar.gz
is exactly the same as content for `git checkout v2.5.0`.
Updated checksum to expected value so `brew install uhubctl` should pass.
Closes #489.
2023-01-30 14:53:36 -08:00
Vadim Mikhailov
a54835e0ea Add Asus Z77 Sabertooth motherboard as compatible device
Closes #486.
2023-01-27 11:26:29 -08:00
Vadim Mikhailov
41e1bacf41 Bump copyright year 2023-01-27 11:23:08 -08:00
mvp
2be4125977 Add LG Electronics 27UN83A-W monitor as compatible device
Closes #482.
2023-01-04 20:48:47 -08:00
mvp
2ef5f0eb0b Fixed udev rule example to use DRIVER="usb"
It seems that DRIVER="hub" almost never works,
but DRIVER="hub" always does.
2023-01-04 20:37:58 -08:00
mvp
19dfdad7f6 Fix device table specs for some hubs incorrectly listed as USB 3.1
This is additional fix for #447.

We use old convention for USB versions in device table:

USB 3.2 spec version | Max speed | Old style USB version
---------------------+-----------+----------------------
USB 3.2 Gen 1	     |  5 gbps   | USB 3.0
USB 3.2 Gen 2        | 10 gbps   | USB 3.1
USB 3.2 Gen 2x2      | 20 gbps   | USB 3.2

All affected hubs were USB 3.2 Gen 1, which corresponds to original USB 3.0.
2022-11-02 20:24:10 -07:00
mvp
ce2fd9a419 Release version 2.5.0 as stable brew tap 2022-11-01 20:49:11 -07:00
mvp
20276ad5ce Release version 2.5.0 v2.5.0 2022-11-01 20:26:08 -07:00
mvp
914060b4b5 Add simpler way to configure udev rules and ready to use udev rule file
It turns out that we can allow udev access to any USB hub using DRIVER=="hub"
udev filter, this should make it easier for linux ditros to add proper udev rules.

This change adds more documentation to README, and also adds ready to use udev rule
that should work for any USB hub and any Linux kernel version.
2022-11-01 20:19:00 -07:00
gfrancesco
5a46019e15 ADD: BenQ PD3220U monitor to compatibility list (#464) 2022-10-26 22:55:09 -07:00
Vadim Mikhailov
b6189d1409 Consistently use only C style comments 2022-10-05 12:04:56 -07:00
Vadim Mikhailov
554a5c7eb3 Note that PR #450 has fixed few annoyances listed in FAQ 2022-09-22 16:22:09 -07:00
Vadim Mikhailov
732ad2d90e Fix crash on non-Linux if -S is used
Also move short options near long options table so it is easier to maintain.
2022-09-22 11:24:32 -07:00
Vadim Mikhailov
dd5ff8f79d Fix unused variable compilation warning on non Linux platforms 2022-09-22 11:09:24 -07:00
mvp
a802fa75aa Merge pull request #450 from hnez/linux-sysfs
Use sysfs interface on recent Linux kernels
2022-09-22 11:05:23 -07:00
Leonard Göhrs
24e1540006 Add udev rules for Linux sysfs power switching to README.md
The udev rules for the sysfs case are a bit more complex than those for the
libusb based interface, as udev has built-in support for changing permissions
on device files but not for sysfs attributes.
Instead we have to use chmod / chown to set permissions and owners.

You may notice the " || true" parts in the RUN part of the rules in addition
to the -f parameters. These are there to make sure that no error is logged by
udev even if the disable attribute does not exist. chmod/chown still return
an error exit code even with -f if the requested path does not exist.
" || true" makes sure this error is not propagated to udev.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
2022-09-22 11:40:03 +02:00
Leonard Göhrs
aa7fc0a126 Add support for Linux sysfs based power switching
Starting with Linux kernel 6.0[1] there will be a sysfs interface to power USB
ports off/on from userspace.
Try to use this interface before falling back to the usual libusb based
power switching (e.g. when running on a kernel <6.0 or if file permissions do
not allow using the sysfs interface).

The main benefit of using the sysfs interface is that the kernel does not get
confused about the state of a port, so retrying should no longer be required.

[1]: https://lore.kernel.org/all/20220607114522.3359148-1-m.grzeschik@pengutronix.de/

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
2022-09-22 11:40:03 +02:00