Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151822788
D25194.id72857.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25194.id72857.diff
View Options
Index: lib/libusb/libusb.h
===================================================================
--- lib/libusb/libusb.h
+++ lib/libusb/libusb.h
@@ -54,6 +54,7 @@
LIBUSB_CLASS_AUDIO = 1,
LIBUSB_CLASS_COMM = 2,
LIBUSB_CLASS_HID = 3,
+ LIBUSB_CLASS_PHYSICAL = 5,
LIBUSB_CLASS_PTP = 6,
LIBUSB_CLASS_IMAGE = 6,
LIBUSB_CLASS_PRINTER = 7,
@@ -178,6 +179,21 @@
LIBUSB_BT_CONTAINER_ID = 4,
};
+enum libusb_capability {
+ /* libusb supports libusb_has_capability(). */
+ LIBUSB_CAP_HAS_CAPABILITY = 0,
+ /* Hotplug support is available. */
+ LIBUSB_CAP_HAS_HOTPLUG,
+ /* Can access HID devices without requiring user intervention. */
+ LIBUSB_CAP_HAS_HID_ACCESS,
+
+ /*
+ * Supports detaching of the default USB driver with
+ * libusb_detach_kernel().
+ */
+ LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER,
+};
+
enum libusb_error {
LIBUSB_SUCCESS = 0,
LIBUSB_ERROR_IO = -1,
@@ -450,6 +466,7 @@
const char *libusb_error_name(int code);
int libusb_init(libusb_context ** context);
void libusb_exit(struct libusb_context *ctx);
+int libusb_has_capability(uint32_t capability);
/* Device handling and enumeration */
Index: lib/libusb/libusb10.c
===================================================================
--- lib/libusb/libusb10.c
+++ lib/libusb/libusb10.c
@@ -1716,3 +1716,18 @@
return ("LIBUSB_ERROR_UNKNOWN");
}
}
+
+int
+libusb_has_capability(uint32_t capability)
+{
+
+ switch (capability) {
+ case LIBUSB_CAP_HAS_CAPABILITY:
+ case LIBUSB_CAP_HAS_HOTPLUG:
+ case LIBUSB_CAP_HAS_HID_ACCESS:
+ case LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER:
+ return (1);
+ default:
+ return (0);
+ }
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 11, 9:57 PM (5 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31310582
Default Alt Text
D25194.id72857.diff (1 KB)
Attached To
Mode
D25194: libusb: improve compatibility
Attached
Detach File
Event Timeline
Log In to Comment