xhci: Index with a port array instead of PORTSC addresses.
commit5308a91b9fc1a8f94b860c2589b06908a97cba7e
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 1 Dec 2010 19:34:59 +0000 (1 11:34 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:23:35 +0000 (13 18:23 -0700)
tree4f97e7ea4c3280b367b951ea3b1d3f07c22c1b46
parentff9d78b36f76687c91c67b9f4c5c33bc888ed2f9
xhci: Index with a port array instead of PORTSC addresses.

In the upcoming patches, the roothub emulation code will need to return
port status and port change buffers based on whether they are called with
the xHCI USB 2.0 or USB 3.0 roothub.  To facilitate that, make the roothub
code index into an array of port addresses with wIndex, rather than
calculating the address using the offset and the address of the PORTSC
registers.  Later we can set the port array to be the array of USB 3.0
port addresses, or the USB 2.0 port addresses, depending on the roothub
passed in.

Create a temporary (statically sized) port array and fill it in with both
USB 3.0 and USB 2.0 port addresses.  This is inefficient to do for every
roothub call, but this is needed for git bisect compatibility.  The
temporary port array will be deleted in a subsequent patch.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-ring.c