--- zzzz-none-000/linux-2.6.32.61/drivers/usb/host/xhci-hub.c 2013-06-10 09:43:48.000000000 +0000 +++ ar9-7330-650/linux-2.6.32.61/drivers/usb/host/xhci-hub.c 2014-10-29 15:55:54.000000000 +0000 @@ -24,6 +24,8 @@ #include "xhci.h" +extern int usb3port_config; + static void xhci_hub_descriptor(struct xhci_hcd *xhci, struct usb_hub_descriptor *desc) { @@ -161,12 +163,15 @@ xhci_dbg(xhci, "get port status, actual port %d status = 0x%x\n", wIndex, temp); /* wPortChange bits */ - if (temp & PORT_CSC) + if (temp & (PORT_CSC|PORT_PLC)) status |= 1 << USB_PORT_FEAT_C_CONNECTION; if (temp & PORT_PEC) status |= 1 << USB_PORT_FEAT_C_ENABLE; if ((temp & PORT_OCC)) status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; + /* AVM/WK Workaround: tell USB core about RESET completion */ + if (temp & (PORT_RC|PORT_WRC)) + status |= 1 << USB_PORT_FEAT_C_RESET; /* * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific * changes @@ -179,7 +184,7 @@ status |= 1 << USB_PORT_FEAT_ENABLE; if (temp & PORT_OC) status |= 1 << USB_PORT_FEAT_OVER_CURRENT; - if (temp & PORT_RESET) + if (temp & (PORT_RESET|PORT_WR)) status |= 1 << USB_PORT_FEAT_RESET; if (temp & PORT_POWER) status |= 1 << USB_PORT_FEAT_POWER; @@ -202,13 +207,21 @@ * However, khubd will ignore the roothub events until * the roothub is registered. */ - xhci_writel(xhci, temp | PORT_POWER, addr); - + if ((wIndex < (ports/2)) && !((1<op_regs->port_status_base + NUM_PORT_REGS*i; temp = xhci_readl(xhci, addr); - if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) { + /* AVM/WK Workaround: PORT_RC added */ + if (temp & (PORT_CSC | PORT_PEC | PORT_OCC|PORT_RC|PORT_PLC)) { if (i < 7) buf[0] |= 1 << (i + 1); else