diff options
author | Tatyana Brokhman <tlinder@codeaurora.org> | 2011-06-28 16:33:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-28 11:20:15 -0700 |
commit | a59d6b91cbca52235e3ed9f7f9e34c4f2f3e1996 (patch) | |
tree | 664cd1de638695c0f4ad8c73df27382a3ecc6659 /include | |
parent | 7c884fe4d74d17efc83b19f3dc898a75f03859e9 (diff) |
usb: gadget: add streams support to the gadget framework
This patch defines necessary fields to support
streaming for USB3.0.
It implements a new function, called
usb_ep_autoconfig_ss(), to be used instead of the
existing usb_ep_autoconfig() when working in
SuperSpeed mode and there is a need to search for
an endpoint according to the number of required
streams.
[ balbi@ti.com : slight changes to commit log ]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/gadget.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index d22b4a4936cb..625971292c20 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -28,6 +28,7 @@ struct usb_ep; * field, and the usb controller needs one, it is responsible * for mapping and unmapping the buffer. * @length: Length of that data + * @stream_id: The stream id, when USB3.0 bulk streams are being used * @no_interrupt: If true, hints that no completion irq is needed. * Helpful sometimes with deep request queues that are handled * directly by DMA controllers. @@ -82,6 +83,7 @@ struct usb_request { unsigned length; dma_addr_t dma; + unsigned stream_id:16; unsigned no_interrupt:1; unsigned zero:1; unsigned short_not_ok:1; @@ -132,11 +134,15 @@ struct usb_ep_ops { * @maxpacket:The maximum packet size used on this endpoint. The initial * value can sometimes be reduced (hardware allowing), according to * the endpoint descriptor used to configure the endpoint. + * @max_streams: The maximum number of streams supported + * by this EP (0 - 16, actual number is 2^n) * @driver_data:for use by the gadget driver. * @address: used to identify the endpoint when finding descriptor that * matches connection speed * @desc: endpoint descriptor. This pointer is set before the endpoint is * enabled and remains valid until the endpoint is disabled. + * @comp_desc: In case of SuperSpeed support, this is the endpoint companion + * descriptor that is used to configure the endpoint * * the bus controller driver lists all the general purpose endpoints in * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, @@ -149,8 +155,10 @@ struct usb_ep { const struct usb_ep_ops *ops; struct list_head ep_list; unsigned maxpacket:16; + unsigned max_streams:16; u8 address; const struct usb_endpoint_descriptor *desc; + const struct usb_ss_ep_comp_descriptor *comp_desc; }; /*-------------------------------------------------------------------------*/ @@ -895,6 +903,11 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v) extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, struct usb_endpoint_descriptor *); + +extern struct usb_ep *usb_ep_autoconfig_ss(struct usb_gadget *, + struct usb_endpoint_descriptor *, + struct usb_ss_ep_comp_descriptor *); + extern void usb_ep_autoconfig_reset(struct usb_gadget *); #endif /* __LINUX_USB_GADGET_H */ |