diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-04-30 12:44:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:40 -0400 |
commit | 842f16905dfc6743c1dd80c3d29b49ba3ab7f7c8 (patch) | |
tree | 2d193389359d78580b1652325bb83e57a59e77fa /drivers/usb/host | |
parent | 3b02ca3218cf878e206545041aa811073e4f6c79 (diff) |
USB: remove the usb_host_ss_ep_comp structure
This patch (as1375) eliminates the usb_host_ss_ep_comp structure used
for storing a dynamically-allocated copy of the SuperSpeed endpoint
companion descriptor. The SuperSpeed descriptor is placed directly in
the usb_host_endpoint structure, alongside the standard endpoint
descriptor.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 22 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 13 |
2 files changed, 10 insertions, 25 deletions
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, |