diff --git a/.gitignore b/.gitignore index eb6ef3c..6ef46b0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ uhubctl # Patches *.patch *.diff + +# IDE config dirs +.*/ diff --git a/README.md b/README.md index 7d9ef9e..b7b96eb 100644 --- a/README.md +++ b/README.md @@ -164,17 +164,19 @@ is using `winusb.sys` driver, which according to Microsoft does not support [necessary USB control requests](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f680b63f-ca4f-4e52-baa9-9e64f8eee101). This may be fixed if `libusb` starts supporting different driver on Windows. -Note that it is highly recommended to have `pkg-config` installed (many platforms provide it by default). +Note that it is highly recommended to have utility `pkg-config` installed +(many platforms provide it in package `pkg-config` or `pkgconf`, +often it is installed by default). First, you need to install library libusb-1.0 (version 1.0.13 or later is required, 1.0.23 or later is recommended): -* Ubuntu: `sudo apt-get install libusb-1.0-0-dev` -* Redhat: `sudo yum install libusb1-devel` -* OpenSUSE: `sudo zypper install libusb-1_0-devel` -* MacOS: `brew install libusb`, or `sudo port install libusb-devel` -* FreeBSD: libusb is included by default -* NetBSD: `sudo pkgin install libusb1 gmake pkg-config` +* Ubuntu: `sudo apt-get install libusb-1.0-0-dev pkgconf` +* Redhat: `sudo yum install libusb1-devel pkgconf` +* OpenSUSE: `sudo zypper install libusb-1_0-devel pkgconf` +* MacOS: `brew install libusb pkgconf`, or `sudo port install libusb-devel pkgconf` +* FreeBSD: `pkg install gmake pkgconf` (libusb is included by default) +* NetBSD: `sudo pkgin install libusb1 gmake pkgconf` * Windows: TBD? To fetch uhubctl source and compile it: diff --git a/uhubctl.c b/uhubctl.c index 3a27284..7e4778d 100644 --- a/uhubctl.c +++ b/uhubctl.c @@ -38,6 +38,11 @@ #define LIBUSB_API_VERSION LIBUSBX_API_VERSION #endif +/* FreeBSD's libusb does not define LIBUSB_DT_SUPERSPEED_HUB */ +#if !defined(LIBUSB_DT_SUPERSPEED_HUB) +#define LIBUSB_DT_SUPERSPEED_HUB 0x2a +#endif + #if !defined(LIBUSB_API_VERSION) #error "libusb-1.0 is required!" #endif