aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-04-05 13:55:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:38 -0400
commiteab1cafc3b524b714b0567ab98fc75ace09db98c (patch)
tree854ed5c4cba741efabec933714dac5c68bcbb452 /include/linux/usb
parente9df17eb1408cfafa3d1844bfc7f22c7237b31b8 (diff)
USB: Support for allocating USB 3.0 streams.
Bulk endpoint streams were added in the USB 3.0 specification. Streams allow a device driver to overload a bulk endpoint so that multiple transfers can be queued at once. The device then decides which transfer it wants to work on first, and can queue part of a transfer before it switches to a new stream. All this switching is invisible to the device driver, which just gets a completion for the URB. Drivers that use streams must be able to handle URBs completing in a different order than they were submitted to the endpoint. This requires adding new API to set up xHCI data structures to support multiple queues ("stream rings") per endpoint. Drivers will allocate a number of stream IDs before enqueueing URBs to the bulk endpoints of the device, and free the stream IDs in their disconnect function. See Documentation/usb/bulk-streams.txt for details. The new mass storage device class, USB Attached SCSI Protocol (UASP), uses these streams API. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/hcd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index d268415b7a40..aca73a5c3af7 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -250,6 +250,16 @@ struct hc_driver {
250 int (*alloc_dev)(struct usb_hcd *, struct usb_device *); 250 int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
251 /* Called by usb_disconnect to free HC device structures */ 251 /* Called by usb_disconnect to free HC device structures */
252 void (*free_dev)(struct usb_hcd *, struct usb_device *); 252 void (*free_dev)(struct usb_hcd *, struct usb_device *);
253 /* Change a group of bulk endpoints to support multiple stream IDs */
254 int (*alloc_streams)(struct usb_hcd *hcd, struct usb_device *udev,
255 struct usb_host_endpoint **eps, unsigned int num_eps,
256 unsigned int num_streams, gfp_t mem_flags);
257 /* Reverts a group of bulk endpoints back to not using stream IDs.
258 * Can fail if we run out of memory.
259 */
260 int (*free_streams)(struct usb_hcd *hcd, struct usb_device *udev,
261 struct usb_host_endpoint **eps, unsigned int num_eps,
262 gfp_t mem_flags);
253 263
254 /* Bandwidth computation functions */ 264 /* Bandwidth computation functions */
255 /* Note that add_endpoint() can only be called once per endpoint before 265 /* Note that add_endpoint() can only be called once per endpoint before