diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-04-29 22:06:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:50 -0400 |
commit | f0058c627855ecb3b6c7185b7ad1910463c24c42 (patch) | |
tree | dfa5e75711a2a1dfe8d3b5384558290ad18cf9d6 /drivers/usb | |
parent | b7116ebca4e1a898f30ae474151fd6474327257c (diff) |
USB: Change names of SuperSpeed ep companion descriptor structs.
Differentiate between SuperSpeed endpoint companion descriptor and the
wireless USB endpoint companion descriptor. Make all structure names for
this descriptor have "ss" (SuperSpeed) in them. David Vrabel asked for
this change in http://marc.info/?l=linux-usb&m=124091465109367&w=2
Reported-by: David Vrabel <david.vrabel@csr.com>
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')
-rw-r--r-- | drivers/usb/core/config.c | 36 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 2 |
2 files changed, 20 insertions, 18 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 7103758bb486..24dfb33f90cb 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -69,30 +69,31 @@ static int find_next_descriptor(unsigned char *buffer, int size, | |||
69 | return buffer - buffer0; | 69 | return buffer - buffer0; |
70 | } | 70 | } |
71 | 71 | ||
72 | static int usb_parse_endpoint_companion(struct device *ddev, int cfgno, | 72 | static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, |
73 | int inum, int asnum, struct usb_host_endpoint *ep, | 73 | int inum, int asnum, struct usb_host_endpoint *ep, |
74 | int num_ep, unsigned char *buffer, int size) | 74 | int num_ep, unsigned char *buffer, int size) |
75 | { | 75 | { |
76 | unsigned char *buffer_start = buffer; | 76 | unsigned char *buffer_start = buffer; |
77 | struct usb_ep_comp_descriptor *desc; | 77 | struct usb_ss_ep_comp_descriptor *desc; |
78 | int retval; | 78 | int retval; |
79 | int num_skipped; | 79 | int num_skipped; |
80 | int max_tx; | 80 | int max_tx; |
81 | int i; | 81 | int i; |
82 | 82 | ||
83 | /* Allocate space for the companion descriptor */ | 83 | /* Allocate space for the SS endpoint companion descriptor */ |
84 | ep->ep_comp = kzalloc(sizeof(struct usb_host_ep_comp), GFP_KERNEL); | 84 | ep->ss_ep_comp = kzalloc(sizeof(struct usb_host_ss_ep_comp), |
85 | if (!ep->ep_comp) | 85 | GFP_KERNEL); |
86 | if (!ep->ss_ep_comp) | ||
86 | return -ENOMEM; | 87 | return -ENOMEM; |
87 | desc = (struct usb_ep_comp_descriptor *) buffer; | 88 | desc = (struct usb_ss_ep_comp_descriptor *) buffer; |
88 | if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) { | 89 | if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) { |
89 | dev_warn(ddev, "No SuperSpeed endpoint companion for config %d " | 90 | dev_warn(ddev, "No SuperSpeed endpoint companion for config %d " |
90 | " interface %d altsetting %d ep %d: " | 91 | " interface %d altsetting %d ep %d: " |
91 | "using minimum values\n", | 92 | "using minimum values\n", |
92 | cfgno, inum, asnum, ep->desc.bEndpointAddress); | 93 | cfgno, inum, asnum, ep->desc.bEndpointAddress); |
93 | ep->ep_comp->desc.bLength = USB_DT_EP_COMP_SIZE; | 94 | ep->ss_ep_comp->desc.bLength = USB_DT_SS_EP_COMP_SIZE; |
94 | ep->ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP; | 95 | ep->ss_ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP; |
95 | ep->ep_comp->desc.bMaxBurst = 0; | 96 | ep->ss_ep_comp->desc.bMaxBurst = 0; |
96 | /* | 97 | /* |
97 | * Leave bmAttributes as zero, which will mean no streams for | 98 | * Leave bmAttributes as zero, which will mean no streams for |
98 | * bulk, and isoc won't support multiple bursts of packets. | 99 | * bulk, and isoc won't support multiple bursts of packets. |
@@ -102,7 +103,7 @@ static int usb_parse_endpoint_companion(struct device *ddev, int cfgno, | |||
102 | */ | 103 | */ |
103 | if (usb_endpoint_xfer_isoc(&ep->desc) || | 104 | if (usb_endpoint_xfer_isoc(&ep->desc) || |
104 | usb_endpoint_xfer_int(&ep->desc)) | 105 | usb_endpoint_xfer_int(&ep->desc)) |
105 | ep->ep_comp->desc.wBytesPerInterval = | 106 | ep->ss_ep_comp->desc.wBytesPerInterval = |
106 | ep->desc.wMaxPacketSize; | 107 | ep->desc.wMaxPacketSize; |
107 | /* | 108 | /* |
108 | * The next descriptor is for an Endpoint or Interface, | 109 | * The next descriptor is for an Endpoint or Interface, |
@@ -112,16 +113,16 @@ static int usb_parse_endpoint_companion(struct device *ddev, int cfgno, | |||
112 | retval = 0; | 113 | retval = 0; |
113 | goto valid; | 114 | goto valid; |
114 | } | 115 | } |
115 | memcpy(&ep->ep_comp->desc, desc, USB_DT_EP_COMP_SIZE); | 116 | memcpy(&ep->ss_ep_comp->desc, desc, USB_DT_SS_EP_COMP_SIZE); |
116 | desc = &ep->ep_comp->desc; | 117 | desc = &ep->ss_ep_comp->desc; |
117 | buffer += desc->bLength; | 118 | buffer += desc->bLength; |
118 | size -= desc->bLength; | 119 | size -= desc->bLength; |
119 | 120 | ||
120 | /* Eat up the other descriptors we don't care about */ | 121 | /* Eat up the other descriptors we don't care about */ |
121 | ep->ep_comp->extra = buffer; | 122 | ep->ss_ep_comp->extra = buffer; |
122 | i = find_next_descriptor(buffer, size, USB_DT_ENDPOINT, | 123 | i = find_next_descriptor(buffer, size, USB_DT_ENDPOINT, |
123 | USB_DT_INTERFACE, &num_skipped); | 124 | USB_DT_INTERFACE, &num_skipped); |
124 | ep->ep_comp->extralen = i; | 125 | ep->ss_ep_comp->extralen = i; |
125 | buffer += i; | 126 | buffer += i; |
126 | size -= i; | 127 | size -= i; |
127 | retval = buffer - buffer_start + i; | 128 | retval = buffer - buffer_start + i; |
@@ -310,7 +311,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
310 | cfgno, inum, asnum, d->bEndpointAddress, | 311 | cfgno, inum, asnum, d->bEndpointAddress, |
311 | maxp); | 312 | maxp); |
312 | } | 313 | } |
313 | /* Allocate room for and parse any endpoint companion descriptors */ | 314 | /* Allocate room for and parse any SS endpoint companion descriptors */ |
314 | if (to_usb_device(ddev)->speed == USB_SPEED_SUPER) { | 315 | if (to_usb_device(ddev)->speed == USB_SPEED_SUPER) { |
315 | endpoint->extra = buffer; | 316 | endpoint->extra = buffer; |
316 | i = find_next_descriptor_more(buffer, size, USB_DT_SS_ENDPOINT_COMP, | 317 | i = find_next_descriptor_more(buffer, size, USB_DT_SS_ENDPOINT_COMP, |
@@ -320,8 +321,9 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
320 | size -= i; | 321 | size -= i; |
321 | 322 | ||
322 | if (size > 0) { | 323 | if (size > 0) { |
323 | retval = usb_parse_endpoint_companion(ddev, cfgno, inum, asnum, | 324 | retval = usb_parse_ss_endpoint_companion(ddev, cfgno, |
324 | endpoint, num_ep, buffer, size); | 325 | inum, asnum, endpoint, num_ep, buffer, |
326 | size); | ||
325 | if (retval >= 0) { | 327 | if (retval >= 0) { |
326 | buffer += retval; | 328 | buffer += retval; |
327 | retval = buffer - buffer0; | 329 | retval = buffer - buffer0; |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index f49f280cfd43..a7fbd6c10add 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -496,7 +496,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, | |||
496 | max_packet = ep->desc.wMaxPacketSize; | 496 | max_packet = ep->desc.wMaxPacketSize; |
497 | ep_ctx->ep_info2 |= MAX_PACKET(max_packet); | 497 | ep_ctx->ep_info2 |= MAX_PACKET(max_packet); |
498 | /* dig out max burst from ep companion desc */ | 498 | /* dig out max burst from ep companion desc */ |
499 | max_packet = ep->ep_comp->desc.bMaxBurst; | 499 | max_packet = ep->ss_ep_comp->desc.bMaxBurst; |
500 | ep_ctx->ep_info2 |= MAX_BURST(max_packet); | 500 | ep_ctx->ep_info2 |= MAX_BURST(max_packet); |
501 | break; | 501 | break; |
502 | case USB_SPEED_HIGH: | 502 | case USB_SPEED_HIGH: |