aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn Youn <John.Youn@synopsys.com>2001-09-17 03:00:00 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-03-13 21:07:11 -0400
commitdbe79bbe9dcb22cb3651c46f18943477141ca452 (patch)
tree86e2dd608fd6ae7902b4abfdfbcf1969980386e3 /drivers
parentad73dff32e04cad1ff2af89512bf489224b503cc (diff)
USB 3.0 Hub Changes
Update the USB core to deal with USB 3.0 hubs. These hubs have a slightly different hub descriptor than USB 2.0 hubs, with a fixed (rather than variable length) size. Change the USB core's hub descriptor to have a union for the last fields that differ. Change the host controller drivers that access those last fields (DeviceRemovable and PortPowerCtrlMask) to use the union. Translate the new version of the hub port status field into the old version that khubd understands. (Note: we need to fix it to translate the roothub's port status once we stop converting it to USB 2.0 hub status internally.) Add new code to handle link state change status. Send out new control messages that are needed for USB 3.0 hubs, like Set Hub Depth. This patch is a modified version of the original patch submitted by John Youn. It's updated to reflect the removal of the "bitmap" #define, and change the hub descriptor accesses of a couple new host controller drivers. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Cc: Tony Olech <tony.olech@elandigitalsystems.com> Cc: "Robert P. J. Day" <rpjday@crashcourse.ca> Cc: Max Vozeler <mvz@vozeler.com> Cc: Tejun Heo <tj@kernel.org> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: Rodolfo Giometti <giometti@linux.it> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Anton Vorontsov <avorontsov@mvista.com> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Lothar Wassmann <LW@KARO-electronics.de> Cc: Olav Kongas <ok@artecdesign.ee> Cc: Martin Fuzzey <mfuzzey@gmail.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/usbip/vhci_hcd.c4
-rw-r--r--drivers/usb/core/hub.c73
-rw-r--r--drivers/usb/gadget/dummy_hcd.c4
-rw-r--r--drivers/usb/host/ehci-hub.c4
-rw-r--r--drivers/usb/host/imx21-hcd.c4
-rw-r--r--drivers/usb/host/isp116x-hcd.c4
-rw-r--r--drivers/usb/host/isp1362-hcd.c4
-rw-r--r--drivers/usb/host/isp1760-hcd.c4
-rw-r--r--drivers/usb/host/ohci-hub.c11
-rw-r--r--drivers/usb/host/oxu210hp-hcd.c4
-rw-r--r--drivers/usb/host/r8a66597-hcd.c5
-rw-r--r--drivers/usb/host/sl811-hcd.c4
-rw-r--r--drivers/usb/host/u132-hcd.c11
-rw-r--r--drivers/usb/host/xhci-hub.c4
-rw-r--r--drivers/usb/musb/musb_virthub.c4
-rw-r--r--drivers/usb/wusbcore/rh.c4
16 files changed, 104 insertions, 44 deletions
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index 0fe7e49cdc37..29ccc0150996 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -255,8 +255,8 @@ static inline void hub_descriptor(struct usb_hub_descriptor *desc)
255 desc->wHubCharacteristics = (__force __u16) 255 desc->wHubCharacteristics = (__force __u16)
256 (__constant_cpu_to_le16(0x0001)); 256 (__constant_cpu_to_le16(0x0001));
257 desc->bNbrPorts = VHCI_NPORTS; 257 desc->bNbrPorts = VHCI_NPORTS;
258 desc->DeviceRemovable[0] = 0xff; 258 desc->u.hs.DeviceRemovable[0] = 0xff;
259 desc->DeviceRemovable[1] = 0xff; 259 desc->u.hs.DeviceRemovable[1] = 0xff;
260} 260}
261 261
262static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, 262static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index b574f9131b43..feb6e596c7c9 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -82,6 +82,10 @@ struct usb_hub {
82 void **port_owners; 82 void **port_owners;
83}; 83};
84 84
85static inline int hub_is_superspeed(struct usb_device *hdev)
86{
87 return (hdev->descriptor.bDeviceProtocol == 3);
88}
85 89
86/* Protect struct usb_device->state and ->children members 90/* Protect struct usb_device->state and ->children members
87 * Note: Both are also protected by ->dev.sem, except that ->state can 91 * Note: Both are also protected by ->dev.sem, except that ->state can
@@ -172,14 +176,23 @@ static struct usb_hub *hdev_to_hub(struct usb_device *hdev)
172} 176}
173 177
174/* USB 2.0 spec Section 11.24.4.5 */ 178/* USB 2.0 spec Section 11.24.4.5 */
175static int get_hub_descriptor(struct usb_device *hdev, void *data, int size) 179static int get_hub_descriptor(struct usb_device *hdev, void *data)
176{ 180{
177 int i, ret; 181 int i, ret, size;
182 unsigned dtype;
183
184 if (hub_is_superspeed(hdev)) {
185 dtype = USB_DT_SS_HUB;
186 size = USB_DT_SS_HUB_SIZE;
187 } else {
188 dtype = USB_DT_HUB;
189 size = sizeof(struct usb_hub_descriptor);
190 }
178 191
179 for (i = 0; i < 3; i++) { 192 for (i = 0; i < 3; i++) {
180 ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), 193 ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
181 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB, 194 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,
182 USB_DT_HUB << 8, 0, data, size, 195 dtype << 8, 0, data, size,
183 USB_CTRL_GET_TIMEOUT); 196 USB_CTRL_GET_TIMEOUT);
184 if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2)) 197 if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2))
185 return ret; 198 return ret;
@@ -365,6 +378,19 @@ static int hub_port_status(struct usb_hub *hub, int port1,
365 } else { 378 } else {
366 *status = le16_to_cpu(hub->status->port.wPortStatus); 379 *status = le16_to_cpu(hub->status->port.wPortStatus);
367 *change = le16_to_cpu(hub->status->port.wPortChange); 380 *change = le16_to_cpu(hub->status->port.wPortChange);
381
382 if ((hub->hdev->parent != NULL) &&
383 hub_is_superspeed(hub->hdev)) {
384 /* Translate the USB 3 port status */
385 u16 tmp = *status & USB_SS_PORT_STAT_MASK;
386 if (*status & USB_SS_PORT_STAT_POWER)
387 tmp |= USB_PORT_STAT_POWER;
388 if ((*status & USB_SS_PORT_STAT_SPEED) ==
389 USB_PORT_STAT_SPEED_5GBPS)
390 tmp |= USB_PORT_STAT_SUPER_SPEED;
391 *status = tmp;
392 }
393
368 ret = 0; 394 ret = 0;
369 } 395 }
370 mutex_unlock(&hub->status_mutex); 396 mutex_unlock(&hub->status_mutex);
@@ -607,7 +633,7 @@ static int hub_port_disable(struct usb_hub *hub, int port1, int set_state)
607 if (hdev->children[port1-1] && set_state) 633 if (hdev->children[port1-1] && set_state)
608 usb_set_device_state(hdev->children[port1-1], 634 usb_set_device_state(hdev->children[port1-1],
609 USB_STATE_NOTATTACHED); 635 USB_STATE_NOTATTACHED);
610 if (!hub->error) 636 if (!hub->error && !hub_is_superspeed(hub->hdev))
611 ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE); 637 ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE);
612 if (ret) 638 if (ret)
613 dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n", 639 dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n",
@@ -795,6 +821,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
795 clear_port_feature(hub->hdev, port1, 821 clear_port_feature(hub->hdev, port1,
796 USB_PORT_FEAT_C_ENABLE); 822 USB_PORT_FEAT_C_ENABLE);
797 } 823 }
824 if (portchange & USB_PORT_STAT_C_LINK_STATE) {
825 need_debounce_delay = true;
826 clear_port_feature(hub->hdev, port1,
827 USB_PORT_FEAT_C_PORT_LINK_STATE);
828 }
798 829
799 /* We can forget about a "removed" device when there's a 830 /* We can forget about a "removed" device when there's a
800 * physical disconnect or the connect status changes. 831 * physical disconnect or the connect status changes.
@@ -964,12 +995,23 @@ static int hub_configure(struct usb_hub *hub,
964 goto fail; 995 goto fail;
965 } 996 }
966 997
998 if (hub_is_superspeed(hdev) && (hdev->parent != NULL)) {
999 ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
1000 HUB_SET_DEPTH, USB_RT_HUB,
1001 hdev->level - 1, 0, NULL, 0,
1002 USB_CTRL_SET_TIMEOUT);
1003
1004 if (ret < 0) {
1005 message = "can't set hub depth";
1006 goto fail;
1007 }
1008 }
1009
967 /* Request the entire hub descriptor. 1010 /* Request the entire hub descriptor.
968 * hub->descriptor can handle USB_MAXCHILDREN ports, 1011 * hub->descriptor can handle USB_MAXCHILDREN ports,
969 * but the hub can/will return fewer bytes here. 1012 * but the hub can/will return fewer bytes here.
970 */ 1013 */
971 ret = get_hub_descriptor(hdev, hub->descriptor, 1014 ret = get_hub_descriptor(hdev, hub->descriptor);
972 sizeof(*hub->descriptor));
973 if (ret < 0) { 1015 if (ret < 0) {
974 message = "can't read hub descriptor"; 1016 message = "can't read hub descriptor";
975 goto fail; 1017 goto fail;
@@ -991,12 +1033,14 @@ static int hub_configure(struct usb_hub *hub,
991 1033
992 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics); 1034 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics);
993 1035
994 if (wHubCharacteristics & HUB_CHAR_COMPOUND) { 1036 /* FIXME for USB 3.0, skip for now */
1037 if ((wHubCharacteristics & HUB_CHAR_COMPOUND) &&
1038 !(hub_is_superspeed(hdev))) {
995 int i; 1039 int i;
996 char portstr [USB_MAXCHILDREN + 1]; 1040 char portstr [USB_MAXCHILDREN + 1];
997 1041
998 for (i = 0; i < hdev->maxchild; i++) 1042 for (i = 0; i < hdev->maxchild; i++)
999 portstr[i] = hub->descriptor->DeviceRemovable 1043 portstr[i] = hub->descriptor->u.hs.DeviceRemovable
1000 [((i + 1) / 8)] & (1 << ((i + 1) % 8)) 1044 [((i + 1) / 8)] & (1 << ((i + 1) % 8))
1001 ? 'F' : 'R'; 1045 ? 'F' : 'R';
1002 portstr[hdev->maxchild] = 0; 1046 portstr[hdev->maxchild] = 0;
@@ -2029,6 +2073,8 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
2029 udev->speed = USB_SPEED_HIGH; 2073 udev->speed = USB_SPEED_HIGH;
2030 else if (portstatus & USB_PORT_STAT_LOW_SPEED) 2074 else if (portstatus & USB_PORT_STAT_LOW_SPEED)
2031 udev->speed = USB_SPEED_LOW; 2075 udev->speed = USB_SPEED_LOW;
2076 else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
2077 udev->speed = USB_SPEED_SUPER;
2032 else 2078 else
2033 udev->speed = USB_SPEED_FULL; 2079 udev->speed = USB_SPEED_FULL;
2034 return 0; 2080 return 0;
@@ -3430,6 +3476,17 @@ static void hub_events(void)
3430 clear_port_feature(hdev, i, 3476 clear_port_feature(hdev, i,
3431 USB_PORT_FEAT_C_RESET); 3477 USB_PORT_FEAT_C_RESET);
3432 } 3478 }
3479 if (portchange & USB_PORT_STAT_C_LINK_STATE) {
3480 clear_port_feature(hub->hdev, i,
3481 USB_PORT_FEAT_C_PORT_LINK_STATE);
3482 }
3483 if (portchange & USB_PORT_STAT_C_CONFIG_ERROR) {
3484 dev_warn(hub_dev,
3485 "config error on port %d\n",
3486 i);
3487 clear_port_feature(hub->hdev, i,
3488 USB_PORT_FEAT_C_PORT_CONFIG_ERROR);
3489 }
3433 3490
3434 if (connect_change) 3491 if (connect_change)
3435 hub_port_connect_change(hub, i, 3492 hub_port_connect_change(hub, i,
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index f2040e8af8b1..3214ca375d64 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1593,8 +1593,8 @@ hub_descriptor (struct usb_hub_descriptor *desc)
1593 desc->bDescLength = 9; 1593 desc->bDescLength = 9;
1594 desc->wHubCharacteristics = cpu_to_le16(0x0001); 1594 desc->wHubCharacteristics = cpu_to_le16(0x0001);
1595 desc->bNbrPorts = 1; 1595 desc->bNbrPorts = 1;
1596 desc->DeviceRemovable[0] = 0xff; 1596 desc->u.hs.DeviceRemovable[0] = 0xff;
1597 desc->DeviceRemovable[1] = 0xff; 1597 desc->u.hs.DeviceRemovable[1] = 0xff;
1598} 1598}
1599 1599
1600static int dummy_hub_control ( 1600static int dummy_hub_control (
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index dfa1e1d371c8..d05ea03cfb4d 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -717,8 +717,8 @@ ehci_hub_descriptor (
717 desc->bDescLength = 7 + 2 * temp; 717 desc->bDescLength = 7 + 2 * temp;
718 718
719 /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */ 719 /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */
720 memset(&desc->DeviceRemovable[0], 0, temp); 720 memset(&desc->u.hs.DeviceRemovable[0], 0, temp);
721 memset(&desc->DeviceRemovable[temp], 0xff, temp); 721 memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp);
722 722
723 temp = 0x0008; /* per-port overcurrent reporting */ 723 temp = 0x0008; /* per-port overcurrent reporting */
724 if (HCS_PPC (ehci->hcs_params)) 724 if (HCS_PPC (ehci->hcs_params))
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c
index 2f180dfe5371..2562e92e3178 100644
--- a/drivers/usb/host/imx21-hcd.c
+++ b/drivers/usb/host/imx21-hcd.c
@@ -1472,8 +1472,8 @@ static int get_hub_descriptor(struct usb_hcd *hcd,
1472 0x0010 | /* No over current protection */ 1472 0x0010 | /* No over current protection */
1473 0); 1473 0);
1474 1474
1475 desc->DeviceRemovable[0] = 1 << 1; 1475 desc->u.hs.DeviceRemovable[0] = 1 << 1;
1476 desc->DeviceRemovable[1] = ~0; 1476 desc->u.hs.DeviceRemovable[1] = ~0;
1477 return 0; 1477 return 0;
1478} 1478}
1479 1479
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 2a60a50bc420..c0e22f26da19 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -952,8 +952,8 @@ static void isp116x_hub_descriptor(struct isp116x *isp116x,
952 desc->wHubCharacteristics = cpu_to_le16((u16) ((reg >> 8) & 0x1f)); 952 desc->wHubCharacteristics = cpu_to_le16((u16) ((reg >> 8) & 0x1f));
953 desc->bPwrOn2PwrGood = (u8) ((reg >> 24) & 0xff); 953 desc->bPwrOn2PwrGood = (u8) ((reg >> 24) & 0xff);
954 /* ports removable, and legacy PortPwrCtrlMask */ 954 /* ports removable, and legacy PortPwrCtrlMask */
955 desc->DeviceRemovable[0] = 0; 955 desc->u.hs.DeviceRemovable[0] = 0;
956 desc->DeviceRemovable[1] = ~0; 956 desc->u.hs.DeviceRemovable[1] = ~0;
957} 957}
958 958
959/* Perform reset of a given port. 959/* Perform reset of a given port.
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 6dd94b997d97..662cd002adfc 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -1553,8 +1553,8 @@ static void isp1362_hub_descriptor(struct isp1362_hcd *isp1362_hcd,
1553 DBG(0, "%s: hubcharacteristics = %02x\n", __func__, cpu_to_le16((reg >> 8) & 0x1f)); 1553 DBG(0, "%s: hubcharacteristics = %02x\n", __func__, cpu_to_le16((reg >> 8) & 0x1f));
1554 desc->bPwrOn2PwrGood = (reg >> 24) & 0xff; 1554 desc->bPwrOn2PwrGood = (reg >> 24) & 0xff;
1555 /* ports removable, and legacy PortPwrCtrlMask */ 1555 /* ports removable, and legacy PortPwrCtrlMask */
1556 desc->DeviceRemovable[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1; 1556 desc->u.hs.DeviceRemovable[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1;
1557 desc->DeviceRemovable[1] = ~0; 1557 desc->u.hs.DeviceRemovable[1] = ~0;
1558 1558
1559 DBG(3, "%s: exit\n", __func__); 1559 DBG(3, "%s: exit\n", __func__);
1560} 1560}
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index 1c8de7666d6a..f50e84ac570a 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -1752,8 +1752,8 @@ static void isp1760_hub_descriptor(struct isp1760_hcd *priv,
1752 desc->bDescLength = 7 + 2 * temp; 1752 desc->bDescLength = 7 + 2 * temp;
1753 1753
1754 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */ 1754 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
1755 memset(&desc->DeviceRemovable[0], 0, temp); 1755 memset(&desc->u.hs.DeviceRemovable[0], 0, temp);
1756 memset(&desc->DeviceRemovable[temp], 0xff, temp); 1756 memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp);
1757 1757
1758 /* per-port overcurrent reporting */ 1758 /* per-port overcurrent reporting */
1759 temp = 0x0008; 1759 temp = 0x0008;
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index cd4b74f27d06..9154615292db 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -582,13 +582,14 @@ ohci_hub_descriptor (
582 582
583 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */ 583 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
584 rh = roothub_b (ohci); 584 rh = roothub_b (ohci);
585 memset(desc->DeviceRemovable, 0xff, sizeof(desc->DeviceRemovable)); 585 memset(desc->u.hs.DeviceRemovable, 0xff,
586 desc->DeviceRemovable[0] = rh & RH_B_DR; 586 sizeof(desc->u.hs.DeviceRemovable));
587 desc->u.hs.DeviceRemovable[0] = rh & RH_B_DR;
587 if (ohci->num_ports > 7) { 588 if (ohci->num_ports > 7) {
588 desc->DeviceRemovable[1] = (rh & RH_B_DR) >> 8; 589 desc->u.hs.DeviceRemovable[1] = (rh & RH_B_DR) >> 8;
589 desc->DeviceRemovable[2] = 0xff; 590 desc->u.hs.DeviceRemovable[2] = 0xff;
590 } else 591 } else
591 desc->DeviceRemovable[1] = 0xff; 592 desc->u.hs.DeviceRemovable[1] = 0xff;
592} 593}
593 594
594/*-------------------------------------------------------------------------*/ 595/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index ad54a4144756..38193f4e980e 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -452,8 +452,8 @@ static void ehci_hub_descriptor(struct oxu_hcd *oxu,
452 desc->bDescLength = 7 + 2 * temp; 452 desc->bDescLength = 7 + 2 * temp;
453 453
454 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */ 454 /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
455 memset(&desc->DeviceRemovable[0], 0, temp); 455 memset(&desc->u.hs.DeviceRemovable[0], 0, temp);
456 memset(&desc->DeviceRemovable[temp], 0xff, temp); 456 memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp);
457 457
458 temp = 0x0008; /* per-port overcurrent reporting */ 458 temp = 0x0008; /* per-port overcurrent reporting */
459 if (HCS_PPC(oxu->hcs_params)) 459 if (HCS_PPC(oxu->hcs_params))
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 98afe75500cc..db6f8b9c19b6 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -2150,8 +2150,9 @@ static void r8a66597_hub_descriptor(struct r8a66597 *r8a66597,
2150 desc->bDescLength = 9; 2150 desc->bDescLength = 9;
2151 desc->bPwrOn2PwrGood = 0; 2151 desc->bPwrOn2PwrGood = 0;
2152 desc->wHubCharacteristics = cpu_to_le16(0x0011); 2152 desc->wHubCharacteristics = cpu_to_le16(0x0011);
2153 desc->DeviceRemovable[0] = ((1 << r8a66597->max_root_hub) - 1) << 1; 2153 desc->u.hs.DeviceRemovable[0] =
2154 desc->DeviceRemovable[1] = ~0; 2154 ((1 << r8a66597->max_root_hub) - 1) << 1;
2155 desc->u.hs.DeviceRemovable[1] = ~0;
2155} 2156}
2156 2157
2157static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, 2158static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index f3899b334c73..18b7099a8125 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1112,8 +1112,8 @@ sl811h_hub_descriptor (
1112 desc->wHubCharacteristics = cpu_to_le16(temp); 1112 desc->wHubCharacteristics = cpu_to_le16(temp);
1113 1113
1114 /* ports removable, and legacy PortPwrCtrlMask */ 1114 /* ports removable, and legacy PortPwrCtrlMask */
1115 desc->DeviceRemovable[0] = 0 << 1; 1115 desc->u.hs.DeviceRemovable[0] = 0 << 1;
1116 desc->DeviceRemovable[1] = ~0; 1116 desc->u.hs.DeviceRemovable[1] = ~0;
1117} 1117}
1118 1118
1119static void 1119static void
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index a659e1590bca..b4785934e091 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -2604,13 +2604,14 @@ static int u132_roothub_descriptor(struct u132 *u132,
2604 retval = u132_read_pcimem(u132, roothub.b, &rh_b); 2604 retval = u132_read_pcimem(u132, roothub.b, &rh_b);
2605 if (retval) 2605 if (retval)
2606 return retval; 2606 return retval;
2607 memset(desc->DeviceRemovable, 0xff, sizeof(desc->DeviceRemovable)); 2607 memset(desc->u.hs.DeviceRemovable, 0xff,
2608 desc->DeviceRemovable[0] = rh_b & RH_B_DR; 2608 sizeof(desc->u.hs.DeviceRemovable));
2609 desc->u.hs.DeviceRemovable[0] = rh_b & RH_B_DR;
2609 if (u132->num_ports > 7) { 2610 if (u132->num_ports > 7) {
2610 desc->DeviceRemovable[1] = (rh_b & RH_B_DR) >> 8; 2611 desc->u.hs.DeviceRemovable[1] = (rh_b & RH_B_DR) >> 8;
2611 desc->DeviceRemovable[2] = 0xff; 2612 desc->u.hs.DeviceRemovable[2] = 0xff;
2612 } else 2613 } else
2613 desc->DeviceRemovable[1] = 0xff; 2614 desc->u.hs.DeviceRemovable[1] = 0xff;
2614 return 0; 2615 return 0;
2615} 2616}
2616 2617
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 43e0a099d634..847b071b6fc9 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -45,8 +45,8 @@ static void xhci_hub_descriptor(struct xhci_hcd *xhci,
45 temp = 1 + (ports / 8); 45 temp = 1 + (ports / 8);
46 desc->bDescLength = 7 + 2 * temp; 46 desc->bDescLength = 7 + 2 * temp;
47 47
48 memset(&desc->DeviceRemovable[0], 0, temp); 48 memset(&desc->u.hs.DeviceRemovable[0], 0, temp);
49 memset(&desc->DeviceRemovable[temp], 0xff, temp); 49 memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp);
50 50
51 /* Ugh, these should be #defines, FIXME */ 51 /* Ugh, these should be #defines, FIXME */
52 /* Using table 11-13 in USB 2.0 spec. */ 52 /* Using table 11-13 in USB 2.0 spec. */
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index b46d1877e28e..489104a5ae14 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -305,8 +305,8 @@ int musb_hub_control(
305 desc->bHubContrCurrent = 0; 305 desc->bHubContrCurrent = 0;
306 306
307 /* workaround bogus struct definition */ 307 /* workaround bogus struct definition */
308 desc->DeviceRemovable[0] = 0x02; /* port 1 */ 308 desc->u.hs.DeviceRemovable[0] = 0x02; /* port 1 */
309 desc->DeviceRemovable[1] = 0xff; 309 desc->u.hs.DeviceRemovable[1] = 0xff;
310 } 310 }
311 break; 311 break;
312 case GetHubStatus: 312 case GetHubStatus:
diff --git a/drivers/usb/wusbcore/rh.c b/drivers/usb/wusbcore/rh.c
index cff246b7cb26..c175b7300c73 100644
--- a/drivers/usb/wusbcore/rh.c
+++ b/drivers/usb/wusbcore/rh.c
@@ -184,8 +184,8 @@ static int wusbhc_rh_get_hub_descr(struct wusbhc *wusbhc, u16 wValue,
184 descr->bPwrOn2PwrGood = 0; 184 descr->bPwrOn2PwrGood = 0;
185 descr->bHubContrCurrent = 0; 185 descr->bHubContrCurrent = 0;
186 /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */ 186 /* two bitmaps: ports removable, and usb 1.0 legacy PortPwrCtrlMask */
187 memset(&descr->DeviceRemovable[0], 0, temp); 187 memset(&descr->u.hs.DeviceRemovable[0], 0, temp);
188 memset(&descr->DeviceRemovable[temp], 0xff, temp); 188 memset(&descr->u.hs.DeviceRemovable[temp], 0xff, temp);
189 return 0; 189 return 0;
190} 190}
191 191