hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/include/uapi/linux/usbdevice_fs.h
....@@ -76,6 +76,26 @@
7676 unsigned char slow;
7777 };
7878
79
+struct usbdevfs_conninfo_ex {
80
+ __u32 size; /* Size of the structure from the kernel's */
81
+ /* point of view. Can be used by userspace */
82
+ /* to determine how much data can be */
83
+ /* used/trusted. */
84
+ __u32 busnum; /* USB bus number, as enumerated by the */
85
+ /* kernel, the device is connected to. */
86
+ __u32 devnum; /* Device address on the bus. */
87
+ __u32 speed; /* USB_SPEED_* constants from ch9.h */
88
+ __u8 num_ports; /* Number of ports the device is connected */
89
+ /* to on the way to the root hub. It may */
90
+ /* be bigger than size of 'ports' array so */
91
+ /* userspace can detect overflows. */
92
+ __u8 ports[7]; /* List of ports on the way from the root */
93
+ /* hub to the device. Current limit in */
94
+ /* USB specification is 7 tiers (root hub, */
95
+ /* 5 intermediate hubs, device), which */
96
+ /* gives at most 6 port entries. */
97
+};
98
+
7999 #define USBDEVFS_URB_SHORT_NOT_OK 0x01
80100 #define USBDEVFS_URB_ISO_ASAP 0x02
81101 #define USBDEVFS_URB_BULK_CONTINUATION 0x04
....@@ -137,6 +157,8 @@
137157 #define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10
138158 #define USBDEVFS_CAP_MMAP 0x20
139159 #define USBDEVFS_CAP_DROP_PRIVILEGES 0x40
160
+#define USBDEVFS_CAP_CONNINFO_EX 0x80
161
+#define USBDEVFS_CAP_SUSPEND 0x100
140162
141163 /* USBDEVFS_DISCONNECT_CLAIM flags & struct */
142164
....@@ -197,5 +219,13 @@
197219 #define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
198220 #define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32)
199221 #define USBDEVFS_GET_SPEED _IO('U', 31)
222
+/*
223
+ * Returns struct usbdevfs_conninfo_ex; length is variable to allow
224
+ * extending size of the data returned.
225
+ */
226
+#define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len)
227
+#define USBDEVFS_FORBID_SUSPEND _IO('U', 33)
228
+#define USBDEVFS_ALLOW_SUSPEND _IO('U', 34)
229
+#define USBDEVFS_WAIT_FOR_RESUME _IO('U', 35)
200230
201231 #endif /* _UAPI_LINUX_USBDEVICE_FS_H */