diff options
author | David Brownell <david-b@pacbell.net> | 2006-11-17 02:56:15 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:23:36 -0500 |
commit | f0d7f27351058284f62ab4848909373c2d1f5ce8 (patch) | |
tree | 8ccedd0ebf58ff3439750534f56eff94cc97ab2a /drivers | |
parent | 1f26e28d3e32339ca683f087cd55a70e2befc333 (diff) |
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')
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 1b20722c102b..7c170a29f959 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -319,6 +319,7 @@ static int ehci_hub_control ( | |||
319 | u32 temp, status; | 319 | u32 temp, status; |
320 | unsigned long flags; | 320 | unsigned long flags; |
321 | int retval = 0; | 321 | int retval = 0; |
322 | unsigned selector; | ||
322 | 323 | ||
323 | /* | 324 | /* |
324 | * FIXME: support SetPortFeatures USB_PORT_FEAT_INDICATOR. | 325 | * FIXME: support SetPortFeatures USB_PORT_FEAT_INDICATOR. |
@@ -506,6 +507,8 @@ static int ehci_hub_control ( | |||
506 | } | 507 | } |
507 | break; | 508 | break; |
508 | case SetPortFeature: | 509 | case SetPortFeature: |
510 | selector = wIndex >> 8; | ||
511 | wIndex &= 0xff; | ||
509 | if (!wIndex || wIndex > ports) | 512 | if (!wIndex || wIndex > ports) |
510 | goto error; | 513 | goto error; |
511 | wIndex--; | 514 | wIndex--; |
@@ -559,6 +562,22 @@ static int ehci_hub_control ( | |||
559 | } | 562 | } |
560 | writel (temp, &ehci->regs->port_status [wIndex]); | 563 | writel (temp, &ehci->regs->port_status [wIndex]); |
561 | break; | 564 | break; |
565 | |||
566 | /* For downstream facing ports (these): one hub port is put | ||
567 | * into test mode according to USB2 11.24.2.13, then the hub | ||
568 | * must be reset (which for root hub now means rmmod+modprobe, | ||
569 | * or else system reboot). See EHCI 2.3.9 and 4.14 for info | ||
570 | * about the EHCI-specific stuff. | ||
571 | */ | ||
572 | case USB_PORT_FEAT_TEST: | ||
573 | if (!selector || selector > 5) | ||
574 | goto error; | ||
575 | ehci_quiesce(ehci); | ||
576 | ehci_halt(ehci); | ||
577 | temp |= selector << 16; | ||
578 | writel (temp, &ehci->regs->port_status [wIndex]); | ||
579 | break; | ||
580 | |||
562 | default: | 581 | default: |
563 | goto error; | 582 | goto error; |
564 | } | 583 | } |