Commit 1a81f8814cbc79125fe50456de6adf048101af9b

Authored by Thomas Pugliese
Committed by Greg Kroah-Hartman
1 parent 2c7c658a23

Allow the USB HCD to create Wireless USB root hubs

This patch adds Wireless USB root hub support to the USB HCD.  It allows
the HWA to create its root hub which previously failed because the HCD
treated wireless root hubs the same as USB2 high speed hubs.  The creation
of the root hub would fail in that case due to lack of TTs which wireless
root hubs do not support.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 3 changed files with 30 additions and 1 deletions Side-by-side Diff

drivers/usb/core/hcd.c
... ... @@ -149,6 +149,27 @@
149 149 0x01 /* __u8 bNumConfigurations; */
150 150 };
151 151  
  152 +/* usb 2.5 (wireless USB 1.0) root hub device descriptor */
  153 +static const u8 usb25_rh_dev_descriptor[18] = {
  154 + 0x12, /* __u8 bLength; */
  155 + 0x01, /* __u8 bDescriptorType; Device */
  156 + 0x50, 0x02, /* __le16 bcdUSB; v2.5 */
  157 +
  158 + 0x09, /* __u8 bDeviceClass; HUB_CLASSCODE */
  159 + 0x00, /* __u8 bDeviceSubClass; */
  160 + 0x00, /* __u8 bDeviceProtocol; [ usb 2.0 no TT ] */
  161 + 0xFF, /* __u8 bMaxPacketSize0; always 0xFF (WUSB Spec 7.4.1). */
  162 +
  163 + 0x6b, 0x1d, /* __le16 idVendor; Linux Foundation 0x1d6b */
  164 + 0x02, 0x00, /* __le16 idProduct; device 0x0002 */
  165 + KERNEL_VER, KERNEL_REL, /* __le16 bcdDevice */
  166 +
  167 + 0x03, /* __u8 iManufacturer; */
  168 + 0x02, /* __u8 iProduct; */
  169 + 0x01, /* __u8 iSerialNumber; */
  170 + 0x01 /* __u8 bNumConfigurations; */
  171 +};
  172 +
152 173 /* usb 2.0 root hub device descriptor */
153 174 static const u8 usb2_rh_dev_descriptor [18] = {
154 175 0x12, /* __u8 bLength; */
... ... @@ -527,6 +548,9 @@
527 548 case HCD_USB3:
528 549 bufp = usb3_rh_dev_descriptor;
529 550 break;
  551 + case HCD_USB25:
  552 + bufp = usb25_rh_dev_descriptor;
  553 + break;
530 554 case HCD_USB2:
531 555 bufp = usb2_rh_dev_descriptor;
532 556 break;
... ... @@ -546,6 +570,7 @@
546 570 bufp = ss_rh_config_descriptor;
547 571 len = sizeof ss_rh_config_descriptor;
548 572 break;
  573 + case HCD_USB25:
549 574 case HCD_USB2:
550 575 bufp = hs_rh_config_descriptor;
551 576 len = sizeof hs_rh_config_descriptor;
... ... @@ -2510,6 +2535,9 @@
2510 2535 break;
2511 2536 case HCD_USB2:
2512 2537 rhdev->speed = USB_SPEED_HIGH;
  2538 + break;
  2539 + case HCD_USB25:
  2540 + rhdev->speed = USB_SPEED_WIRELESS;
2513 2541 break;
2514 2542 case HCD_USB3:
2515 2543 rhdev->speed = USB_SPEED_SUPER;
drivers/usb/host/hwa-hc.c
... ... @@ -577,7 +577,7 @@
577 577 .product_desc = "Wireless USB HWA host controller",
578 578 .hcd_priv_size = sizeof(struct hwahc) - sizeof(struct usb_hcd),
579 579 .irq = NULL, /* FIXME */
580   - .flags = HCD_USB2, /* FIXME */
  580 + .flags = HCD_USB25,
581 581 .reset = hwahc_op_reset,
582 582 .start = hwahc_op_start,
583 583 .stop = hwahc_op_stop,
include/linux/usb/hcd.h
... ... @@ -218,6 +218,7 @@
218 218 #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */
219 219 #define HCD_USB11 0x0010 /* USB 1.1 */
220 220 #define HCD_USB2 0x0020 /* USB 2.0 */
  221 +#define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/
221 222 #define HCD_USB3 0x0040 /* USB 3.0 */
222 223 #define HCD_MASK 0x0070
223 224