diff options
author | William Gulland | 2010-05-12 10:20:34 -0700 |
---|---|---|
committer | Greg Kroah-Hartman | 2010-05-20 13:21:45 -0700 |
commit | 419a8e81686b844c9682e8f1721e6795f3264ee6 (patch) | |
tree | 175f207aaca5d4de8ef292967db36d30eb75a8e8 | |
parent | 22b4b6113ec5d0ff2a9175bc611f3f3f61e4e172 (diff) |
USB: xhci: Remove the arbitrary limit of 15 xHCI ports
Our virtual xHCI device can have as many ports as we like - I've tested
this patch with 31.
Signed-off-by: William Gulland <wgulland@vmware.com>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/host/xhci-hub.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 325b47a267b9..a1a7a9795536 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -298,7 +298,6 @@ error: * Returns 0 if the status hasn't changed, or the number of bytes in buf. * Ports are 0-indexed from the HCD point of view, * and 1-indexed from the USB core pointer of view. - * xHCI instances can have up to 127 ports, so FIXME if you see more than 15. * * Note that the status change bits will be cleared as soon as a port status * change event is generated, so we use the saved status from that event. @@ -315,14 +314,9 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) ports = HCS_MAX_PORTS(xhci->hcs_params1); /* Initial status is no changes */ - buf[0] = 0; + retval = (ports + 8) / 8; + memset(buf, 0, retval); status = 0; - if (ports > 7) { - buf[1] = 0; - retval = 2; - } else { - retval = 1; - } spin_lock_irqsave(&xhci->lock, flags); /* For each port, did anything change? If so, set that bit in buf. */ @@ -331,10 +325,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) NUM_PORT_REGS*i; temp = xhci_readl(xhci, addr); if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) { - if (i < 7) - buf[0] |= 1 << (i + 1); - else - buf[1] |= 1 << (i - 7); + buf[(i + 1) / 8] |= 1 << (i + 1) % 8; status = 1; } } |