Lines Matching full:port1
134 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state);
135 static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1,
451 int usb_clear_port_feature(struct usb_device *hdev, int port1, int feature) in usb_clear_port_feature() argument
454 USB_REQ_CLEAR_FEATURE, USB_RT_PORT, feature, port1, in usb_clear_port_feature()
461 static int set_port_feature(struct usb_device *hdev, int port1, int feature) in set_port_feature() argument
464 USB_REQ_SET_FEATURE, USB_RT_PORT, feature, port1, in set_port_feature()
488 static void set_port_led(struct usb_hub *hub, int port1, int selector) in set_port_led() argument
490 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led()
493 status = set_port_feature(hub->hdev, (selector << 8) | port1, in set_port_led()
597 static int get_port_status(struct usb_device *hdev, int port1, in get_port_status() argument
606 port1, data, length, USB_STS_TIMEOUT); in get_port_status()
611 static int hub_ext_port_status(struct usb_hub *hub, int port1, int type, in hub_ext_port_status() argument
621 ret = get_port_status(hub->hdev, port1, &hub->status->port, type, len); in hub_ext_port_status()
659 usb_phy_roothub_notify_connect(hcd->phy_roothub, port1 - 1); in hub_ext_port_status()
661 usb_phy_roothub_notify_disconnect(hcd->phy_roothub, port1 - 1); in hub_ext_port_status()
668 int usb_hub_port_status(struct usb_hub *hub, int port1, in usb_hub_port_status() argument
671 return hub_ext_port_status(hub, port1, HUB_PORT_STATUS, in usb_hub_port_status()
875 * @port1: port index
884 int port1, bool set) in usb_hub_set_port_power() argument
889 ret = set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in usb_hub_set_port_power()
891 ret = usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in usb_hub_set_port_power()
897 set_bit(port1, hub->power_bits); in usb_hub_set_port_power()
899 clear_bit(port1, hub->power_bits); in usb_hub_set_port_power()
961 int port1; in hub_power_on() local
974 for (port1 = 1; port1 <= hub->hdev->maxchild; port1++) in hub_power_on()
975 if (test_bit(port1, hub->power_bits)) in hub_power_on()
976 set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER); in hub_power_on()
978 usb_clear_port_feature(hub->hdev, port1, in hub_power_on()
1004 static int hub_set_port_link_state(struct usb_hub *hub, int port1, in hub_set_port_link_state() argument
1008 port1 | (link_status << 3), in hub_set_port_link_state()
1017 static void hub_port_logical_disconnect(struct usb_hub *hub, int port1) in hub_port_logical_disconnect() argument
1019 dev_dbg(&hub->ports[port1 - 1]->dev, "logical disconnect\n"); in hub_port_logical_disconnect()
1020 hub_port_disable(hub, port1, 1); in hub_port_logical_disconnect()
1031 set_bit(port1, hub->change_bits); in hub_port_logical_disconnect()
1081 int port1; in hub_activate() local
1175 for (port1 = 1; port1 <= hdev->maxchild; ++port1) { in hub_activate()
1176 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate()
1181 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in hub_activate()
1208 usb_clear_port_feature(hdev, port1, in hub_activate()
1214 hub_port_warm_reset_required(hub, port1, portstatus)) in hub_activate()
1215 set_bit(port1, hub->event_bits); in hub_activate()
1230 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1235 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1240 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1246 usb_clear_port_feature(hub->hdev, port1, in hub_activate()
1254 clear_bit(port1, hub->removed_bits); in hub_activate()
1267 set_bit(port1, hub->change_bits); in hub_activate()
1283 set_bit(port1, hub->event_bits); in hub_activate()
1292 if (test_bit(port1, hub->power_bits)) in hub_activate()
1293 set_bit(port1, hub->change_bits); in hub_activate()
1298 set_bit(port1, hub->change_bits); in hub_activate()
1777 int port1; in hub_disconnect() local
1793 port1 = hdev->maxchild; in hub_disconnect()
1798 for (; port1 > 0; --port1) in hub_disconnect()
1799 usb_hub_remove_port_device(hub, port1); in hub_disconnect()
2014 static int find_port_owner(struct usb_device *hdev, unsigned port1, in find_port_owner() argument
2021 if (port1 == 0 || port1 > hdev->maxchild) in find_port_owner()
2027 *ppowner = &(hub->ports[port1 - 1]->port_owner); in find_port_owner()
2032 int usb_hub_claim_port(struct usb_device *hdev, unsigned port1, in usb_hub_claim_port() argument
2038 rc = find_port_owner(hdev, port1, &powner); in usb_hub_claim_port()
2048 int usb_hub_release_port(struct usb_device *hdev, unsigned port1, in usb_hub_release_port() argument
2054 rc = find_port_owner(hdev, port1, &powner); in usb_hub_release_port()
2279 int port1 = 1; in usb_disconnect() local
2308 port1 = udev->portnum; in usb_disconnect()
2310 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2319 if (!test_and_set_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2344 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2406 unsigned port1 = udev->portnum; in usb_enumerate_device_otg() local
2416 (port1 == bus->otg_port) ? "" : "non-"); in usb_enumerate_device_otg()
2419 if (port1 == bus->otg_port) { in usb_enumerate_device_otg()
2660 int port1 = udev->portnum; in usb_new_device() local
2661 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device()
2675 if (!test_and_set_bit(port1, hub->child_usage_bits)) in usb_new_device()
2891 static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1, in hub_port_warm_reset_required() argument
2899 if (test_bit(port1, hub->warm_reset_bits)) in hub_port_warm_reset_required()
2907 static int hub_port_wait_reset(struct usb_hub *hub, int port1, in hub_port_wait_reset() argument
2923 ret = hub_ext_port_status(hub, port1, in hub_port_wait_reset()
2928 ret = usb_hub_port_status(hub, port1, &portstatus, in hub_port_wait_reset()
2948 dev_dbg(&hub->ports[port1 - 1]->dev, in hub_port_wait_reset()
2956 if (hub_port_warm_reset_required(hub, port1, portstatus)) in hub_port_wait_reset()
2969 usb_clear_port_feature(hub->hdev, port1, in hub_port_wait_reset()
3004 static int hub_port_reset(struct usb_hub *hub, int port1, in hub_port_reset() argument
3009 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset()
3027 if (usb_hub_port_status(hub, port1, &portstatus, in hub_port_reset()
3029 if (hub_port_warm_reset_required(hub, port1, in hub_port_reset()
3033 clear_bit(port1, hub->warm_reset_bits); in hub_port_reset()
3037 status = set_port_feature(hub->hdev, port1, (warm ? in hub_port_reset()
3047 status = hub_port_wait_reset(hub, port1, udev, delay, in hub_port_reset()
3061 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3067 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3069 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3073 usb_clear_port_feature(hub->hdev, port1, in hub_port_reset()
3080 if (usb_hub_port_status(hub, port1, in hub_port_reset()
3084 if (!hub_port_warm_reset_required(hub, port1, in hub_port_reset()
3148 * @port1: port num of the port
3163 static bool hub_port_stop_enumerate(struct usb_hub *hub, int port1, int retries) in hub_port_stop_enumerate() argument
3165 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_stop_enumerate()
3240 struct usb_hub *hub, int port1, in check_port_resume_type() argument
3243 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type()
3249 && hub_port_warm_reset_required(hub, port1, portstatus)) { in check_port_resume_type()
3260 status = usb_hub_port_status(hub, port1, &portstatus, in check_port_resume_type()
3284 usb_clear_port_feature(hub->hdev, port1, in check_port_resume_type()
3287 usb_clear_port_feature(hub->hdev, port1, in check_port_resume_type()
3292 * turned on the port1 bit in hub->change_bits. But after in check_port_resume_type()
3297 clear_bit(port1, hub->change_bits); in check_port_resume_type()
3459 int port1 = udev->portnum; in usb_port_suspend() local
3494 status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U3); in usb_port_suspend()
3508 status = set_port_feature(hub->hdev, port1, in usb_port_suspend()
3523 ret = usb_hub_port_status(hub, port1, &portstatus, in usb_port_suspend()
3565 && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_port_suspend()
3693 struct usb_hub *hub, int port1, in wait_for_connected() argument
3707 status = usb_hub_port_status(hub, port1, portstatus, portchange); in wait_for_connected()
3751 int port1 = udev->portnum; in usb_port_resume() local
3755 if (!test_and_set_bit(port1, hub->child_usage_bits)) { in usb_port_resume()
3767 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in usb_port_resume()
3776 status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U0); in usb_port_resume()
3779 port1, USB_PORT_FEAT_SUSPEND); in usb_port_resume()
3792 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in usb_port_resume()
3800 usb_clear_port_feature(hub->hdev, port1, in usb_port_resume()
3804 usb_clear_port_feature(hub->hdev, port1, in usb_port_resume()
3813 status = wait_for_connected(udev, hub, port1, &portchange, in usb_port_resume()
3817 hub, port1, status, portchange, portstatus); in usb_port_resume()
3822 hub_port_logical_disconnect(hub, port1); in usb_port_resume()
3899 int port1; in check_ports_changed() local
3901 for (port1 = 1; port1 <= hub->hdev->maxchild; ++port1) { in check_ports_changed()
3905 status = usb_hub_port_status(hub, port1, &portstatus, &portchange); in check_ports_changed()
3916 unsigned port1; in hub_suspend() local
3923 for (port1 = 1; port1 <= hdev->maxchild; port1++) { in hub_suspend()
3924 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend()
3949 for (port1 = 1; port1 <= hdev->maxchild; port1++) { in hub_suspend()
3951 port1 | in hub_suspend()
4595 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state) in hub_port_disable() argument
4597 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable()
4607 ret = usb_clear_port_feature(hdev, port1, in hub_port_disable()
4647 int hub_port_debounce(struct usb_hub *hub, int port1, bool must_be_connected) in hub_port_debounce() argument
4653 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce()
4656 ret = usb_hub_port_status(hub, port1, &portstatus, &portchange); in hub_port_debounce()
4673 usb_clear_port_feature(hub->hdev, port1, in hub_port_debounce()
4856 hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, in hub_port_init() argument
4861 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init()
4882 if (port1 == hdev->bus->otg_port) in hub_port_init()
4893 retval = hub_port_reset(hub, port1, udev, delay, false); in hub_port_init()
4968 udev->ttport = port1; in hub_port_init()
4987 if (hub_port_stop_enumerate(hub, port1, retries)) { in hub_port_init()
5010 retval = hub_port_reset(hub, port1, udev, delay, false); in hub_port_init()
5153 hub_port_reset(hub, port1, udev, HUB_BH_RESET_TIME, true); in hub_port_init()
5177 hub_port_disable(hub, port1, 0); in hub_port_init()
5185 check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) in check_highspeed() argument
5204 hub->indicator[port1-1] = INDICATOR_GREEN_BLINK; in check_highspeed()
5217 int port1; in hub_power_remaining() local
5223 for (port1 = 1; port1 <= hdev->maxchild; ++port1) { in hub_power_remaining()
5224 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining()
5242 else if (port1 != udev->bus->otg_port || hdev->parent) in hub_power_remaining()
5344 static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, in hub_port_connect() argument
5352 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect()
5369 clear_bit(port1, hub->removed_bits); in hub_port_connect()
5373 status = hub_port_debounce_be_stable(hub, port1); in hub_port_connect()
5376 port1 != unreliable_port && in hub_port_connect()
5380 unreliable_port = port1; in hub_port_connect()
5390 test_bit(port1, hub->removed_bits)) { in hub_port_connect()
5399 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in hub_port_connect()
5413 if (hub_port_stop_enumerate(hub, port1, i)) { in hub_port_connect()
5424 udev = usb_alloc_dev(hdev, hdev->bus, port1); in hub_port_connect()
5450 status = hub_port_init(hub, udev, port1, i, NULL); in hub_port_connect()
5482 hub->indicator[port1-1] = in hub_port_connect()
5497 check_highspeed(hub, udev, port1); in hub_port_connect()
5545 hub_port_disable(hub, port1, 1); in hub_port_connect()
5561 usb_hub_set_port_power(hdev, hub, port1, false); in hub_port_connect()
5563 usb_hub_set_port_power(hdev, hub, port1, true); in hub_port_connect()
5569 !(hcd->driver->port_handed_over)(hcd, port1)) { in hub_port_connect()
5576 hub_port_disable(hub, port1, 1); in hub_port_connect()
5579 hcd->driver->relinquish_port(hcd, port1); in hub_port_connect()
5591 static void hub_port_connect_change(struct usb_hub *hub, int port1, in hub_port_connect_change() argument
5595 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change()
5604 set_port_led(hub, port1, HUB_LED_AUTO); in hub_port_connect_change()
5605 hub->indicator[port1-1] = INDICATOR_AUTO; in hub_port_connect_change()
5654 clear_bit(port1, hub->change_bits); in hub_port_connect_change()
5661 hub_port_connect(hub, port1, portstatus, portchange); in hub_port_connect_change()
5700 static void port_event(struct usb_hub *hub, int port1) in port_event() argument
5704 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event()
5710 connect_change = test_bit(port1, hub->change_bits); in port_event()
5711 clear_bit(port1, hub->event_bits); in port_event()
5712 clear_bit(port1, hub->wakeup_bits); in port_event()
5714 if (usb_hub_port_status(hub, port1, &portstatus, &portchange) < 0) in port_event()
5718 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION); in port_event()
5726 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE); in port_event()
5747 usb_clear_port_feature(hdev, port1, in port_event()
5751 usb_hub_port_status(hub, port1, &status, &unused); in port_event()
5758 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_RESET); in port_event()
5763 usb_clear_port_feature(hdev, port1, in port_event()
5768 usb_clear_port_feature(hdev, port1, in port_event()
5773 usb_clear_port_feature(hdev, port1, in port_event()
5785 if (hub_handle_remote_wakeup(hub, port1, portstatus, portchange)) in port_event()
5794 while (hub_port_warm_reset_required(hub, port1, portstatus)) { in port_event()
5799 usb_hub_port_status(hub, port1, &portstatus, &unused); in port_event()
5805 if (hub_port_reset(hub, port1, NULL, in port_event()
5807 hub_port_disable(hub, port1, 1); in port_event()
5821 hub_port_connect_change(hub, port1, portstatus, portchange); in port_event()
6098 int port1 = udev->portnum; in usb_reset_and_verify_device() local
6123 if (hub_port_stop_enumerate(parent_hub, port1, i)) { in usb_reset_and_verify_device()
6131 ret = hub_port_init(parent_hub, udev, port1, i, &descriptor); in usb_reset_and_verify_device()
6224 hub_port_logical_disconnect(parent_hub, port1); in usb_reset_and_verify_device()
6386 * attached to the port which is specified by @port1.
6388 * @port1: port num to indicate which port the child device
6398 int port1) in usb_hub_find_child() argument
6402 if (port1 < 1 || port1 > hdev->maxchild) in usb_hub_find_child()
6404 return hub->ports[port1 - 1]->child; in usb_hub_find_child()
6457 * @port1: port num of the port
6463 int port1) in usb_get_hub_port_acpi_handle() argument
6470 return ACPI_HANDLE(&hub->ports[port1 - 1]->dev); in usb_get_hub_port_acpi_handle()