diff options
-rw-r--r-- | drivers/usb/core/config.c | 185 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 22 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 13 | ||||
-rw-r--r-- | include/linux/usb.h | 19 |
4 files changed, 68 insertions, 171 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index e4909c26becb..83126b03e7cf 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -21,32 +21,6 @@ static inline const char *plural(int n) | |||
21 | return (n == 1 ? "" : "s"); | 21 | return (n == 1 ? "" : "s"); |
22 | } | 22 | } |
23 | 23 | ||
24 | /* FIXME: this is a kludge */ | ||
25 | static int find_next_descriptor_more(unsigned char *buffer, int size, | ||
26 | int dt1, int dt2, int dt3, int *num_skipped) | ||
27 | { | ||
28 | struct usb_descriptor_header *h; | ||
29 | int n = 0; | ||
30 | unsigned char *buffer0 = buffer; | ||
31 | |||
32 | /* Find the next descriptor of type dt1 or dt2 or dt3 */ | ||
33 | while (size > 0) { | ||
34 | h = (struct usb_descriptor_header *) buffer; | ||
35 | if (h->bDescriptorType == dt1 || h->bDescriptorType == dt2 || | ||
36 | h->bDescriptorType == dt3) | ||
37 | break; | ||
38 | buffer += h->bLength; | ||
39 | size -= h->bLength; | ||
40 | ++n; | ||
41 | } | ||
42 | |||
43 | /* Store the number of descriptors skipped and return the | ||
44 | * number of bytes skipped */ | ||
45 | if (num_skipped) | ||
46 | *num_skipped = n; | ||
47 | return buffer - buffer0; | ||
48 | } | ||
49 | |||
50 | static int find_next_descriptor(unsigned char *buffer, int size, | 24 | static int find_next_descriptor(unsigned char *buffer, int size, |
51 | int dt1, int dt2, int *num_skipped) | 25 | int dt1, int dt2, int *num_skipped) |
52 | { | 26 | { |
@@ -71,47 +45,41 @@ static int find_next_descriptor(unsigned char *buffer, int size, | |||
71 | return buffer - buffer0; | 45 | return buffer - buffer0; |
72 | } | 46 | } |
73 | 47 | ||
74 | static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | 48 | static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, |
75 | int inum, int asnum, struct usb_host_endpoint *ep, | 49 | int inum, int asnum, struct usb_host_endpoint *ep, |
76 | int num_ep, unsigned char *buffer, int size) | 50 | unsigned char *buffer, int size) |
77 | { | 51 | { |
78 | unsigned char *buffer_start = buffer; | 52 | struct usb_ss_ep_comp_descriptor *desc; |
79 | struct usb_ss_ep_comp_descriptor *desc; | ||
80 | int retval; | ||
81 | int num_skipped; | ||
82 | int max_tx; | 53 | int max_tx; |
83 | int i; | ||
84 | 54 | ||
55 | /* The SuperSpeed endpoint companion descriptor is supposed to | ||
56 | * be the first thing immediately following the endpoint descriptor. | ||
57 | */ | ||
85 | desc = (struct usb_ss_ep_comp_descriptor *) buffer; | 58 | desc = (struct usb_ss_ep_comp_descriptor *) buffer; |
86 | if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) { | 59 | if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP || |
60 | size < USB_DT_SS_EP_COMP_SIZE) { | ||
87 | dev_warn(ddev, "No SuperSpeed endpoint companion for config %d " | 61 | dev_warn(ddev, "No SuperSpeed endpoint companion for config %d " |
88 | " interface %d altsetting %d ep %d: " | 62 | " interface %d altsetting %d ep %d: " |
89 | "using minimum values\n", | 63 | "using minimum values\n", |
90 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 64 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
91 | /* | 65 | |
92 | * The next descriptor is for an Endpoint or Interface, | 66 | /* Fill in some default values. |
93 | * no extra descriptors to copy into the companion structure, | 67 | * Leave bmAttributes as zero, which will mean no streams for |
94 | * and we didn't eat up any of the buffer. | 68 | * bulk, and isoc won't support multiple bursts of packets. |
69 | * With bursts of only one packet, and a Mult of 1, the max | ||
70 | * amount of data moved per endpoint service interval is one | ||
71 | * packet. | ||
95 | */ | 72 | */ |
96 | return 0; | 73 | ep->ss_ep_comp.bLength = USB_DT_SS_EP_COMP_SIZE; |
74 | ep->ss_ep_comp.bDescriptorType = USB_DT_SS_ENDPOINT_COMP; | ||
75 | if (usb_endpoint_xfer_isoc(&ep->desc) || | ||
76 | usb_endpoint_xfer_int(&ep->desc)) | ||
77 | ep->ss_ep_comp.wBytesPerInterval = | ||
78 | ep->desc.wMaxPacketSize; | ||
79 | return; | ||
97 | } | 80 | } |
98 | memcpy(&ep->ss_ep_comp->desc, desc, USB_DT_SS_EP_COMP_SIZE); | ||
99 | desc = &ep->ss_ep_comp->desc; | ||
100 | buffer += desc->bLength; | ||
101 | size -= desc->bLength; | ||
102 | 81 | ||
103 | /* Eat up the other descriptors we don't care about */ | 82 | memcpy(&ep->ss_ep_comp, desc, USB_DT_SS_EP_COMP_SIZE); |
104 | ep->ss_ep_comp->extra = buffer; | ||
105 | i = find_next_descriptor(buffer, size, USB_DT_ENDPOINT, | ||
106 | USB_DT_INTERFACE, &num_skipped); | ||
107 | ep->ss_ep_comp->extralen = i; | ||
108 | buffer += i; | ||
109 | size -= i; | ||
110 | retval = buffer - buffer_start; | ||
111 | if (num_skipped > 0) | ||
112 | dev_dbg(ddev, "skipped %d descriptor%s after %s\n", | ||
113 | num_skipped, plural(num_skipped), | ||
114 | "SuperSpeed endpoint companion"); | ||
115 | 83 | ||
116 | /* Check the various values */ | 84 | /* Check the various values */ |
117 | if (usb_endpoint_xfer_control(&ep->desc) && desc->bMaxBurst != 0) { | 85 | if (usb_endpoint_xfer_control(&ep->desc) && desc->bMaxBurst != 0) { |
@@ -119,47 +87,48 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | |||
119 | "config %d interface %d altsetting %d ep %d: " | 87 | "config %d interface %d altsetting %d ep %d: " |
120 | "setting to zero\n", desc->bMaxBurst, | 88 | "setting to zero\n", desc->bMaxBurst, |
121 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 89 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
122 | desc->bMaxBurst = 0; | 90 | ep->ss_ep_comp.bMaxBurst = 0; |
123 | } | 91 | } else if (desc->bMaxBurst > 15) { |
124 | if (desc->bMaxBurst > 15) { | ||
125 | dev_warn(ddev, "Endpoint with bMaxBurst = %d in " | 92 | dev_warn(ddev, "Endpoint with bMaxBurst = %d in " |
126 | "config %d interface %d altsetting %d ep %d: " | 93 | "config %d interface %d altsetting %d ep %d: " |
127 | "setting to 15\n", desc->bMaxBurst, | 94 | "setting to 15\n", desc->bMaxBurst, |
128 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 95 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
129 | desc->bMaxBurst = 15; | 96 | ep->ss_ep_comp.bMaxBurst = 15; |
130 | } | 97 | } |
131 | if ((usb_endpoint_xfer_control(&ep->desc) || usb_endpoint_xfer_int(&ep->desc)) | 98 | |
132 | && desc->bmAttributes != 0) { | 99 | if ((usb_endpoint_xfer_control(&ep->desc) || |
100 | usb_endpoint_xfer_int(&ep->desc)) && | ||
101 | desc->bmAttributes != 0) { | ||
133 | dev_warn(ddev, "%s endpoint with bmAttributes = %d in " | 102 | dev_warn(ddev, "%s endpoint with bmAttributes = %d in " |
134 | "config %d interface %d altsetting %d ep %d: " | 103 | "config %d interface %d altsetting %d ep %d: " |
135 | "setting to zero\n", | 104 | "setting to zero\n", |
136 | usb_endpoint_xfer_control(&ep->desc) ? "Control" : "Bulk", | 105 | usb_endpoint_xfer_control(&ep->desc) ? "Control" : "Bulk", |
137 | desc->bmAttributes, | 106 | desc->bmAttributes, |
138 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 107 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
139 | desc->bmAttributes = 0; | 108 | ep->ss_ep_comp.bmAttributes = 0; |
140 | } | 109 | } else if (usb_endpoint_xfer_bulk(&ep->desc) && |
141 | if (usb_endpoint_xfer_bulk(&ep->desc) && desc->bmAttributes > 16) { | 110 | desc->bmAttributes > 16) { |
142 | dev_warn(ddev, "Bulk endpoint with more than 65536 streams in " | 111 | dev_warn(ddev, "Bulk endpoint with more than 65536 streams in " |
143 | "config %d interface %d altsetting %d ep %d: " | 112 | "config %d interface %d altsetting %d ep %d: " |
144 | "setting to max\n", | 113 | "setting to max\n", |
145 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 114 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
146 | desc->bmAttributes = 16; | 115 | ep->ss_ep_comp.bmAttributes = 16; |
147 | } | 116 | } else if (usb_endpoint_xfer_isoc(&ep->desc) && |
148 | if (usb_endpoint_xfer_isoc(&ep->desc) && desc->bmAttributes > 2) { | 117 | desc->bmAttributes > 2) { |
149 | dev_warn(ddev, "Isoc endpoint has Mult of %d in " | 118 | dev_warn(ddev, "Isoc endpoint has Mult of %d in " |
150 | "config %d interface %d altsetting %d ep %d: " | 119 | "config %d interface %d altsetting %d ep %d: " |
151 | "setting to 3\n", desc->bmAttributes + 1, | 120 | "setting to 3\n", desc->bmAttributes + 1, |
152 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 121 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
153 | desc->bmAttributes = 2; | 122 | ep->ss_ep_comp.bmAttributes = 2; |
154 | } | 123 | } |
155 | if (usb_endpoint_xfer_isoc(&ep->desc)) { | 124 | |
125 | if (usb_endpoint_xfer_isoc(&ep->desc)) | ||
156 | max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1) * | 126 | max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1) * |
157 | (desc->bmAttributes + 1); | 127 | (desc->bmAttributes + 1); |
158 | } else if (usb_endpoint_xfer_int(&ep->desc)) { | 128 | else if (usb_endpoint_xfer_int(&ep->desc)) |
159 | max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1); | 129 | max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1); |
160 | } else { | 130 | else |
161 | goto valid; | 131 | max_tx = 999999; |
162 | } | ||
163 | if (desc->wBytesPerInterval > max_tx) { | 132 | if (desc->wBytesPerInterval > max_tx) { |
164 | dev_warn(ddev, "%s endpoint with wBytesPerInterval of %d in " | 133 | dev_warn(ddev, "%s endpoint with wBytesPerInterval of %d in " |
165 | "config %d interface %d altsetting %d ep %d: " | 134 | "config %d interface %d altsetting %d ep %d: " |
@@ -168,10 +137,8 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | |||
168 | desc->wBytesPerInterval, | 137 | desc->wBytesPerInterval, |
169 | cfgno, inum, asnum, ep->desc.bEndpointAddress, | 138 | cfgno, inum, asnum, ep->desc.bEndpointAddress, |
170 | max_tx); | 139 | max_tx); |
171 | desc->wBytesPerInterval = max_tx; | 140 | ep->ss_ep_comp.wBytesPerInterval = max_tx; |
172 | } | 141 | } |
173 | valid: | ||
174 | return retval; | ||
175 | } | 142 | } |
176 | 143 | ||
177 | static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | 144 | static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
@@ -293,61 +260,19 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
293 | cfgno, inum, asnum, d->bEndpointAddress, | 260 | cfgno, inum, asnum, d->bEndpointAddress, |
294 | maxp); | 261 | maxp); |
295 | } | 262 | } |
296 | /* Allocate room for and parse any SS endpoint companion descriptors */ | ||
297 | if (to_usb_device(ddev)->speed == USB_SPEED_SUPER) { | ||
298 | endpoint->extra = buffer; | ||
299 | i = find_next_descriptor_more(buffer, size, USB_DT_SS_ENDPOINT_COMP, | ||
300 | USB_DT_ENDPOINT, USB_DT_INTERFACE, &n); | ||
301 | endpoint->extralen = i; | ||
302 | buffer += i; | ||
303 | size -= i; | ||
304 | |||
305 | /* Allocate space for the SS endpoint companion descriptor */ | ||
306 | endpoint->ss_ep_comp = kzalloc(sizeof(struct usb_host_ss_ep_comp), | ||
307 | GFP_KERNEL); | ||
308 | if (!endpoint->ss_ep_comp) | ||
309 | return -ENOMEM; | ||
310 | 263 | ||
311 | /* Fill in some default values (may be overwritten later) */ | 264 | /* Parse a possible SuperSpeed endpoint companion descriptor */ |
312 | endpoint->ss_ep_comp->desc.bLength = USB_DT_SS_EP_COMP_SIZE; | 265 | if (to_usb_device(ddev)->speed == USB_SPEED_SUPER) |
313 | endpoint->ss_ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP; | 266 | usb_parse_ss_endpoint_companion(ddev, cfgno, |
314 | endpoint->ss_ep_comp->desc.bMaxBurst = 0; | 267 | inum, asnum, endpoint, buffer, size); |
315 | /* | 268 | |
316 | * Leave bmAttributes as zero, which will mean no streams for | 269 | /* Skip over any Class Specific or Vendor Specific descriptors; |
317 | * bulk, and isoc won't support multiple bursts of packets. | 270 | * find the next endpoint or interface descriptor */ |
318 | * With bursts of only one packet, and a Mult of 1, the max | 271 | endpoint->extra = buffer; |
319 | * amount of data moved per endpoint service interval is one | 272 | i = find_next_descriptor(buffer, size, USB_DT_ENDPOINT, |
320 | * packet. | 273 | USB_DT_INTERFACE, &n); |
321 | */ | 274 | endpoint->extralen = i; |
322 | if (usb_endpoint_xfer_isoc(&endpoint->desc) || | 275 | retval = buffer - buffer0 + i; |
323 | usb_endpoint_xfer_int(&endpoint->desc)) | ||
324 | endpoint->ss_ep_comp->desc.wBytesPerInterval = | ||
325 | endpoint->desc.wMaxPacketSize; | ||
326 | |||
327 | if (size > 0) { | ||
328 | retval = usb_parse_ss_endpoint_companion(ddev, cfgno, | ||
329 | inum, asnum, endpoint, num_ep, buffer, | ||
330 | size); | ||
331 | if (retval >= 0) { | ||
332 | buffer += retval; | ||
333 | retval = buffer - buffer0; | ||
334 | } | ||
335 | } else { | ||
336 | dev_warn(ddev, "config %d interface %d altsetting %d " | ||
337 | "endpoint 0x%X has no " | ||
338 | "SuperSpeed companion descriptor\n", | ||
339 | cfgno, inum, asnum, d->bEndpointAddress); | ||
340 | retval = buffer - buffer0; | ||
341 | } | ||
342 | } else { | ||
343 | /* Skip over any Class Specific or Vendor Specific descriptors; | ||
344 | * find the next endpoint or interface descriptor */ | ||
345 | endpoint->extra = buffer; | ||
346 | i = find_next_descriptor(buffer, size, USB_DT_ENDPOINT, | ||
347 | USB_DT_INTERFACE, &n); | ||
348 | endpoint->extralen = i; | ||
349 | retval = buffer - buffer0 + i; | ||
350 | } | ||
351 | if (n > 0) | 276 | if (n > 0) |
352 | dev_dbg(ddev, "skipped %d descriptor%s after %s\n", | 277 | dev_dbg(ddev, "skipped %d descriptor%s after %s\n", |
353 | n, plural(n), "endpoint"); | 278 | n, plural(n), "endpoint"); |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 4df752cb0f78..fd9e03afd91c 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1010,9 +1010,9 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1010 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | 1010 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, |
1011 | struct usb_host_endpoint *ep) | 1011 | struct usb_host_endpoint *ep) |
1012 | { | 1012 | { |
1013 | if (udev->speed != USB_SPEED_SUPER || !ep->ss_ep_comp) | 1013 | if (udev->speed != USB_SPEED_SUPER) |
1014 | return 0; | 1014 | return 0; |
1015 | return ep->ss_ep_comp->desc.bmAttributes; | 1015 | return ep->ss_ep_comp.bmAttributes; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, | 1018 | static inline u32 xhci_get_endpoint_type(struct usb_device *udev, |
@@ -1061,13 +1061,8 @@ static inline u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, | |||
1061 | usb_endpoint_xfer_bulk(&ep->desc)) | 1061 | usb_endpoint_xfer_bulk(&ep->desc)) |
1062 | return 0; | 1062 | return 0; |
1063 | 1063 | ||
1064 | if (udev->speed == USB_SPEED_SUPER) { | 1064 | if (udev->speed == USB_SPEED_SUPER) |
1065 | if (ep->ss_ep_comp) | 1065 | return ep->ss_ep_comp.wBytesPerInterval; |
1066 | return ep->ss_ep_comp->desc.wBytesPerInterval; | ||
1067 | xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); | ||
1068 | /* Assume no bursts, no multiple opportunities to send. */ | ||
1069 | return ep->desc.wMaxPacketSize; | ||
1070 | } | ||
1071 | 1066 | ||
1072 | max_packet = ep->desc.wMaxPacketSize & 0x3ff; | 1067 | max_packet = ep->desc.wMaxPacketSize & 0x3ff; |
1073 | max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11; | 1068 | max_burst = (ep->desc.wMaxPacketSize & 0x1800) >> 11; |
@@ -1131,12 +1126,9 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
1131 | max_packet = ep->desc.wMaxPacketSize; | 1126 | max_packet = ep->desc.wMaxPacketSize; |
1132 | ep_ctx->ep_info2 |= MAX_PACKET(max_packet); | 1127 | ep_ctx->ep_info2 |= MAX_PACKET(max_packet); |
1133 | /* dig out max burst from ep companion desc */ | 1128 | /* dig out max burst from ep companion desc */ |
1134 | if (!ep->ss_ep_comp) { | 1129 | max_packet = ep->ss_ep_comp.bMaxBurst; |
1135 | xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); | 1130 | if (!max_packet) |
1136 | max_packet = 0; | 1131 | xhci_warn(xhci, "WARN no SS endpoint bMaxBurst\n"); |
1137 | } else { | ||
1138 | max_packet = ep->ss_ep_comp->desc.bMaxBurst; | ||
1139 | } | ||
1140 | ep_ctx->ep_info2 |= MAX_BURST(max_packet); | 1132 | ep_ctx->ep_info2 |= MAX_BURST(max_packet); |
1141 | break; | 1133 | break; |
1142 | case USB_SPEED_HIGH: | 1134 | case USB_SPEED_HIGH: |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 3cac2ff8b50a..59f38a5f2fe6 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -1476,13 +1476,7 @@ static int xhci_check_streams_endpoint(struct xhci_hcd *xhci, | |||
1476 | ret = xhci_check_args(xhci_to_hcd(xhci), udev, ep, 1, __func__); | 1476 | ret = xhci_check_args(xhci_to_hcd(xhci), udev, ep, 1, __func__); |
1477 | if (ret <= 0) | 1477 | if (ret <= 0) |
1478 | return -EINVAL; | 1478 | return -EINVAL; |
1479 | if (!ep->ss_ep_comp) { | 1479 | if (ep->ss_ep_comp.bmAttributes == 0) { |
1480 | xhci_warn(xhci, "WARN: No SuperSpeed Endpoint Companion" | ||
1481 | " descriptor for ep 0x%x\n", | ||
1482 | ep->desc.bEndpointAddress); | ||
1483 | return -EINVAL; | ||
1484 | } | ||
1485 | if (ep->ss_ep_comp->desc.bmAttributes == 0) { | ||
1486 | xhci_warn(xhci, "WARN: SuperSpeed Endpoint Companion" | 1480 | xhci_warn(xhci, "WARN: SuperSpeed Endpoint Companion" |
1487 | " descriptor for ep 0x%x does not support streams\n", | 1481 | " descriptor for ep 0x%x does not support streams\n", |
1488 | ep->desc.bEndpointAddress); | 1482 | ep->desc.bEndpointAddress); |
@@ -1540,7 +1534,6 @@ static int xhci_calculate_streams_and_bitmask(struct xhci_hcd *xhci, | |||
1540 | struct usb_host_endpoint **eps, unsigned int num_eps, | 1534 | struct usb_host_endpoint **eps, unsigned int num_eps, |
1541 | unsigned int *num_streams, u32 *changed_ep_bitmask) | 1535 | unsigned int *num_streams, u32 *changed_ep_bitmask) |
1542 | { | 1536 | { |
1543 | struct usb_host_ss_ep_comp *ss_ep_comp; | ||
1544 | unsigned int max_streams; | 1537 | unsigned int max_streams; |
1545 | unsigned int endpoint_flag; | 1538 | unsigned int endpoint_flag; |
1546 | int i; | 1539 | int i; |
@@ -1552,8 +1545,8 @@ static int xhci_calculate_streams_and_bitmask(struct xhci_hcd *xhci, | |||
1552 | if (ret < 0) | 1545 | if (ret < 0) |
1553 | return ret; | 1546 | return ret; |
1554 | 1547 | ||
1555 | ss_ep_comp = eps[i]->ss_ep_comp; | 1548 | max_streams = USB_SS_MAX_STREAMS( |
1556 | max_streams = USB_SS_MAX_STREAMS(ss_ep_comp->desc.bmAttributes); | 1549 | eps[i]->ss_ep_comp.bmAttributes); |
1557 | if (max_streams < (*num_streams - 1)) { | 1550 | if (max_streams < (*num_streams - 1)) { |
1558 | xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n", | 1551 | xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n", |
1559 | eps[i]->desc.bEndpointAddress, | 1552 | eps[i]->desc.bEndpointAddress, |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 1ea25377ca0d..a748815ee629 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -45,27 +45,14 @@ struct wusb_dev; | |||
45 | 45 | ||
46 | struct ep_device; | 46 | struct ep_device; |
47 | 47 | ||
48 | /* For SS devices */ | ||
49 | /** | ||
50 | * struct usb_host_ss_ep_comp - Valid for SuperSpeed devices only | ||
51 | * @desc: endpoint companion descriptor, wMaxPacketSize in native byteorder | ||
52 | * @extra: descriptors following this endpoint companion descriptor | ||
53 | * @extralen: how many bytes of "extra" are valid | ||
54 | */ | ||
55 | struct usb_host_ss_ep_comp { | ||
56 | struct usb_ss_ep_comp_descriptor desc; | ||
57 | unsigned char *extra; /* Extra descriptors */ | ||
58 | int extralen; | ||
59 | }; | ||
60 | |||
61 | /** | 48 | /** |
62 | * struct usb_host_endpoint - host-side endpoint descriptor and queue | 49 | * struct usb_host_endpoint - host-side endpoint descriptor and queue |
63 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder | 50 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder |
51 | * @ss_ep_comp: SuperSpeed companion descriptor for this endpoint | ||
64 | * @urb_list: urbs queued to this endpoint; maintained by usbcore | 52 | * @urb_list: urbs queued to this endpoint; maintained by usbcore |
65 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) | 53 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) |
66 | * with one or more transfer descriptors (TDs) per urb | 54 | * with one or more transfer descriptors (TDs) per urb |
67 | * @ep_dev: ep_device for sysfs info | 55 | * @ep_dev: ep_device for sysfs info |
68 | * @ss_ep_comp: companion descriptor information for this endpoint | ||
69 | * @extra: descriptors following this endpoint in the configuration | 56 | * @extra: descriptors following this endpoint in the configuration |
70 | * @extralen: how many bytes of "extra" are valid | 57 | * @extralen: how many bytes of "extra" are valid |
71 | * @enabled: URBs may be submitted to this endpoint | 58 | * @enabled: URBs may be submitted to this endpoint |
@@ -74,11 +61,11 @@ struct usb_host_ss_ep_comp { | |||
74 | * descriptor within an active interface in a given USB configuration. | 61 | * descriptor within an active interface in a given USB configuration. |
75 | */ | 62 | */ |
76 | struct usb_host_endpoint { | 63 | struct usb_host_endpoint { |
77 | struct usb_endpoint_descriptor desc; | 64 | struct usb_endpoint_descriptor desc; |
65 | struct usb_ss_ep_comp_descriptor ss_ep_comp; | ||
78 | struct list_head urb_list; | 66 | struct list_head urb_list; |
79 | void *hcpriv; | 67 | void *hcpriv; |
80 | struct ep_device *ep_dev; /* For sysfs info */ | 68 | struct ep_device *ep_dev; /* For sysfs info */ |
81 | struct usb_host_ss_ep_comp *ss_ep_comp; /* For SS devices */ | ||
82 | 69 | ||
83 | unsigned char *extra; /* Extra descriptors */ | 70 | unsigned char *extra; /* Extra descriptors */ |
84 | int extralen; | 71 | int extralen; |