aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-10-09 11:19:29 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2014-03-04 18:38:04 -0500
commit948cd8c18c466fdcbe707bb2a42a148796bfccdd (patch)
treeaa01759923cee68262cc5ed40340576afbc436e3 /include/uapi/linux
parentb2d03eb56e66620a9b27f1a0c2795722087effc9 (diff)
usbfs: Add support for bulk stream ids
This patch makes it possible to specify a bulk stream id when submitting an urb using the async usbfs API. It overloads the number_of_packets usbdevfs_urb field for this. This is not pretty, but given other constraints it is the best we can do. The reasoning leading to this goes as follows: 1) We want to support bulk streams in the usbfs API 2) We do not want to extend the usbdevfs_urb struct with a new member, as that would mean defining new ioctl numbers for all async API ioctls + adding compat versions for the old ones (times 2 for 32 bit support) 3) 1 + 2 means we need to re-use an existing field 4) number_of_packets is only used for isoc urbs, and streams are bulk only so it is the best (and only) candidate for re-using Note that: 1) This patch only uses number_of_packets as stream_id if the app has actually allocated streams on the ep, so that old apps which may have garbage in there (as it was unused until now in the bulk case), will not break 2) This patch does not add support for allocating / freeing bulk-streams, that is done in a follow up patch Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/usbdevice_fs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbdevice_fs.h
index 0c65e4b12617..cbf122db56bc 100644
--- a/include/uapi/linux/usbdevice_fs.h
+++ b/include/uapi/linux/usbdevice_fs.h
@@ -102,7 +102,10 @@ struct usbdevfs_urb {
102 int buffer_length; 102 int buffer_length;
103 int actual_length; 103 int actual_length;
104 int start_frame; 104 int start_frame;
105 int number_of_packets; 105 union {
106 int number_of_packets; /* Only used for isoc urbs */
107 unsigned int stream_id; /* Only used with bulk streams */
108 };
106 int error_count; 109 int error_count;
107 unsigned int signr; /* signal to be sent on completion, 110 unsigned int signr; /* signal to be sent on completion,
108 or 0 if none should be sent. */ 111 or 0 if none should be sent. */