Lines Matching refs:bus_state
830 struct xhci_bus_state *bus_state; in xhci_handle_usb2_port_link_resume() local
837 bus_state = &port->rhub->bus_state; in xhci_handle_usb2_port_link_resume()
846 if (!bus_state->resume_done[wIndex]) { in xhci_handle_usb2_port_link_resume()
848 if (test_bit(wIndex, &bus_state->resuming_ports)) { in xhci_handle_usb2_port_link_resume()
862 set_bit(wIndex, &bus_state->resuming_ports); in xhci_handle_usb2_port_link_resume()
863 bus_state->resume_done[wIndex] = timeout; in xhci_handle_usb2_port_link_resume()
868 } else if (time_after_eq(jiffies, bus_state->resume_done[wIndex])) { in xhci_handle_usb2_port_link_resume()
874 bus_state->resume_done[wIndex] = 0; in xhci_handle_usb2_port_link_resume()
875 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_handle_usb2_port_link_resume()
877 set_bit(wIndex, &bus_state->rexit_ports); in xhci_handle_usb2_port_link_resume()
884 &bus_state->rexit_done[wIndex], in xhci_handle_usb2_port_link_resume()
903 clear_bit(wIndex, &bus_state->rexit_ports); in xhci_handle_usb2_port_link_resume()
907 bus_state->port_c_suspend |= 1 << wIndex; in xhci_handle_usb2_port_link_resume()
908 bus_state->suspended_ports &= ~(1 << wIndex); in xhci_handle_usb2_port_link_resume()
940 struct xhci_bus_state *bus_state; in xhci_get_usb3_port_status() local
946 bus_state = &port->rhub->bus_state; in xhci_get_usb3_port_status()
973 bus_state->suspended_ports &= ~(1 << portnum); in xhci_get_usb3_port_status()
977 if (bus_state->port_remote_wakeup & (1 << portnum) && in xhci_get_usb3_port_status()
980 bus_state->port_remote_wakeup &= ~(1 << portnum); in xhci_get_usb3_port_status()
991 struct xhci_bus_state *bus_state; in xhci_get_usb2_port_status() local
996 bus_state = &port->rhub->bus_state; in xhci_get_usb2_port_status()
1010 if (bus_state->resume_done[portnum]) in xhci_get_usb2_port_status()
1013 bus_state->resume_done[portnum] = 0; in xhci_get_usb2_port_status()
1014 clear_bit(portnum, &bus_state->resuming_ports); in xhci_get_usb2_port_status()
1015 if (bus_state->suspended_ports & (1 << portnum)) { in xhci_get_usb2_port_status()
1016 bus_state->suspended_ports &= ~(1 << portnum); in xhci_get_usb2_port_status()
1017 bus_state->port_c_suspend |= 1 << portnum; in xhci_get_usb2_port_status()
1040 struct xhci_bus_state *bus_state, in xhci_get_port_status() argument
1085 if ((bus_state->resume_done[wIndex] || in xhci_get_port_status()
1086 test_bit(wIndex, &bus_state->resuming_ports)) && in xhci_get_port_status()
1089 bus_state->resume_done[wIndex] = 0; in xhci_get_port_status()
1090 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_get_port_status()
1094 if (bus_state->port_c_suspend & (1 << wIndex)) in xhci_get_port_status()
1109 struct xhci_bus_state *bus_state; in xhci_hub_control() local
1120 bus_state = &rhub->bus_state; in xhci_hub_control()
1164 status = xhci_get_port_status(hcd, bus_state, wIndex, temp, in xhci_hub_control()
1249 bus_state->suspended_ports |= 1 << wIndex; in xhci_hub_control()
1344 reinit_completion(&bus_state->u3exit_done[wIndex]); in xhci_hub_control()
1355 if (!wait_for_completion_timeout(&bus_state->u3exit_done[wIndex], in xhci_hub_control()
1386 bus_state->suspended_ports |= 1 << wIndex; in xhci_hub_control()
1473 set_bit(wIndex, &bus_state->resuming_ports); in xhci_hub_control()
1482 clear_bit(wIndex, &bus_state->resuming_ports); in xhci_hub_control()
1485 bus_state->port_c_suspend |= 1 << wIndex; in xhci_hub_control()
1496 bus_state->port_c_suspend &= ~(1 << wIndex); in xhci_hub_control()
1547 struct xhci_bus_state *bus_state; in xhci_hub_status_data() local
1555 bus_state = &rhub->bus_state; in xhci_hub_status_data()
1567 status = bus_state->resuming_ports; in xhci_hub_status_data()
1582 (bus_state->port_c_suspend & 1 << i) || in xhci_hub_status_data()
1583 (bus_state->resume_done[i] && time_after_eq( in xhci_hub_status_data()
1584 jiffies, bus_state->resume_done[i]))) { in xhci_hub_status_data()
1608 struct xhci_bus_state *bus_state; in xhci_bus_suspend() local
1618 bus_state = &rhub->bus_state; in xhci_bus_suspend()
1624 if (bus_state->resuming_ports || /* USB2 */ in xhci_bus_suspend()
1625 bus_state->port_remote_wakeup) { /* USB3 */ in xhci_bus_suspend()
1636 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1661 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1669 bus_state->bus_suspended = 0; in xhci_bus_suspend()
1678 set_bit(port_index, &bus_state->bus_suspended); in xhci_bus_suspend()
1691 set_bit(port_index, &bus_state->bus_suspended); in xhci_bus_suspend()
1726 if (test_bit(port_index, &bus_state->bus_suspended)) { in xhci_bus_suspend()
1740 bus_state->next_statechange = jiffies + msecs_to_jiffies(10); in xhci_bus_suspend()
1743 if (bus_state->bus_suspended) in xhci_bus_suspend()
1781 struct xhci_bus_state *bus_state; in xhci_bus_resume() local
1794 bus_state = &rhub->bus_state; in xhci_bus_resume()
1796 if (time_before(jiffies, bus_state->next_statechange)) in xhci_bus_resume()
1826 clear_bit(port_index, &bus_state->bus_suspended); in xhci_bus_resume()
1830 if (test_bit(port_index, &bus_state->bus_suspended)) in xhci_bus_resume()
1843 &bus_state->bus_suspended); in xhci_bus_resume()
1853 if (bus_state->bus_suspended) { in xhci_bus_resume()
1858 for_each_set_bit(port_index, &bus_state->bus_suspended, in xhci_bus_resume()
1868 for_each_set_bit(port_index, &bus_state->bus_suspended, BITS_PER_LONG) { in xhci_bus_resume()
1883 bus_state->next_statechange = jiffies + msecs_to_jiffies(5); in xhci_bus_resume()
1900 return rhub->bus_state.resuming_ports; /* USB2 ports only */ in xhci_get_resuming_ports()