diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2010-12-02 17:45:18 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-03-13 21:07:15 -0400 |
commit | 83de4b2b90887b5b317d8313864fe4cc5db35280 (patch) | |
tree | e2eccac30913261d660be034e8f53a6640061738 /drivers/usb/core/hcd.c | |
parent | d673bfcbfffdeb56064a6b1ee047b85590bed76c (diff) |
usb: Store bus type in usb_hcd, not in driver flags.
The xHCI driver essentially has both a USB 2.0 and a USB 3.0 roothub. So
setting the HCD_USB3 bits in the hcd->driver->flags is a bit misleading.
Add a new field to usb_hcd, bcdUSB. Store the result of
hcd->driver->flags & HCD_MASK in it. Later, when we have the xHCI driver
register the two roothubs, we'll set the usb_hcd->bcdUSB field to HCD_USB2
for the USB 2.0 roothub, and HCD_USB3 for the USB 3.0 roothub.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r-- | drivers/usb/core/hcd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 3ba27118adc5..a0adcac3da08 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -507,7 +507,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
507 | case DeviceRequest | USB_REQ_GET_DESCRIPTOR: | 507 | case DeviceRequest | USB_REQ_GET_DESCRIPTOR: |
508 | switch (wValue & 0xff00) { | 508 | switch (wValue & 0xff00) { |
509 | case USB_DT_DEVICE << 8: | 509 | case USB_DT_DEVICE << 8: |
510 | switch (hcd->driver->flags & HCD_MASK) { | 510 | switch (hcd->speed) { |
511 | case HCD_USB3: | 511 | case HCD_USB3: |
512 | bufp = usb3_rh_dev_descriptor; | 512 | bufp = usb3_rh_dev_descriptor; |
513 | break; | 513 | break; |
@@ -525,7 +525,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
525 | patch_protocol = 1; | 525 | patch_protocol = 1; |
526 | break; | 526 | break; |
527 | case USB_DT_CONFIG << 8: | 527 | case USB_DT_CONFIG << 8: |
528 | switch (hcd->driver->flags & HCD_MASK) { | 528 | switch (hcd->speed) { |
529 | case HCD_USB3: | 529 | case HCD_USB3: |
530 | bufp = ss_rh_config_descriptor; | 530 | bufp = ss_rh_config_descriptor; |
531 | len = sizeof ss_rh_config_descriptor; | 531 | len = sizeof ss_rh_config_descriptor; |
@@ -2216,6 +2216,7 @@ struct usb_hcd *usb_create_hcd (const struct hc_driver *driver, | |||
2216 | #endif | 2216 | #endif |
2217 | 2217 | ||
2218 | hcd->driver = driver; | 2218 | hcd->driver = driver; |
2219 | hcd->speed = driver->flags & HCD_MASK; | ||
2219 | hcd->product_desc = (driver->product_desc) ? driver->product_desc : | 2220 | hcd->product_desc = (driver->product_desc) ? driver->product_desc : |
2220 | "USB Host Controller"; | 2221 | "USB Host Controller"; |
2221 | return hcd; | 2222 | return hcd; |
@@ -2325,7 +2326,7 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
2325 | } | 2326 | } |
2326 | hcd->self.root_hub = rhdev; | 2327 | hcd->self.root_hub = rhdev; |
2327 | 2328 | ||
2328 | switch (hcd->driver->flags & HCD_MASK) { | 2329 | switch (hcd->speed) { |
2329 | case HCD_USB11: | 2330 | case HCD_USB11: |
2330 | rhdev->speed = USB_SPEED_FULL; | 2331 | rhdev->speed = USB_SPEED_FULL; |
2331 | break; | 2332 | break; |