diff options
author | Tatyana Brokhman <tlinder@codeaurora.org> | 2011-06-28 09:33:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-28 14:20:15 -0400 |
commit | a59d6b91cbca52235e3ed9f7f9e34c4f2f3e1996 (patch) | |
tree | 664cd1de638695c0f4ad8c73df27382a3ecc6659 /include/linux/usb | |
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/linux/usb')
-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; | |||
28 | * field, and the usb controller needs one, it is responsible | 28 | * field, and the usb controller needs one, it is responsible |
29 | * for mapping and unmapping the buffer. | 29 | * for mapping and unmapping the buffer. |
30 | * @length: Length of that data | 30 | * @length: Length of that data |
31 | * @stream_id: The stream id, when USB3.0 bulk streams are being used | ||
31 | * @no_interrupt: If true, hints that no completion irq is needed. | 32 | * @no_interrupt: If true, hints that no completion irq is needed. |
32 | * Helpful sometimes with deep request queues that are handled | 33 | * Helpful sometimes with deep request queues that are handled |
33 | * directly by DMA controllers. | 34 | * directly by DMA controllers. |
@@ -82,6 +83,7 @@ struct usb_request { | |||
82 | unsigned length; | 83 | unsigned length; |
83 | dma_addr_t dma; | 84 | dma_addr_t dma; |
84 | 85 | ||
86 | unsigned stream_id:16; | ||
85 | unsigned no_interrupt:1; | 87 | unsigned no_interrupt:1; |
86 | unsigned zero:1; | 88 | unsigned zero:1; |
87 | unsigned short_not_ok:1; | 89 | unsigned short_not_ok:1; |
@@ -132,11 +134,15 @@ struct usb_ep_ops { | |||
132 | * @maxpacket:The maximum packet size used on this endpoint. The initial | 134 | * @maxpacket:The maximum packet size used on this endpoint. The initial |
133 | * value can sometimes be reduced (hardware allowing), according to | 135 | * value can sometimes be reduced (hardware allowing), according to |
134 | * the endpoint descriptor used to configure the endpoint. | 136 | * the endpoint descriptor used to configure the endpoint. |
137 | * @max_streams: The maximum number of streams supported | ||
138 | * by this EP (0 - 16, actual number is 2^n) | ||
135 | * @driver_data:for use by the gadget driver. | 139 | * @driver_data:for use by the gadget driver. |
136 | * @address: used to identify the endpoint when finding descriptor that | 140 | * @address: used to identify the endpoint when finding descriptor that |
137 | * matches connection speed | 141 | * matches connection speed |
138 | * @desc: endpoint descriptor. This pointer is set before the endpoint is | 142 | * @desc: endpoint descriptor. This pointer is set before the endpoint is |
139 | * enabled and remains valid until the endpoint is disabled. | 143 | * enabled and remains valid until the endpoint is disabled. |
144 | * @comp_desc: In case of SuperSpeed support, this is the endpoint companion | ||
145 | * descriptor that is used to configure the endpoint | ||
140 | * | 146 | * |
141 | * the bus controller driver lists all the general purpose endpoints in | 147 | * the bus controller driver lists all the general purpose endpoints in |
142 | * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, | 148 | * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, |
@@ -149,8 +155,10 @@ struct usb_ep { | |||
149 | const struct usb_ep_ops *ops; | 155 | const struct usb_ep_ops *ops; |
150 | struct list_head ep_list; | 156 | struct list_head ep_list; |
151 | unsigned maxpacket:16; | 157 | unsigned maxpacket:16; |
158 | unsigned max_streams:16; | ||
152 | u8 address; | 159 | u8 address; |
153 | const struct usb_endpoint_descriptor *desc; | 160 | const struct usb_endpoint_descriptor *desc; |
161 | const struct usb_ss_ep_comp_descriptor *comp_desc; | ||
154 | }; | 162 | }; |
155 | 163 | ||
156 | /*-------------------------------------------------------------------------*/ | 164 | /*-------------------------------------------------------------------------*/ |
@@ -895,6 +903,11 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v) | |||
895 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 903 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
896 | struct usb_endpoint_descriptor *); | 904 | struct usb_endpoint_descriptor *); |
897 | 905 | ||
906 | |||
907 | extern struct usb_ep *usb_ep_autoconfig_ss(struct usb_gadget *, | ||
908 | struct usb_endpoint_descriptor *, | ||
909 | struct usb_ss_ep_comp_descriptor *); | ||
910 | |||
898 | extern void usb_ep_autoconfig_reset(struct usb_gadget *); | 911 | extern void usb_ep_autoconfig_reset(struct usb_gadget *); |
899 | 912 | ||
900 | #endif /* __LINUX_USB_GADGET_H */ | 913 | #endif /* __LINUX_USB_GADGET_H */ |