Lines Matching refs:bus_state
825 struct xhci_bus_state *bus_state; in xhci_handle_usb2_port_link_resume() local
832 bus_state = &port->rhub->bus_state; in xhci_handle_usb2_port_link_resume()
841 if (!bus_state->resume_done[wIndex]) { in xhci_handle_usb2_port_link_resume()
843 if (test_bit(wIndex, &bus_state->resuming_ports)) { in xhci_handle_usb2_port_link_resume()
857 set_bit(wIndex, &bus_state->resuming_ports); in xhci_handle_usb2_port_link_resume()
858 bus_state->resume_done[wIndex] = timeout; in xhci_handle_usb2_port_link_resume()
863 } else if (time_after_eq(jiffies, bus_state->resume_done[wIndex])) { in xhci_handle_usb2_port_link_resume()
869 bus_state->resume_done[wIndex] = 0; in xhci_handle_usb2_port_link_resume()
870 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_handle_usb2_port_link_resume()
872 set_bit(wIndex, &bus_state->rexit_ports); in xhci_handle_usb2_port_link_resume()
879 &bus_state->rexit_done[wIndex], in xhci_handle_usb2_port_link_resume()
898 clear_bit(wIndex, &bus_state->rexit_ports); in xhci_handle_usb2_port_link_resume()
902 bus_state->port_c_suspend |= 1 << wIndex; in xhci_handle_usb2_port_link_resume()
903 bus_state->suspended_ports &= ~(1 << wIndex); in xhci_handle_usb2_port_link_resume()
935 struct xhci_bus_state *bus_state; in xhci_get_usb3_port_status() local
941 bus_state = &port->rhub->bus_state; in xhci_get_usb3_port_status()
968 bus_state->suspended_ports &= ~(1 << portnum); in xhci_get_usb3_port_status()
972 if (bus_state->port_remote_wakeup & (1 << portnum) && in xhci_get_usb3_port_status()
975 bus_state->port_remote_wakeup &= ~(1 << portnum); in xhci_get_usb3_port_status()
986 struct xhci_bus_state *bus_state; in xhci_get_usb2_port_status() local
991 bus_state = &port->rhub->bus_state; in xhci_get_usb2_port_status()
1005 if (bus_state->resume_done[portnum]) in xhci_get_usb2_port_status()
1008 bus_state->resume_done[portnum] = 0; in xhci_get_usb2_port_status()
1009 clear_bit(portnum, &bus_state->resuming_ports); in xhci_get_usb2_port_status()
1010 if (bus_state->suspended_ports & (1 << portnum)) { in xhci_get_usb2_port_status()
1011 bus_state->suspended_ports &= ~(1 << portnum); in xhci_get_usb2_port_status()
1012 bus_state->port_c_suspend |= 1 << portnum; in xhci_get_usb2_port_status()
1035 struct xhci_bus_state *bus_state, in xhci_get_port_status() argument
1080 if ((bus_state->resume_done[wIndex] || in xhci_get_port_status()
1081 test_bit(wIndex, &bus_state->resuming_ports)) && in xhci_get_port_status()
1084 bus_state->resume_done[wIndex] = 0; in xhci_get_port_status()
1085 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_get_port_status()
1089 if (bus_state->port_c_suspend & (1 << wIndex)) in xhci_get_port_status()
1104 struct xhci_bus_state *bus_state; in xhci_hub_control() local
1115 bus_state = &rhub->bus_state; in xhci_hub_control()
1159 status = xhci_get_port_status(hcd, bus_state, wIndex, temp, in xhci_hub_control()
1244 bus_state->suspended_ports |= 1 << wIndex; in xhci_hub_control()
1339 reinit_completion(&bus_state->u3exit_done[wIndex]); in xhci_hub_control()
1350 if (!wait_for_completion_timeout(&bus_state->u3exit_done[wIndex], in xhci_hub_control()
1381 bus_state->suspended_ports |= 1 << wIndex; in xhci_hub_control()
1468 set_bit(wIndex, &bus_state->resuming_ports); in xhci_hub_control()
1477 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_hub_control()
1480 bus_state->port_c_suspend |= 1 << wIndex; in xhci_hub_control()
1491 bus_state->port_c_suspend &= ~(1 << wIndex); in xhci_hub_control()
1542 struct xhci_bus_state *bus_state; in xhci_hub_status_data() local
1550 bus_state = &rhub->bus_state; in xhci_hub_status_data()
1562 status = bus_state->resuming_ports; in xhci_hub_status_data()
1588 (bus_state->port_c_suspend & 1 << i) || in xhci_hub_status_data()
1589 (bus_state->resume_done[i] && time_after_eq( in xhci_hub_status_data()
1590 jiffies, bus_state->resume_done[i]))) { in xhci_hub_status_data()
1613 struct xhci_bus_state *bus_state; in xhci_bus_suspend() local
1623 bus_state = &rhub->bus_state; in xhci_bus_suspend()
1629 if (bus_state->resuming_ports || /* USB2 */ in xhci_bus_suspend()
1630 bus_state->port_remote_wakeup) { /* USB3 */ in xhci_bus_suspend()
1640 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1665 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1673 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1682 set_bit(port_index, &bus_state->bus_suspended); in xhci_bus_suspend()
1716 if (test_bit(port_index, &bus_state->bus_suspended)) { in xhci_bus_suspend()
1730 bus_state->next_statechange = jiffies + msecs_to_jiffies(10); in xhci_bus_suspend()
1733 if (bus_state->bus_suspended) in xhci_bus_suspend()
1770 struct xhci_bus_state *bus_state; in xhci_bus_resume() local
1783 bus_state = &rhub->bus_state; in xhci_bus_resume()
1785 if (time_before(jiffies, bus_state->next_statechange)) in xhci_bus_resume()
1815 clear_bit(port_index, &bus_state->bus_suspended); in xhci_bus_resume()
1819 if (test_bit(port_index, &bus_state->bus_suspended)) in xhci_bus_resume()
1832 &bus_state->bus_suspended); in xhci_bus_resume()
1842 if (bus_state->bus_suspended) { in xhci_bus_resume()
1847 for_each_set_bit(port_index, &bus_state->bus_suspended, in xhci_bus_resume()
1857 for_each_set_bit(port_index, &bus_state->bus_suspended, BITS_PER_LONG) { in xhci_bus_resume()
1872 bus_state->next_statechange = jiffies + msecs_to_jiffies(5); in xhci_bus_resume()
1888 return rhub->bus_state.resuming_ports; /* USB2 ports only */ in xhci_get_resuming_ports()