usb 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/usb/bindings.d.ts +4 -0
- package/dist/usb/device.js +5 -0
- package/dist/usb/device.js.map +1 -1
- package/dist/usb/interface.d.ts +1 -1
- package/dist/usb/interface.js +1 -5
- package/dist/usb/interface.js.map +1 -1
- package/dist/webusb/webusb-device.d.ts +2 -1
- package/dist/webusb/webusb-device.js +21 -14
- package/dist/webusb/webusb-device.js.map +1 -1
- package/libusb/.gitattributes +2 -6
- package/libusb/.private/appveyor_build.sh +22 -0
- package/libusb/.private/bm.sh +1 -1
- package/libusb/.private/ci-build.sh +67 -0
- package/libusb/.private/post-rewrite.sh +5 -1
- package/libusb/.private/pre-commit.sh +5 -1
- package/libusb/.private/wbs.txt +4 -19
- package/libusb/.travis.yml +32 -23
- package/libusb/AUTHORS +76 -3
- package/libusb/ChangeLog +41 -3
- package/libusb/INSTALL_WIN.txt +22 -44
- package/libusb/Makefile.am +32 -10
- package/libusb/{README.md → README} +2 -2
- package/libusb/README.git +3 -3
- package/libusb/Xcode/common.xcconfig +23 -19
- package/libusb/Xcode/config.h +25 -13
- package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +511 -109
- package/libusb/android/README +90 -54
- package/libusb/android/config.h +23 -43
- package/libusb/android/examples/unrooted_android.c +301 -0
- package/libusb/android/examples/unrooted_android.h +36 -0
- package/libusb/android/jni/Android.mk +1 -1
- package/libusb/android/jni/Application.mk +16 -0
- package/libusb/android/jni/examples.mk +63 -29
- package/libusb/android/jni/libusb.mk +14 -8
- package/libusb/android/jni/tests.mk +13 -24
- package/libusb/appveyor.yml +69 -30
- package/libusb/autogen.sh +5 -3
- package/libusb/bootstrap.sh +6 -2
- package/libusb/configure.ac +302 -228
- package/libusb/doc/Makefile.in +22 -0
- package/libusb/doc/doxygen.cfg.in +460 -223
- package/libusb/examples/Makefile.am +6 -13
- package/libusb/examples/dpfp.c +276 -73
- package/libusb/examples/ezusb.c +18 -8
- package/libusb/examples/ezusb.h +6 -17
- package/libusb/examples/fxload.c +4 -5
- package/libusb/examples/hotplugtest.c +1 -1
- package/libusb/examples/sam3u_benchmark.c +59 -24
- package/libusb/examples/testlibusb.c +138 -104
- package/libusb/examples/xusb.c +26 -22
- package/libusb/libusb/Makefile.am +57 -70
- package/libusb/libusb/Makefile.am.extra +26 -0
- package/libusb/libusb/core.c +420 -423
- package/libusb/libusb/descriptor.c +365 -419
- package/libusb/libusb/hotplug.c +197 -104
- package/libusb/libusb/io.c +491 -528
- package/libusb/libusb/libusb-1.0.def +7 -3
- package/libusb/libusb/libusb-1.0.rc +1 -9
- package/libusb/libusb/libusb.h +295 -226
- package/libusb/libusb/libusbi.h +587 -314
- package/libusb/libusb/os/darwin_usb.c +634 -317
- package/libusb/libusb/os/darwin_usb.h +39 -15
- package/libusb/libusb/os/events_posix.c +300 -0
- package/libusb/libusb/os/events_posix.h +59 -0
- package/libusb/libusb/os/events_windows.c +214 -0
- package/libusb/{msvc/missing.h → libusb/os/events_windows.h} +25 -11
- package/libusb/libusb/os/haiku_pollfs.cpp +14 -9
- package/libusb/libusb/os/haiku_usb.h +12 -12
- package/libusb/libusb/os/haiku_usb_backend.cpp +36 -37
- package/libusb/libusb/os/haiku_usb_raw.cpp +80 -116
- package/libusb/libusb/os/linux_netlink.c +55 -63
- package/libusb/libusb/os/linux_udev.c +61 -69
- package/libusb/libusb/os/linux_usbfs.c +926 -1015
- package/libusb/libusb/os/linux_usbfs.h +74 -57
- package/libusb/libusb/os/netbsd_usb.c +103 -168
- package/libusb/libusb/os/null_usb.c +111 -0
- package/libusb/libusb/os/openbsd_usb.c +71 -120
- package/libusb/libusb/os/sunos_usb.c +289 -375
- package/libusb/libusb/os/sunos_usb.h +0 -1
- package/libusb/libusb/os/threads_posix.c +81 -32
- package/libusb/libusb/os/threads_posix.h +19 -23
- package/libusb/libusb/os/threads_windows.c +9 -95
- package/libusb/libusb/os/threads_windows.h +33 -31
- package/libusb/libusb/os/windows_common.c +904 -0
- package/libusb/libusb/os/windows_common.h +329 -42
- package/libusb/libusb/os/windows_usbdk.c +161 -267
- package/libusb/libusb/os/windows_usbdk.h +5 -2
- package/libusb/libusb/os/windows_winusb.c +1326 -1190
- package/libusb/libusb/os/windows_winusb.h +167 -167
- package/libusb/libusb/strerror.c +20 -30
- package/libusb/libusb/sync.c +20 -21
- package/libusb/libusb/version.h +1 -1
- package/libusb/libusb/version_nano.h +1 -1
- package/libusb/msvc/.gitattributes +3 -0
- package/libusb/msvc/config.h +27 -20
- package/libusb/msvc/{hotplugtest_2012.vcxproj → dpfp_2013.vcxproj} +14 -10
- package/libusb/msvc/dpfp_2013.vcxproj.filters +26 -0
- package/libusb/msvc/{listdevs_2010.vcxproj → dpfp_2015.vcxproj} +14 -9
- package/libusb/msvc/dpfp_2015.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_2017.vcxproj +106 -0
- package/libusb/msvc/dpfp_2017.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_2019.vcxproj +106 -0
- package/libusb/msvc/dpfp_2019.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_threaded_2013.vcxproj +87 -0
- package/libusb/msvc/dpfp_threaded_2013.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_threaded_2015.vcxproj +87 -0
- package/libusb/msvc/dpfp_threaded_2015.vcxproj.filters +26 -0
- package/libusb/msvc/dpfp_threaded_2017.vcxproj +106 -0
- package/libusb/msvc/dpfp_threaded_2017.vcxproj.filters +26 -0
- package/libusb/msvc/{fxload_2012.vcxproj → dpfp_threaded_2019.vcxproj} +32 -17
- package/libusb/msvc/dpfp_threaded_2019.vcxproj.filters +26 -0
- package/libusb/msvc/fxload_2013.vcxproj +6 -3
- package/libusb/msvc/fxload_2013.vcxproj.filters +35 -0
- package/libusb/msvc/fxload_2015.vcxproj +6 -3
- package/libusb/msvc/fxload_2015.vcxproj.filters +35 -0
- package/libusb/msvc/fxload_2017.vcxproj +6 -7
- package/libusb/msvc/fxload_2017.vcxproj.filters +35 -0
- package/libusb/msvc/{fxload_2010.vcxproj → fxload_2019.vcxproj} +29 -6
- package/libusb/msvc/fxload_2019.vcxproj.filters +35 -0
- package/libusb/{examples → msvc}/getopt/getopt.c +0 -0
- package/libusb/{examples → msvc}/getopt/getopt.h +0 -0
- package/libusb/{examples → msvc}/getopt/getopt1.c +0 -0
- package/libusb/msvc/getopt_2013.vcxproj +4 -5
- package/libusb/msvc/getopt_2013.vcxproj.filters +26 -0
- package/libusb/msvc/getopt_2015.vcxproj +4 -4
- package/libusb/msvc/getopt_2015.vcxproj.filters +26 -0
- package/libusb/msvc/getopt_2017.vcxproj +4 -10
- package/libusb/msvc/getopt_2017.vcxproj.filters +26 -0
- package/libusb/msvc/{getopt_2012.vcxproj → getopt_2019.vcxproj} +25 -6
- package/libusb/msvc/getopt_2019.vcxproj.filters +26 -0
- package/libusb/msvc/hotplugtest_2013.vcxproj +6 -3
- package/libusb/msvc/hotplugtest_2013.vcxproj.filters +23 -0
- package/libusb/msvc/hotplugtest_2015.vcxproj +6 -3
- package/libusb/msvc/hotplugtest_2015.vcxproj.filters +23 -0
- package/libusb/msvc/hotplugtest_2017.vcxproj +6 -7
- package/libusb/msvc/hotplugtest_2017.vcxproj.filters +23 -0
- package/libusb/msvc/hotplugtest_2019.vcxproj +105 -0
- package/libusb/msvc/hotplugtest_2019.vcxproj.filters +23 -0
- package/libusb/msvc/libusb_2013.sln +50 -20
- package/libusb/msvc/libusb_2015.sln +51 -21
- package/libusb/msvc/libusb_2017.sln +90 -36
- package/libusb/msvc/libusb_2019.sln +240 -0
- package/libusb/msvc/libusb_dll_2013.vcxproj +6 -9
- package/libusb/msvc/libusb_dll_2013.vcxproj.filters +94 -0
- package/libusb/msvc/libusb_dll_2015.vcxproj +6 -8
- package/libusb/msvc/libusb_dll_2015.vcxproj.filters +94 -0
- package/libusb/msvc/libusb_dll_2017.vcxproj +6 -16
- package/libusb/msvc/libusb_dll_2017.vcxproj.filters +94 -0
- package/libusb/msvc/{libusb_dll_2010.vcxproj → libusb_dll_2019.vcxproj} +27 -9
- package/libusb/msvc/libusb_dll_2019.vcxproj.filters +94 -0
- package/libusb/msvc/libusb_static_2013.vcxproj +5 -9
- package/libusb/msvc/libusb_static_2013.vcxproj.filters +80 -0
- package/libusb/msvc/libusb_static_2015.vcxproj +5 -8
- package/libusb/msvc/libusb_static_2015.vcxproj.filters +80 -0
- package/libusb/msvc/libusb_static_2017.vcxproj +5 -8
- package/libusb/msvc/libusb_static_2017.vcxproj.filters +80 -0
- package/libusb/msvc/{libusb_static_2010.vcxproj → libusb_static_2019.vcxproj} +26 -9
- package/libusb/msvc/libusb_static_2019.vcxproj.filters +80 -0
- package/libusb/msvc/listdevs_2013.vcxproj +6 -3
- package/libusb/msvc/listdevs_2013.vcxproj.filters +23 -0
- package/libusb/msvc/listdevs_2015.vcxproj +6 -3
- package/libusb/msvc/listdevs_2015.vcxproj.filters +23 -0
- package/libusb/msvc/listdevs_2017.vcxproj +6 -7
- package/libusb/msvc/listdevs_2017.vcxproj.filters +23 -0
- package/libusb/msvc/listdevs_2019.vcxproj +105 -0
- package/libusb/msvc/listdevs_2019.vcxproj.filters +23 -0
- package/libusb/msvc/{listdevs_2012.vcxproj → sam3u_benchmark_2013.vcxproj} +13 -9
- package/libusb/msvc/sam3u_benchmark_2013.vcxproj.filters +26 -0
- package/libusb/msvc/{hotplugtest_2010.vcxproj → sam3u_benchmark_2015.vcxproj} +13 -8
- package/libusb/msvc/sam3u_benchmark_2015.vcxproj.filters +26 -0
- package/libusb/msvc/sam3u_benchmark_2017.vcxproj +106 -0
- package/libusb/msvc/sam3u_benchmark_2017.vcxproj.filters +26 -0
- package/libusb/msvc/sam3u_benchmark_2019.vcxproj +106 -0
- package/libusb/msvc/sam3u_benchmark_2019.vcxproj.filters +26 -0
- package/libusb/msvc/stress_2013.vcxproj +4 -2
- package/libusb/msvc/stress_2013.vcxproj.filters +32 -0
- package/libusb/msvc/stress_2015.vcxproj +4 -2
- package/libusb/msvc/stress_2015.vcxproj.filters +32 -0
- package/libusb/msvc/stress_2017.vcxproj +4 -6
- package/libusb/msvc/stress_2017.vcxproj.filters +32 -0
- package/libusb/msvc/{stress_2010.vcxproj → stress_2019.vcxproj} +26 -4
- package/libusb/msvc/stress_2019.vcxproj.filters +32 -0
- package/libusb/msvc/testlibusb_2013.vcxproj +6 -3
- package/libusb/msvc/testlibusb_2013.vcxproj.filters +23 -0
- package/libusb/msvc/testlibusb_2015.vcxproj +6 -3
- package/libusb/msvc/testlibusb_2015.vcxproj.filters +23 -0
- package/libusb/msvc/testlibusb_2017.vcxproj +6 -7
- package/libusb/msvc/testlibusb_2017.vcxproj.filters +23 -0
- package/libusb/msvc/{testlibusb_2010.vcxproj → testlibusb_2019.vcxproj} +28 -5
- package/libusb/msvc/testlibusb_2019.vcxproj.filters +23 -0
- package/libusb/msvc/xusb_2013.vcxproj +6 -3
- package/libusb/msvc/xusb_2013.vcxproj.filters +23 -0
- package/libusb/msvc/xusb_2015.vcxproj +6 -3
- package/libusb/msvc/xusb_2015.vcxproj.filters +23 -0
- package/libusb/msvc/xusb_2017.vcxproj +6 -7
- package/libusb/msvc/xusb_2017.vcxproj.filters +23 -0
- package/libusb/msvc/{xusb_2010.vcxproj → xusb_2019.vcxproj} +28 -5
- package/libusb/msvc/xusb_2019.vcxproj.filters +23 -0
- package/libusb/tests/Makefile.am +1 -0
- package/libusb/tests/libusb_testlib.h +12 -43
- package/libusb/tests/stress.c +59 -50
- package/libusb/tests/testlib.c +78 -171
- package/libusb.gypi +10 -11
- package/package.json +2 -2
- package/prebuilds/android-arm/node.napi.armv7.node +0 -0
- package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
- package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/linux-ia32/node.napi.node +0 -0
- package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/prebuilds/win32-ia32/node.napi.node +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/src/device.cc +12 -7
- package/src/node_usb.cc +10 -0
- package/test/usb.coffee +6 -0
- package/tsc/index.ts +2 -0
- package/tsc/usb/bindings.ts +5 -0
- package/tsc/usb/device.ts +6 -0
- package/tsc/usb/interface.ts +2 -7
- package/tsc/webusb/webusb-device.ts +12 -8
- package/libusb/.private/bd.cmd +0 -89
- package/libusb/.private/bwince.cmd +0 -57
- package/libusb/.private/wbs_wince.txt +0 -42
- package/libusb/Brewfile +0 -4
- package/libusb/appveyor_cygwin.bat +0 -11
- package/libusb/appveyor_minGW.bat +0 -19
- package/libusb/doc/Makefile.am +0 -9
- package/libusb/examples/dpfp_threaded.c +0 -557
- package/libusb/libusb/hotplug.h +0 -99
- package/libusb/libusb/os/poll_posix.c +0 -84
- package/libusb/libusb/os/poll_posix.h +0 -14
- package/libusb/libusb/os/poll_windows.c +0 -447
- package/libusb/libusb/os/poll_windows.h +0 -98
- package/libusb/libusb/os/wince_usb.c +0 -888
- package/libusb/libusb/os/wince_usb.h +0 -126
- package/libusb/libusb/os/windows_nt_common.c +0 -1010
- package/libusb/libusb/os/windows_nt_common.h +0 -110
- package/libusb/libusb/os/windows_nt_shared_types.h +0 -147
- package/libusb/msvc/appveyor.bat +0 -27
- package/libusb/msvc/ddk_build.cmd +0 -219
- package/libusb/msvc/errno.h +0 -102
- package/libusb/msvc/fxload_sources +0 -23
- package/libusb/msvc/getopt_2005.vcproj +0 -288
- package/libusb/msvc/getopt_2010.vcxproj +0 -72
- package/libusb/msvc/getopt_sources +0 -24
- package/libusb/msvc/hotplugtest_sources +0 -20
- package/libusb/msvc/inttypes.h +0 -295
- package/libusb/msvc/libusb.dsw +0 -71
- package/libusb/msvc/libusb_2005.sln +0 -95
- package/libusb/msvc/libusb_2010.sln +0 -105
- package/libusb/msvc/libusb_2012.sln +0 -105
- package/libusb/msvc/libusb_dll.dsp +0 -194
- package/libusb/msvc/libusb_dll_2005.vcproj +0 -464
- package/libusb/msvc/libusb_dll_2012.vcxproj +0 -107
- package/libusb/msvc/libusb_dll_wince.vcproj +0 -1251
- package/libusb/msvc/libusb_sources +0 -43
- package/libusb/msvc/libusb_static.dsp +0 -174
- package/libusb/msvc/libusb_static_2005.vcproj +0 -390
- package/libusb/msvc/libusb_static_2012.vcxproj +0 -98
- package/libusb/msvc/libusb_static_wince.vcproj +0 -1179
- package/libusb/msvc/libusb_wince.sln +0 -246
- package/libusb/msvc/listdevs.dsp +0 -103
- package/libusb/msvc/listdevs_2005.vcproj +0 -360
- package/libusb/msvc/listdevs_sources +0 -20
- package/libusb/msvc/listdevs_wince.vcproj +0 -1120
- package/libusb/msvc/missing.c +0 -80
- package/libusb/msvc/stdint.h +0 -256
- package/libusb/msvc/stress_2005.vcproj +0 -390
- package/libusb/msvc/stress_2012.vcxproj +0 -87
- package/libusb/msvc/stress_sources +0 -21
- package/libusb/msvc/stress_wince.vcproj +0 -1128
- package/libusb/msvc/testlibusb_2012.vcxproj +0 -83
- package/libusb/msvc/testlibusb_sources +0 -20
- package/libusb/msvc/xusb.dsp +0 -102
- package/libusb/msvc/xusb_2005.vcproj +0 -344
- package/libusb/msvc/xusb_2012.vcxproj +0 -83
- package/libusb/msvc/xusb_sources +0 -20
- package/libusb/msvc/xusb_wince.vcproj +0 -1120
- package/libusb/travis-autogen.sh +0 -39
|
@@ -21,29 +21,20 @@
|
|
|
21
21
|
#ifndef LIBUSB_USBFS_H
|
|
22
22
|
#define LIBUSB_USBFS_H
|
|
23
23
|
|
|
24
|
+
#include <linux/magic.h>
|
|
24
25
|
#include <linux/types.h>
|
|
25
26
|
|
|
26
|
-
#define
|
|
27
|
+
#define SYSFS_MOUNT_PATH "/sys"
|
|
28
|
+
#define SYSFS_DEVICE_PATH SYSFS_MOUNT_PATH "/bus/usb/devices"
|
|
27
29
|
|
|
28
30
|
struct usbfs_ctrltransfer {
|
|
29
31
|
/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
uint32_t timeout; /* in milliseconds */
|
|
37
|
-
|
|
38
|
-
/* pointer to data */
|
|
39
|
-
void *data;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
struct usbfs_bulktransfer {
|
|
43
|
-
/* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */
|
|
44
|
-
unsigned int ep;
|
|
45
|
-
unsigned int len;
|
|
46
|
-
unsigned int timeout; /* in milliseconds */
|
|
32
|
+
__u8 bmRequestType;
|
|
33
|
+
__u8 bRequest;
|
|
34
|
+
__u16 wValue;
|
|
35
|
+
__u16 wIndex;
|
|
36
|
+
__u16 wLength;
|
|
37
|
+
__u32 timeout; /* in milliseconds */
|
|
47
38
|
|
|
48
39
|
/* pointer to data */
|
|
49
40
|
void *data;
|
|
@@ -55,7 +46,7 @@ struct usbfs_setinterface {
|
|
|
55
46
|
unsigned int altsetting;
|
|
56
47
|
};
|
|
57
48
|
|
|
58
|
-
#define USBFS_MAXDRIVERNAME
|
|
49
|
+
#define USBFS_MAXDRIVERNAME 255
|
|
59
50
|
|
|
60
51
|
struct usbfs_getdriver {
|
|
61
52
|
unsigned int interface;
|
|
@@ -63,17 +54,15 @@ struct usbfs_getdriver {
|
|
|
63
54
|
};
|
|
64
55
|
|
|
65
56
|
#define USBFS_URB_SHORT_NOT_OK 0x01
|
|
66
|
-
#define USBFS_URB_ISO_ASAP
|
|
57
|
+
#define USBFS_URB_ISO_ASAP 0x02
|
|
67
58
|
#define USBFS_URB_BULK_CONTINUATION 0x04
|
|
68
59
|
#define USBFS_URB_QUEUE_BULK 0x10
|
|
69
60
|
#define USBFS_URB_ZERO_PACKET 0x40
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
USBFS_URB_TYPE_BULK = 3,
|
|
76
|
-
};
|
|
62
|
+
#define USBFS_URB_TYPE_ISO 0
|
|
63
|
+
#define USBFS_URB_TYPE_INTERRUPT 1
|
|
64
|
+
#define USBFS_URB_TYPE_CONTROL 2
|
|
65
|
+
#define USBFS_URB_TYPE_BULK 3
|
|
77
66
|
|
|
78
67
|
struct usbfs_iso_packet_desc {
|
|
79
68
|
unsigned int length;
|
|
@@ -117,16 +106,11 @@ struct usbfs_ioctl {
|
|
|
117
106
|
void *data; /* param buffer (in, or out) */
|
|
118
107
|
};
|
|
119
108
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
#define USBFS_CAP_ZERO_PACKET 0x01
|
|
126
|
-
#define USBFS_CAP_BULK_CONTINUATION 0x02
|
|
127
|
-
#define USBFS_CAP_NO_PACKET_SIZE_LIM 0x04
|
|
128
|
-
#define USBFS_CAP_BULK_SCATTER_GATHER 0x08
|
|
129
|
-
#define USBFS_CAP_REAP_AFTER_DISCONNECT 0x10
|
|
109
|
+
#define USBFS_CAP_ZERO_PACKET 0x01
|
|
110
|
+
#define USBFS_CAP_BULK_CONTINUATION 0x02
|
|
111
|
+
#define USBFS_CAP_NO_PACKET_SIZE_LIM 0x04
|
|
112
|
+
#define USBFS_CAP_BULK_SCATTER_GATHER 0x08
|
|
113
|
+
#define USBFS_CAP_REAP_AFTER_DISCONNECT 0x10
|
|
130
114
|
|
|
131
115
|
#define USBFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
|
|
132
116
|
#define USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
|
|
@@ -143,35 +127,39 @@ struct usbfs_streams {
|
|
|
143
127
|
unsigned char eps[0];
|
|
144
128
|
};
|
|
145
129
|
|
|
146
|
-
#define
|
|
147
|
-
#define
|
|
148
|
-
#define
|
|
149
|
-
#define
|
|
150
|
-
#define
|
|
151
|
-
#define
|
|
152
|
-
#define
|
|
153
|
-
|
|
154
|
-
#define
|
|
130
|
+
#define USBFS_SPEED_UNKNOWN 0
|
|
131
|
+
#define USBFS_SPEED_LOW 1
|
|
132
|
+
#define USBFS_SPEED_FULL 2
|
|
133
|
+
#define USBFS_SPEED_HIGH 3
|
|
134
|
+
#define USBFS_SPEED_WIRELESS 4
|
|
135
|
+
#define USBFS_SPEED_SUPER 5
|
|
136
|
+
#define USBFS_SPEED_SUPER_PLUS 6
|
|
137
|
+
|
|
138
|
+
#define IOCTL_USBFS_CONTROL _IOWR('U', 0, struct usbfs_ctrltransfer)
|
|
139
|
+
#define IOCTL_USBFS_SETINTERFACE _IOR('U', 4, struct usbfs_setinterface)
|
|
140
|
+
#define IOCTL_USBFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
|
|
141
|
+
#define IOCTL_USBFS_GETDRIVER _IOW('U', 8, struct usbfs_getdriver)
|
|
142
|
+
#define IOCTL_USBFS_SUBMITURB _IOR('U', 10, struct usbfs_urb)
|
|
143
|
+
#define IOCTL_USBFS_DISCARDURB _IO('U', 11)
|
|
155
144
|
#define IOCTL_USBFS_REAPURBNDELAY _IOW('U', 13, void *)
|
|
156
|
-
#define
|
|
157
|
-
#define
|
|
158
|
-
#define IOCTL_USBFS_CONNECTINFO
|
|
159
|
-
#define IOCTL_USBFS_IOCTL
|
|
160
|
-
#define IOCTL_USBFS_HUB_PORTINFO _IOR('U', 19, struct usbfs_hub_portinfo)
|
|
145
|
+
#define IOCTL_USBFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
|
|
146
|
+
#define IOCTL_USBFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
|
|
147
|
+
#define IOCTL_USBFS_CONNECTINFO _IOW('U', 17, struct usbfs_connectinfo)
|
|
148
|
+
#define IOCTL_USBFS_IOCTL _IOWR('U', 18, struct usbfs_ioctl)
|
|
161
149
|
#define IOCTL_USBFS_RESET _IO('U', 20)
|
|
162
|
-
#define IOCTL_USBFS_CLEAR_HALT
|
|
163
|
-
#define IOCTL_USBFS_DISCONNECT
|
|
164
|
-
#define IOCTL_USBFS_CONNECT
|
|
165
|
-
#define IOCTL_USBFS_CLAIM_PORT _IOR('U', 24, unsigned int)
|
|
166
|
-
#define IOCTL_USBFS_RELEASE_PORT _IOR('U', 25, unsigned int)
|
|
150
|
+
#define IOCTL_USBFS_CLEAR_HALT _IOR('U', 21, unsigned int)
|
|
151
|
+
#define IOCTL_USBFS_DISCONNECT _IO('U', 22)
|
|
152
|
+
#define IOCTL_USBFS_CONNECT _IO('U', 23)
|
|
167
153
|
#define IOCTL_USBFS_GET_CAPABILITIES _IOR('U', 26, __u32)
|
|
168
154
|
#define IOCTL_USBFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbfs_disconnect_claim)
|
|
169
155
|
#define IOCTL_USBFS_ALLOC_STREAMS _IOR('U', 28, struct usbfs_streams)
|
|
170
156
|
#define IOCTL_USBFS_FREE_STREAMS _IOR('U', 29, struct usbfs_streams)
|
|
157
|
+
#define IOCTL_USBFS_DROP_PRIVILEGES _IOW('U', 30, __u32)
|
|
158
|
+
#define IOCTL_USBFS_GET_SPEED _IO('U', 31)
|
|
171
159
|
|
|
172
160
|
extern usbi_mutex_static_t linux_hotplug_lock;
|
|
173
161
|
|
|
174
|
-
#
|
|
162
|
+
#ifdef HAVE_LIBUDEV
|
|
175
163
|
int linux_udev_start_event_monitor(void);
|
|
176
164
|
int linux_udev_stop_event_monitor(void);
|
|
177
165
|
int linux_udev_scan_devices(struct libusb_context *ctx);
|
|
@@ -182,10 +170,39 @@ int linux_netlink_stop_event_monitor(void);
|
|
|
182
170
|
void linux_netlink_hotplug_poll(void);
|
|
183
171
|
#endif
|
|
184
172
|
|
|
173
|
+
static inline int linux_start_event_monitor(void)
|
|
174
|
+
{
|
|
175
|
+
#if defined(HAVE_LIBUDEV)
|
|
176
|
+
return linux_udev_start_event_monitor();
|
|
177
|
+
#elif !defined(__ANDROID__)
|
|
178
|
+
return linux_netlink_start_event_monitor();
|
|
179
|
+
#else
|
|
180
|
+
return LIBUSB_SUCCESS;
|
|
181
|
+
#endif
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static inline void linux_stop_event_monitor(void)
|
|
185
|
+
{
|
|
186
|
+
#if defined(HAVE_LIBUDEV)
|
|
187
|
+
linux_udev_stop_event_monitor();
|
|
188
|
+
#elif !defined(__ANDROID__)
|
|
189
|
+
linux_netlink_stop_event_monitor();
|
|
190
|
+
#endif
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
static inline void linux_hotplug_poll(void)
|
|
194
|
+
{
|
|
195
|
+
#if defined(HAVE_LIBUDEV)
|
|
196
|
+
linux_udev_hotplug_poll();
|
|
197
|
+
#elif !defined(__ANDROID__)
|
|
198
|
+
linux_netlink_hotplug_poll();
|
|
199
|
+
#endif
|
|
200
|
+
}
|
|
201
|
+
|
|
185
202
|
void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name);
|
|
186
203
|
void linux_device_disconnected(uint8_t busnum, uint8_t devaddr);
|
|
187
204
|
|
|
188
|
-
int linux_get_device_address
|
|
205
|
+
int linux_get_device_address(struct libusb_context *ctx, int detached,
|
|
189
206
|
uint8_t *busnum, uint8_t *devaddr, const char *dev_node,
|
|
190
207
|
const char *sys_name, int fd);
|
|
191
208
|
int linux_enumerate_device(struct libusb_context *ctx,
|