]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
xhci: Setup array of USB 2.0 and USB 3.0 ports.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 26 Oct 2010 23:47:13 +0000 (16:47 -0700)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Sat, 20 Nov 2010 00:23:18 +0000 (16:23 -0800)
commitda6699ce4a889c3795624ccdcfe7181cc89f18e8
tree05cd63ceb04825bda66d11175108b3b5510b1fe6
parent7a3783efffc7bc2e702d774e47fad5b8e37e9ad1
xhci: Setup array of USB 2.0 and USB 3.0 ports.

An xHCI host controller contains USB 2.0 and USB 3.0 ports, which can
occur in any order in the PORTSC registers.  We cannot read the port speed
bits in the PORTSC registers at init time to determine the port speed,
since those bits are only valid when a USB device is plugged into the
port.

Instead, we read the "Supported Protocol Capability" registers in the xHC
Extended Capabilities space.  Those describe the protocol, port offset in
the PORTSC registers, and port count.  We use those registers to create
two arrays of pointers to the PORTSC registers, one for USB 3.0 ports, and
another for USB 2.0 ports.  A third array keeps track of the port protocol
major revision, and is indexed with the internal xHCI port number.

This commit is a bit big, but it should be queued for stable because the "Don't
let the USB core disable SuperSpeed ports" patch depends on it.  There is no
other way to determine which ports are SuperSpeed ports without this patch.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Don Zickus <dzickus@redhat.com>
Cc: stable@kernel.org
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci.h