Loading drivers/usb/host/xhci-hub.c +24 −2 Original line number Diff line number Diff line Loading @@ -886,6 +886,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 link_state = 0; u16 wake_mask = 0; u16 timeout = 0; u16 test_mode = 0; max_ports = xhci_get_ports(hcd, &port_array); bus_state = &xhci->bus_state[hcd_index(hcd)]; Loading Loading @@ -959,8 +960,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, link_state = (wIndex & 0xff00) >> 3; if (wValue == USB_PORT_FEAT_REMOTE_WAKE_MASK) wake_mask = wIndex & 0xff00; /* The MSB of wIndex is the U1/U2 timeout */ timeout = (wIndex & 0xff00) >> 8; /* The MSB of wIndex is the U1/U2 timeout OR TEST mode*/ test_mode = timeout = (wIndex & 0xff00) >> 8; wIndex &= 0xff; if (!wIndex || wIndex > max_ports) goto error; Loading Loading @@ -1134,6 +1135,27 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, temp |= PORT_U2_TIMEOUT(timeout); writel(temp, port_array[wIndex] + PORTPMSC); break; case USB_PORT_FEAT_TEST: slot_id = xhci_find_slot_id_by_port(hcd, xhci, wIndex + 1); if (test_mode && test_mode <= 5) { /* unlock to execute stop endpoint commands */ spin_unlock_irqrestore(&xhci->lock, flags); xhci_stop_device(xhci, slot_id, 1); spin_lock_irqsave(&xhci->lock, flags); xhci_halt(xhci); temp = readl_relaxed(port_array[wIndex] + PORTPMSC); temp |= test_mode << 28; writel_relaxed(temp, port_array[wIndex] + PORTPMSC); /* to make sure above write goes through */ mb(); } else { goto error; } break; default: goto error; } Loading Loading
drivers/usb/host/xhci-hub.c +24 −2 Original line number Diff line number Diff line Loading @@ -886,6 +886,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 link_state = 0; u16 wake_mask = 0; u16 timeout = 0; u16 test_mode = 0; max_ports = xhci_get_ports(hcd, &port_array); bus_state = &xhci->bus_state[hcd_index(hcd)]; Loading Loading @@ -959,8 +960,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, link_state = (wIndex & 0xff00) >> 3; if (wValue == USB_PORT_FEAT_REMOTE_WAKE_MASK) wake_mask = wIndex & 0xff00; /* The MSB of wIndex is the U1/U2 timeout */ timeout = (wIndex & 0xff00) >> 8; /* The MSB of wIndex is the U1/U2 timeout OR TEST mode*/ test_mode = timeout = (wIndex & 0xff00) >> 8; wIndex &= 0xff; if (!wIndex || wIndex > max_ports) goto error; Loading Loading @@ -1134,6 +1135,27 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, temp |= PORT_U2_TIMEOUT(timeout); writel(temp, port_array[wIndex] + PORTPMSC); break; case USB_PORT_FEAT_TEST: slot_id = xhci_find_slot_id_by_port(hcd, xhci, wIndex + 1); if (test_mode && test_mode <= 5) { /* unlock to execute stop endpoint commands */ spin_unlock_irqrestore(&xhci->lock, flags); xhci_stop_device(xhci, slot_id, 1); spin_lock_irqsave(&xhci->lock, flags); xhci_halt(xhci); temp = readl_relaxed(port_array[wIndex] + PORTPMSC); temp |= test_mode << 28; writel_relaxed(temp, port_array[wIndex] + PORTPMSC); /* to make sure above write goes through */ mb(); } else { goto error; } break; default: goto error; } Loading