summaryrefslogtreecommitdiff
path: root/libusb/os/linux_usbfs.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-08-22 11:47:00 +0100
committerPete Batard <pete@akeo.ie>2012-08-23 20:19:53 +0100
commita109ae8205f0bfc5600711b821d520d6570b2243 (patch)
tree8f15513d44f2c0922b60f5a91bc2a861583ff994 /libusb/os/linux_usbfs.h
parent01f31ebe1ebfa552980750a1f3d2847819dea25a (diff)
downloadlibusb-a109ae8205f0bfc5600711b821d520d6570b2243.tar.gz
Linux: Add support for the new get_capabilities ioctl
* There were a few (new) usbdevfs capabilities which libusbx could not discover in any other way then checking the kernel version. * However, this presents the following problems: 1) It is just not very pretty 2) Given the tendency of enterprise distros to backport stuff it is not reliable 3) Some of these features turn out to not work with certain host controllers, making depending on them based on the kernel version not a good idea * Therefore a new USBDEVFS_GET_CAPABILITIES ioctl has been added to the kernel to offer a better way to find out a device's capabilities (technically the capabilities of the host controller to which the device is attached, but that does not matter).
Diffstat (limited to 'libusb/os/linux_usbfs.h')
-rw-r--r--libusb/os/linux_usbfs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libusb/os/linux_usbfs.h b/libusb/os/linux_usbfs.h
index 3a80261..593e736 100644
--- a/libusb/os/linux_usbfs.h
+++ b/libusb/os/linux_usbfs.h
@@ -21,6 +21,8 @@
#ifndef LIBUSB_USBFS_H
#define LIBUSB_USBFS_H
+#include <linux/types.h>
+
#define SYSFS_DEVICE_PATH "/sys/bus/usb/devices"
struct usbfs_ctrltransfer {
@@ -116,6 +118,11 @@ struct usbfs_hub_portinfo {
unsigned char port[127]; /* port to device num mapping */
};
+#define USBFS_CAP_ZERO_PACKET 0x01
+#define USBFS_CAP_BULK_CONTINUATION 0x02
+#define USBFS_CAP_NO_PACKET_SIZE_LIM 0x04
+#define USBFS_CAP_BULK_SCATTER_GATHER 0x08
+
#define IOCTL_USBFS_CONTROL _IOWR('U', 0, struct usbfs_ctrltransfer)
#define IOCTL_USBFS_BULK _IOWR('U', 2, struct usbfs_bulktransfer)
#define IOCTL_USBFS_RESETEP _IOR('U', 3, unsigned int)
@@ -135,5 +142,8 @@ struct usbfs_hub_portinfo {
#define IOCTL_USBFS_CLEAR_HALT _IOR('U', 21, unsigned int)
#define IOCTL_USBFS_DISCONNECT _IO('U', 22)
#define IOCTL_USBFS_CONNECT _IO('U', 23)
+#define IOCTL_USBFS_CLAIM_PORT _IOR('U', 24, unsigned int)
+#define IOCTL_USBFS_RELEASE_PORT _IOR('U', 25, unsigned int)
+#define IOCTL_USBFS_GET_CAPABILITIES _IOR('U', 26, __u32)
#endif