aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorWilliam Gulland <wgulland@vmware.com>2010-05-12 13:20:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:45 -0400
commit419a8e81686b844c9682e8f1721e6795f3264ee6 (patch)
tree175f207aaca5d4de8ef292967db36d30eb75a8e8 /drivers/usb/host
parent22b4b6113ec5d0ff2a9175bc611f3f3f61e4e172 (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>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-hub.c15
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:
298 * Returns 0 if the status hasn't changed, or the number of bytes in buf. 298 * Returns 0 if the status hasn't changed, or the number of bytes in buf.
299 * Ports are 0-indexed from the HCD point of view, 299 * Ports are 0-indexed from the HCD point of view,
300 * and 1-indexed from the USB core pointer of view. 300 * and 1-indexed from the USB core pointer of view.
301 * xHCI instances can have up to 127 ports, so FIXME if you see more than 15.
302 * 301 *
303 * Note that the status change bits will be cleared as soon as a port status 302 * Note that the status change bits will be cleared as soon as a port status
304 * change event is generated, so we use the saved status from that event. 303 * 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)
315 ports = HCS_MAX_PORTS(xhci->hcs_params1); 314 ports = HCS_MAX_PORTS(xhci->hcs_params1);
316 315
317 /* Initial status is no changes */ 316 /* Initial status is no changes */
318 buf[0] = 0; 317 retval = (ports + 8) / 8;
318 memset(buf, 0, retval);
319 status = 0; 319 status = 0;
320 if (ports > 7) {
321 buf[1] = 0;
322 retval = 2;
323 } else {
324 retval = 1;
325 }
326 320
327 spin_lock_irqsave(&xhci->lock, flags); 321 spin_lock_irqsave(&xhci->lock, flags);
328 /* For each port, did anything change? If so, set that bit in buf. */ 322 /* 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)
331 NUM_PORT_REGS*i; 325 NUM_PORT_REGS*i;
332 temp = xhci_readl(xhci, addr); 326 temp = xhci_readl(xhci, addr);
333 if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) { 327 if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) {
334 if (i < 7) 328 buf[(i + 1) / 8] |= 1 << (i + 1) % 8;
335 buf[0] |= 1 << (i + 1);
336 else
337 buf[1] |= 1 << (i - 7);
338 status = 1; 329 status = 1;
339 } 330 }
340 } 331 }