Lines Matching refs:bus_state

912 	struct xhci_bus_state *bus_state;  in xhci_handle_usb2_port_link_resume()  local
919 bus_state = &port->rhub->bus_state; in xhci_handle_usb2_port_link_resume()
928 if (!bus_state->resume_done[wIndex]) { in xhci_handle_usb2_port_link_resume()
930 if (test_bit(wIndex, &bus_state->resuming_ports)) { in xhci_handle_usb2_port_link_resume()
944 set_bit(wIndex, &bus_state->resuming_ports); in xhci_handle_usb2_port_link_resume()
945 bus_state->resume_done[wIndex] = timeout; in xhci_handle_usb2_port_link_resume()
950 } else if (time_after_eq(jiffies, bus_state->resume_done[wIndex])) { in xhci_handle_usb2_port_link_resume()
956 bus_state->resume_done[wIndex] = 0; in xhci_handle_usb2_port_link_resume()
957 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_handle_usb2_port_link_resume()
959 set_bit(wIndex, &bus_state->rexit_ports); in xhci_handle_usb2_port_link_resume()
966 &bus_state->rexit_done[wIndex], in xhci_handle_usb2_port_link_resume()
985 clear_bit(wIndex, &bus_state->rexit_ports); in xhci_handle_usb2_port_link_resume()
989 bus_state->port_c_suspend |= 1 << wIndex; in xhci_handle_usb2_port_link_resume()
990 bus_state->suspended_ports &= ~(1 << wIndex); in xhci_handle_usb2_port_link_resume()
1022 struct xhci_bus_state *bus_state; in xhci_get_usb3_port_status() local
1028 bus_state = &port->rhub->bus_state; in xhci_get_usb3_port_status()
1055 bus_state->suspended_ports &= ~(1 << portnum); in xhci_get_usb3_port_status()
1059 if (bus_state->port_remote_wakeup & (1 << portnum) && in xhci_get_usb3_port_status()
1062 bus_state->port_remote_wakeup &= ~(1 << portnum); in xhci_get_usb3_port_status()
1073 struct xhci_bus_state *bus_state; in xhci_get_usb2_port_status() local
1078 bus_state = &port->rhub->bus_state; in xhci_get_usb2_port_status()
1092 if (bus_state->resume_done[portnum]) in xhci_get_usb2_port_status()
1095 bus_state->resume_done[portnum] = 0; in xhci_get_usb2_port_status()
1096 clear_bit(portnum, &bus_state->resuming_ports); in xhci_get_usb2_port_status()
1097 if (bus_state->suspended_ports & (1 << portnum)) { in xhci_get_usb2_port_status()
1098 bus_state->suspended_ports &= ~(1 << portnum); in xhci_get_usb2_port_status()
1099 bus_state->port_c_suspend |= 1 << portnum; in xhci_get_usb2_port_status()
1122 struct xhci_bus_state *bus_state, in xhci_get_port_status() argument
1167 if ((bus_state->resume_done[wIndex] || in xhci_get_port_status()
1168 test_bit(wIndex, &bus_state->resuming_ports)) && in xhci_get_port_status()
1171 bus_state->resume_done[wIndex] = 0; in xhci_get_port_status()
1172 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_get_port_status()
1176 if (bus_state->port_c_suspend & (1 << wIndex)) in xhci_get_port_status()
1191 struct xhci_bus_state *bus_state; in xhci_hub_control() local
1202 bus_state = &rhub->bus_state; in xhci_hub_control()
1246 status = xhci_get_port_status(hcd, bus_state, wIndex, temp, in xhci_hub_control()
1331 bus_state->suspended_ports |= 1 << wIndex; in xhci_hub_control()
1426 reinit_completion(&bus_state->u3exit_done[wIndex]); in xhci_hub_control()
1437 if (!wait_for_completion_timeout(&bus_state->u3exit_done[wIndex], in xhci_hub_control()
1468 bus_state->suspended_ports |= 1 << wIndex; in xhci_hub_control()
1555 set_bit(wIndex, &bus_state->resuming_ports); in xhci_hub_control()
1564 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_hub_control()
1567 bus_state->port_c_suspend |= 1 << wIndex; in xhci_hub_control()
1578 bus_state->port_c_suspend &= ~(1 << wIndex); in xhci_hub_control()
1629 struct xhci_bus_state *bus_state; in xhci_hub_status_data() local
1637 bus_state = &rhub->bus_state; in xhci_hub_status_data()
1649 status = bus_state->resuming_ports; in xhci_hub_status_data()
1675 (bus_state->port_c_suspend & 1 << i) || in xhci_hub_status_data()
1676 (bus_state->resume_done[i] && time_after_eq( in xhci_hub_status_data()
1677 jiffies, bus_state->resume_done[i]))) { in xhci_hub_status_data()
1701 struct xhci_bus_state *bus_state; in xhci_bus_suspend() local
1711 bus_state = &rhub->bus_state; in xhci_bus_suspend()
1717 if (bus_state->resuming_ports || /* USB2 */ in xhci_bus_suspend()
1718 bus_state->port_remote_wakeup) { /* USB3 */ in xhci_bus_suspend()
1729 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1754 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1762 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1771 set_bit(port_index, &bus_state->bus_suspended); in xhci_bus_suspend()
1805 if (test_bit(port_index, &bus_state->bus_suspended)) { in xhci_bus_suspend()
1819 bus_state->next_statechange = jiffies + msecs_to_jiffies(10); in xhci_bus_suspend()
1822 if (bus_state->bus_suspended) in xhci_bus_suspend()
1859 struct xhci_bus_state *bus_state; in xhci_bus_resume() local
1872 bus_state = &rhub->bus_state; in xhci_bus_resume()
1874 if (time_before(jiffies, bus_state->next_statechange)) in xhci_bus_resume()
1904 clear_bit(port_index, &bus_state->bus_suspended); in xhci_bus_resume()
1908 if (test_bit(port_index, &bus_state->bus_suspended)) in xhci_bus_resume()
1921 &bus_state->bus_suspended); in xhci_bus_resume()
1931 if (bus_state->bus_suspended) { in xhci_bus_resume()
1936 for_each_set_bit(port_index, &bus_state->bus_suspended, in xhci_bus_resume()
1946 for_each_set_bit(port_index, &bus_state->bus_suspended, BITS_PER_LONG) { in xhci_bus_resume()
1961 bus_state->next_statechange = jiffies + msecs_to_jiffies(5); in xhci_bus_resume()
1977 return rhub->bus_state.resuming_ports; /* USB2 ports only */ in xhci_get_resuming_ports()