aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
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/usb/host
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/usb/host')
-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
11 files changed, 31 insertions, 28 deletions
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. */