History

usbfs: Add support for allocating / freeing streams

This allows userspace to use bulk-streams, just like in kernel drivers, see Documentation/usb/bulk-streams.txt for details on the in kernel API. This is exported pretty much one on one to userspace. To use streams an app must first make a USBDEVFS_ALLOC_STREAMS ioctl, on success this will return the number of streams available (which may be less then requested). If there are n streams the app can then submit usbdevfs_urb-s with their stream_id member set to 1-n to use a specific stream. IE if USBDEVFS_ALLOC_STREAMS returns 4 then stream_id 1-4 can be used. When the app is done using streams it should call USBDEVFS_FREE_STREAMS Note applications are advised to use libusb rather then using the usbdevfs api directly. The latest version of libusb has support for streams.

Hans de Goede committed 13 years ago

Commit bcf7f6e1 parent 2fec32b2 files · +125 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/usbdevice_fs.h+7−0
@@ -147,6 +147,11 @@ struct usbdevfs_disconnect_claim { · 146 unmodified lines
147147 char driver[USBDEVFS_MAXDRIVERNAME + 1];
148148 };
149149
150+struct usbdevfs_streams {
151+ unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */
152+ unsigned int num_eps;
153+ unsigned char eps[0];
154+};
150155
151156 #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
152157 #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
@@ -179,5 +184,7 @@ struct usbdevfs_disconnect_claim { · 26 unmodified lines
179184 #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
180185 #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
181186 #define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
187+#define USBDEVFS_ALLOC_STREAMS _IOR('U', 28, struct usbdevfs_streams)
188+#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
182189
183190 #endif /* _UAPI_LINUX_USBDEVICE_FS_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t