Lines Matching full:port1

133 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state);
134 static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1,
450 int usb_clear_port_feature(struct usb_device *hdev, int port1, int feature) in usb_clear_port_feature() argument
453 USB_REQ_CLEAR_FEATURE, USB_RT_PORT, feature, port1, in usb_clear_port_feature()
460 static int set_port_feature(struct usb_device *hdev, int port1, int feature) in set_port_feature() argument
463 USB_REQ_SET_FEATURE, USB_RT_PORT, feature, port1, in set_port_feature()
487 static void set_port_led(struct usb_hub *hub, int port1, int selector) in set_port_led() argument
489 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led()
492 status = set_port_feature(hub->hdev, (selector << 8) | port1, in set_port_led()
596 static int get_port_status(struct usb_device *hdev, int port1, in get_port_status() argument
605 port1, data, length, USB_STS_TIMEOUT); in get_port_status()
610 static int hub_ext_port_status(struct usb_hub *hub, int port1, int type, in hub_ext_port_status() argument
620 ret = get_port_status(hub->hdev, port1, &hub->status->port, type, len); in hub_ext_port_status()
639 int usb_hub_port_status(struct usb_hub *hub, int port1, in usb_hub_port_status() argument
642 return hub_ext_port_status(hub, port1, HUB_PORT_STATUS, in usb_hub_port_status()
846 * @port1: port index
855 int port1, bool set) in usb_hub_set_port_power() argument
860 ret = set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in usb_hub_set_port_power()
862 ret = usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in usb_hub_set_port_power()
868 set_bit(port1, hub->power_bits); in usb_hub_set_port_power()
870 clear_bit(port1, hub->power_bits); in usb_hub_set_port_power()
932 int port1; in hub_power_on() local
945 for (port1 = 1; port1 <= hub->hdev->maxchild; port1++) in hub_power_on()
946 if (test_bit(port1, hub->power_bits)) in hub_power_on()
947 set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER); in hub_power_on()
949 usb_clear_port_feature(hub->hdev, port1, in hub_power_on()
975 static int hub_set_port_link_state(struct usb_hub *hub, int port1, in hub_set_port_link_state() argument
979 port1 | (link_status << 3), in hub_set_port_link_state()
988 static void hub_port_logical_disconnect(struct usb_hub *hub, int port1) in hub_port_logical_disconnect() argument
990 dev_dbg(&hub->ports[port1 - 1]->dev, "logical disconnect\n"); in hub_port_logical_disconnect()
991 hub_port_disable(hub, port1, 1); in hub_port_logical_disconnect()
1002 set_bit(port1, hub->change_bits); in hub_port_logical_disconnect()
1052 int port1; in hub_activate() local
1146 for (port1 = 1; port1 <= hdev->maxchild; ++port1) { in hub_activate()
1147 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate()
1152 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in hub_activate()
1179 usb_clear_port_feature(hdev, port1, in hub_activate()
1185 hub_port_warm_reset_required(hub, port1, portstatus)) in hub_activate()
1186 set_bit(port1, hub->event_bits); in hub_activate()
1201 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1206 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1211 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1217 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1225 clear_bit(port1, hub->removed_bits); in hub_activate()
1238 set_bit(port1, hub->change_bits); in hub_activate()
1254 set_bit(port1, hub->event_bits); in hub_activate()
1263 if (test_bit(port1, hub->power_bits)) in hub_activate()
1264 set_bit(port1, hub->change_bits); in hub_activate()
1269 set_bit(port1, hub->change_bits); in hub_activate()
1748 int port1; in hub_disconnect() local
1764 port1 = hdev->maxchild; in hub_disconnect()
1769 for (; port1 > 0; --port1) in hub_disconnect()
1770 usb_hub_remove_port_device(hub, port1); in hub_disconnect()
1985 static int find_port_owner(struct usb_device *hdev, unsigned port1, in find_port_owner() argument
1992 if (port1 == 0 || port1 > hdev->maxchild) in find_port_owner()
1998 *ppowner = &(hub->ports[port1 - 1]->port_owner); in find_port_owner()
2003 int usb_hub_claim_port(struct usb_device *hdev, unsigned port1, in usb_hub_claim_port() argument
2009 rc = find_port_owner(hdev, port1, &powner); in usb_hub_claim_port()
2019 int usb_hub_release_port(struct usb_device *hdev, unsigned port1, in usb_hub_release_port() argument
2025 rc = find_port_owner(hdev, port1, &powner); in usb_hub_release_port()
2251 int port1 = 1; in usb_disconnect() local
2280 port1 = udev->portnum; in usb_disconnect()
2282 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2291 if (!test_and_set_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2314 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2376 unsigned port1 = udev->portnum; in usb_enumerate_device_otg() local
2386 (port1 == bus->otg_port) ? "" : "non-"); in usb_enumerate_device_otg()
2389 if (port1 == bus->otg_port) { in usb_enumerate_device_otg()
2630 int port1 = udev->portnum; in usb_new_device() local
2631 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device()
2645 if (!test_and_set_bit(port1, hub->child_usage_bits)) in usb_new_device()
2859 static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1, in hub_port_warm_reset_required() argument
2867 if (test_bit(port1, hub->warm_reset_bits)) in hub_port_warm_reset_required()
2875 static int hub_port_wait_reset(struct usb_hub *hub, int port1, in hub_port_wait_reset() argument
2891 ret = hub_ext_port_status(hub, port1, in hub_port_wait_reset()
2896 ret = usb_hub_port_status(hub, port1, &portstatus, in hub_port_wait_reset()
2916 dev_dbg(&hub->ports[port1 - 1]->dev, in hub_port_wait_reset()
2924 if (hub_port_warm_reset_required(hub, port1, portstatus)) in hub_port_wait_reset()
2937 usb_clear_port_feature(hub->hdev, port1, in hub_port_wait_reset()
2972 static int hub_port_reset(struct usb_hub *hub, int port1, in hub_port_reset() argument
2977 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset()
2995 if (usb_hub_port_status(hub, port1, &portstatus, in hub_port_reset()
2997 if (hub_port_warm_reset_required(hub, port1, in hub_port_reset()
3001 clear_bit(port1, hub->warm_reset_bits); in hub_port_reset()
3005 status = set_port_feature(hub->hdev, port1, (warm ? in hub_port_reset()
3015 status = hub_port_wait_reset(hub, port1, udev, delay, in hub_port_reset()
3029 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3035 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3037 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3041 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3048 if (usb_hub_port_status(hub, port1, in hub_port_reset()
3052 if (!hub_port_warm_reset_required(hub, port1, in hub_port_reset()
3116 * @port1: port num of the port
3131 static bool hub_port_stop_enumerate(struct usb_hub *hub, int port1, int retries) in hub_port_stop_enumerate() argument
3133 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_stop_enumerate()
3208 struct usb_hub *hub, int port1, in check_port_resume_type() argument
3211 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type()
3217 && hub_port_warm_reset_required(hub, port1, portstatus)) { in check_port_resume_type()
3228 status = usb_hub_port_status(hub, port1, &portstatus, in check_port_resume_type()
3252 usb_clear_port_feature(hub->hdev, port1, in check_port_resume_type()
3255 usb_clear_port_feature(hub->hdev, port1, in check_port_resume_type()
3260 * turned on the port1 bit in hub->change_bits. But after in check_port_resume_type()
3265 clear_bit(port1, hub->change_bits); in check_port_resume_type()
3427 int port1 = udev->portnum; in usb_port_suspend() local
3462 status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U3); in usb_port_suspend()
3476 status = set_port_feature(hub->hdev, port1, in usb_port_suspend()
3491 ret = usb_hub_port_status(hub, port1, &portstatus, in usb_port_suspend()
3533 && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_port_suspend()
3661 struct usb_hub *hub, int port1, in wait_for_connected() argument
3675 status = usb_hub_port_status(hub, port1, portstatus, portchange); in wait_for_connected()
3719 int port1 = udev->portnum; in usb_port_resume() local
3723 if (!test_and_set_bit(port1, hub->child_usage_bits)) { in usb_port_resume()
3735 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in usb_port_resume()
3744 status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U0); in usb_port_resume()
3747 port1, USB_PORT_FEAT_SUSPEND); in usb_port_resume()
3760 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in usb_port_resume()
3768 usb_clear_port_feature(hub->hdev, port1, in usb_port_resume()
3772 usb_clear_port_feature(hub->hdev, port1, in usb_port_resume()
3781 status = wait_for_connected(udev, hub, port1, &portchange, in usb_port_resume()
3785 hub, port1, status, portchange, portstatus); in usb_port_resume()
3790 hub_port_logical_disconnect(hub, port1); in usb_port_resume()
3867 int port1; in check_ports_changed() local
3869 for (port1 = 1; port1 <= hub->hdev->maxchild; ++port1) { in check_ports_changed()
3873 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in check_ports_changed()
3884 unsigned port1; in hub_suspend() local
3891 for (port1 = 1; port1 <= hdev->maxchild; port1++) { in hub_suspend()
3892 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend()
3917 for (port1 = 1; port1 <= hdev->maxchild; port1++) { in hub_suspend()
3919 port1 | in hub_suspend()
4563 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state) in hub_port_disable() argument
4565 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable()
4575 ret = usb_clear_port_feature(hdev, port1, in hub_port_disable()
4615 int hub_port_debounce(struct usb_hub *hub, int port1, bool must_be_connected) in hub_port_debounce() argument
4621 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce()
4624 ret = usb_hub_port_status(hub, port1, &portstatus, &portchange); in hub_port_debounce()
4641 usb_clear_port_feature(hub->hdev, port1, in hub_port_debounce()
4824 hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, in hub_port_init() argument
4829 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init()
4850 if (port1 == hdev->bus->otg_port) in hub_port_init()
4861 retval = hub_port_reset(hub, port1, udev, delay, false); in hub_port_init()
4936 udev->ttport = port1; in hub_port_init()
4955 if (hub_port_stop_enumerate(hub, port1, retries)) { in hub_port_init()
4978 retval = hub_port_reset(hub, port1, udev, delay, false); in hub_port_init()
5121 hub_port_reset(hub, port1, udev, HUB_BH_RESET_TIME, true); in hub_port_init()
5145 hub_port_disable(hub, port1, 0); in hub_port_init()
5153 check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) in check_highspeed() argument
5172 hub->indicator[port1-1] = INDICATOR_GREEN_BLINK; in check_highspeed()
5185 int port1; in hub_power_remaining() local
5191 for (port1 = 1; port1 <= hdev->maxchild; ++port1) { in hub_power_remaining()
5192 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining()
5210 else if (port1 != udev->bus->otg_port || hdev->parent) in hub_power_remaining()
5312 static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, in hub_port_connect() argument
5320 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect()
5337 clear_bit(port1, hub->removed_bits); in hub_port_connect()
5341 status = hub_port_debounce_be_stable(hub, port1); in hub_port_connect()
5344 port1 != unreliable_port && in hub_port_connect()
5348 unreliable_port = port1; in hub_port_connect()
5358 test_bit(port1, hub->removed_bits)) { in hub_port_connect()
5367 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in hub_port_connect()
5381 if (hub_port_stop_enumerate(hub, port1, i)) { in hub_port_connect()
5392 udev = usb_alloc_dev(hdev, hdev->bus, port1); in hub_port_connect()
5418 status = hub_port_init(hub, udev, port1, i, NULL); in hub_port_connect()
5450 hub->indicator[port1-1] = in hub_port_connect()
5465 check_highspeed(hub, udev, port1); in hub_port_connect()
5513 hub_port_disable(hub, port1, 1); in hub_port_connect()
5529 usb_hub_set_port_power(hdev, hub, port1, false); in hub_port_connect()
5531 usb_hub_set_port_power(hdev, hub, port1, true); in hub_port_connect()
5537 !(hcd->driver->port_handed_over)(hcd, port1)) { in hub_port_connect()
5544 hub_port_disable(hub, port1, 1); in hub_port_connect()
5547 hcd->driver->relinquish_port(hcd, port1); in hub_port_connect()
5559 static void hub_port_connect_change(struct usb_hub *hub, int port1, in hub_port_connect_change() argument
5563 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change()
5572 set_port_led(hub, port1, HUB_LED_AUTO); in hub_port_connect_change()
5573 hub->indicator[port1-1] = INDICATOR_AUTO; in hub_port_connect_change()
5622 clear_bit(port1, hub->change_bits); in hub_port_connect_change()
5629 hub_port_connect(hub, port1, portstatus, portchange); in hub_port_connect_change()
5668 static void port_event(struct usb_hub *hub, int port1) in port_event() argument
5672 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event()
5678 connect_change = test_bit(port1, hub->change_bits); in port_event()
5679 clear_bit(port1, hub->event_bits); in port_event()
5680 clear_bit(port1, hub->wakeup_bits); in port_event()
5682 if (usb_hub_port_status(hub, port1, &portstatus, &portchange) < 0) in port_event()
5686 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION); in port_event()
5694 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE); in port_event()
5715 usb_clear_port_feature(hdev, port1, in port_event()
5719 usb_hub_port_status(hub, port1, &status, &unused); in port_event()
5726 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_RESET); in port_event()
5731 usb_clear_port_feature(hdev, port1, in port_event()
5736 usb_clear_port_feature(hdev, port1, in port_event()
5741 usb_clear_port_feature(hdev, port1, in port_event()
5753 if (hub_handle_remote_wakeup(hub, port1, portstatus, portchange)) in port_event()
5762 while (hub_port_warm_reset_required(hub, port1, portstatus)) { in port_event()
5767 usb_hub_port_status(hub, port1, &portstatus, &unused); in port_event()
5773 if (hub_port_reset(hub, port1, NULL, in port_event()
5775 hub_port_disable(hub, port1, 1); in port_event()
5789 hub_port_connect_change(hub, port1, portstatus, portchange); in port_event()
6066 int port1 = udev->portnum; in usb_reset_and_verify_device() local
6091 if (hub_port_stop_enumerate(parent_hub, port1, i)) { in usb_reset_and_verify_device()
6099 ret = hub_port_init(parent_hub, udev, port1, i, &descriptor); in usb_reset_and_verify_device()
6192 hub_port_logical_disconnect(parent_hub, port1); in usb_reset_and_verify_device()
6354 * attached to the port which is specified by @port1.
6356 * @port1: port num to indicate which port the child device
6366 int port1) in usb_hub_find_child() argument
6370 if (port1 < 1 || port1 > hdev->maxchild) in usb_hub_find_child()
6372 return hub->ports[port1 - 1]->child; in usb_hub_find_child()
6425 * @port1: port num of the port
6431 int port1) in usb_get_hub_port_acpi_handle() argument
6438 return ACPI_HANDLE(&hub->ports[port1 - 1]->dev); in usb_get_hub_port_acpi_handle()