summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-11-16 23:56:15 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-01 14:23:36 -0800
commitf0d7f27351058284f62ab4848909373c2d1f5ce8 (patch)
tree8ccedd0ebf58ff3439750534f56eff94cc97ab2a /drivers/usb
parent1f26e28d3e32339ca683f087cd55a70e2befc333 (diff)
downloadop-kernel-dev-f0d7f27351058284f62ab4848909373c2d1f5ce8.zip
op-kernel-dev-f0d7f27351058284f62ab4848909373c2d1f5ce8.tar.gz
USB: EHCI hooks for high speed electrical tests
EHCI hooks for high speed electrical tests of the root hub ports. The expectation is that a usermode program actually triggers the test, making the same control request it would make for an external hub. Tests for peripheral upstream ports would issue a different request. In all cases, the hardware needs re-initialization before it could be used "normally" again (e.g. unplug/replug, rmmod/modprobe). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-hub.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 1b20722..7c170a2 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -319,6 +319,7 @@ static int ehci_hub_control (
u32 temp, status;
unsigned long flags;
int retval = 0;
+ unsigned selector;
/*
* FIXME: support SetPortFeatures USB_PORT_FEAT_INDICATOR.
@@ -506,6 +507,8 @@ static int ehci_hub_control (
}
break;
case SetPortFeature:
+ selector = wIndex >> 8;
+ wIndex &= 0xff;
if (!wIndex || wIndex > ports)
goto error;
wIndex--;
@@ -559,6 +562,22 @@ static int ehci_hub_control (
}
writel (temp, &ehci->regs->port_status [wIndex]);
break;
+
+ /* For downstream facing ports (these): one hub port is put
+ * into test mode according to USB2 11.24.2.13, then the hub
+ * must be reset (which for root hub now means rmmod+modprobe,
+ * or else system reboot). See EHCI 2.3.9 and 4.14 for info
+ * about the EHCI-specific stuff.
+ */
+ case USB_PORT_FEAT_TEST:
+ if (!selector || selector > 5)
+ goto error;
+ ehci_quiesce(ehci);
+ ehci_halt(ehci);
+ temp |= selector << 16;
+ writel (temp, &ehci->regs->port_status [wIndex]);
+ break;
+
default:
goto error;
}
OpenPOWER on IntegriCloud