Lines Matching refs:hdev
42 struct usb_device *hdev; member
163 static inline struct usb_hub *hdev_to_hub(struct usb_device *hdev) in hdev_to_hub() argument
165 return usb_get_intfdata(hdev->actconfig->interface[0]); in hdev_to_hub()
169 static int get_hub_descriptor(struct usb_device *hdev, void *data, int size) in get_hub_descriptor() argument
174 ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), in get_hub_descriptor()
187 static int clear_hub_feature(struct usb_device *hdev, int feature) in clear_hub_feature() argument
189 return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), in clear_hub_feature()
196 static int clear_port_feature(struct usb_device *hdev, int port1, int feature) in clear_port_feature() argument
198 return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), in clear_port_feature()
206 static int set_port_feature(struct usb_device *hdev, int port1, int feature) in set_port_feature() argument
208 return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), in set_port_feature()
223 int status = set_port_feature(hub->hdev, (selector << 8) | port1, in set_port_led()
245 struct usb_device *hdev = hub->hdev; in led_work() local
250 if (hdev->state != USB_STATE_CONFIGURED || hub->quiescing) in led_work()
318 static int get_hub_status(struct usb_device *hdev, in get_hub_status() argument
324 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), in get_hub_status()
334 static int get_port_status(struct usb_device *hdev, int port1, in get_port_status() argument
340 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), in get_port_status()
353 ret = get_port_status(hub->hdev, port1, &hub->status->port); in hub_port_status()
383 void usb_kick_khubd(struct usb_device *hdev) in usb_kick_khubd() argument
386 kick_khubd(hdev_to_hub(hdev)); in usb_kick_khubd()
438 hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) in hub_clear_tt_buffer() argument
440 return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), in hub_clear_tt_buffer()
462 struct usb_device *hdev = hub->hdev; in hub_tt_kevent() local
471 status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); in hub_tt_kevent()
475 dev_err (&hdev->dev, in hub_tt_kevent()
553 set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER); in hub_power_on()
568 ret = get_hub_status(hub->hdev, &hub->status->hub); in hub_hub_status()
583 struct usb_device *hdev = hub->hdev; in hub_port_disable() local
586 if (hdev->children[port1-1] && set_state) in hub_port_disable()
587 usb_set_device_state(hdev->children[port1-1], in hub_port_disable()
590 ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE); in hub_port_disable()
630 struct usb_device *hdev = hub->hdev; in hub_activate() local
677 for (port1 = 1; port1 <= hdev->maxchild; ++port1) { in hub_activate()
678 struct usb_device *udev = hdev->children[port1-1]; in hub_activate()
698 clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE); in hub_activate()
705 clear_port_feature(hub->hdev, port1, in hub_activate()
710 clear_port_feature(hub->hdev, port1, in hub_activate()
798 struct usb_device *hdev = hub->hdev; in hub_quiesce() local
808 for (i = 0; i < hdev->maxchild; ++i) { in hub_quiesce()
809 if (hdev->children[i]) in hub_quiesce()
810 usb_disconnect(&hdev->children[i]); in hub_quiesce()
843 struct usb_device *hdev = hub->hdev; in hub_configure() local
851 hub->buffer = usb_buffer_alloc(hdev, sizeof(*hub->buffer), GFP_KERNEL, in hub_configure()
878 ret = get_hub_descriptor(hdev, hub->descriptor, in hub_configure()
889 hdev->maxchild = hub->descriptor->bNbrPorts; in hub_configure()
890 dev_info (hub_dev, "%d port%s detected\n", hdev->maxchild, in hub_configure()
891 (hdev->maxchild == 1) ? "" : "s"); in hub_configure()
899 for (i = 0; i < hdev->maxchild; i++) in hub_configure()
903 portstr[hdev->maxchild] = 0; in hub_configure()
937 switch (hdev->descriptor.bDeviceProtocol) { in hub_configure()
942 hub->tt.hub = hdev; in hub_configure()
945 ret = usb_set_interface(hdev, 0, 1); in hub_configure()
952 hub->tt.hub = hdev; in hub_configure()
956 hdev->descriptor.bDeviceProtocol); in hub_configure()
963 if (hdev->descriptor.bDeviceProtocol != 0) { in hub_configure()
1002 ret = usb_get_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus); in hub_configure()
1008 if (hdev == hdev->bus->root_hub) { in hub_configure()
1009 if (hdev->bus_mA == 0 || hdev->bus_mA >= 500) in hub_configure()
1012 hub->mA_per_port = hdev->bus_mA; in hub_configure()
1019 if (hdev->maxchild > 0) { in hub_configure()
1020 int remaining = hdev->bus_mA - in hub_configure()
1023 if (remaining < hdev->maxchild * 100) in hub_configure()
1045 if (hdev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_SELFPOWER) in hub_configure()
1060 pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress); in hub_configure()
1061 maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe)); in hub_configure()
1073 usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq, in hub_configure()
1118 if (hub->hdev->speed == USB_SPEED_HIGH) in hub_disconnect()
1124 usb_buffer_free(hub->hdev, sizeof(*hub->buffer), hub->buffer, in hub_disconnect()
1134 struct usb_device *hdev; in hub_probe() local
1138 hdev = interface_to_usbdev(intf); in hub_probe()
1140 if (hdev->level == MAX_TOPO_LEVEL) { in hub_probe()
1147 if (hdev->parent) { in hub_probe()
1184 hub->hdev = hdev; in hub_probe()
1192 if (hdev->speed == USB_SPEED_HIGH) in hub_probe()
1205 struct usb_device *hdev = interface_to_usbdev (intf); in hub_ioctl() local
1214 if (hdev->devnum <= 0) in hub_ioctl()
1217 info->nports = hdev->maxchild; in hub_ioctl()
1219 if (hdev->children[i] == NULL) in hub_ioctl()
1223 hdev->children[i]->devnum; in hub_ioctl()
1759 if (hub->hdev->parent != NULL) /* not a root hub? */ in hub_is_wusb()
1761 hcd = container_of(hub->hdev->bus, struct usb_hcd, self); in hub_is_wusb()
1841 status = set_port_feature(hub->hdev, in hub_port_reset()
1864 clear_port_feature(hub->hdev, in hub_port_reset()
1925 clear_port_feature(hub->hdev, port1, in check_port_resume_type()
1928 clear_port_feature(hub->hdev, port1, in check_port_resume_type()
2009 status = set_port_feature(hub->hdev, port1, USB_PORT_FEAT_SUSPEND); in usb_port_suspend()
2159 status = clear_port_feature(hub->hdev, in usb_port_resume()
2183 clear_port_feature(hub->hdev, port1, in usb_port_resume()
2255 struct usb_device *hdev = hub->hdev; in hub_suspend() local
2259 for (port1 = 1; port1 <= hdev->maxchild; port1++) { in hub_suspend()
2262 udev = hdev->children [port1-1]; in hub_suspend()
2365 clear_port_feature(hub->hdev, port1, in hub_port_debounce()
2431 struct usb_device *hdev = hub->hdev; in hub_port_init() local
2441 if (!hdev->parent) { in hub_port_init()
2443 if (port1 == hdev->bus->otg_port) in hub_port_init()
2444 hdev->bus->b_hnp_enable = 0; in hub_port_init()
2510 if (hdev->tt) { in hub_port_init()
2511 udev->tt = hdev->tt; in hub_port_init()
2512 udev->ttport = hdev->ttport; in hub_port_init()
2514 && hdev->speed == USB_SPEED_HIGH) { in hub_port_init()
2697 struct usb_device *hdev = hub->hdev; in hub_power_remaining() local
2704 remaining = hdev->bus_mA - hub->descriptor->bHubContrCurrent; in hub_power_remaining()
2705 for (port1 = 1; port1 <= hdev->maxchild; ++port1) { in hub_power_remaining()
2706 struct usb_device *udev = hdev->children[port1 - 1]; in hub_power_remaining()
2716 else if (port1 != udev->bus->otg_port || hdev->parent) in hub_power_remaining()
2745 struct usb_device *hdev = hub->hdev; in hub_port_connect_change() local
2747 struct usb_hcd *hcd = bus_to_hcd(hdev->bus); in hub_port_connect_change()
2764 if (hdev->bus->is_b_host) in hub_port_connect_change()
2770 udev = hdev->children[port1-1]; in hub_port_connect_change()
2806 usb_disconnect(&hdev->children[port1-1]); in hub_port_connect_change()
2828 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); in hub_port_connect_change()
2840 udev = usb_alloc_dev(hdev, hdev->bus, port1); in hub_port_connect_change()
2851 udev->level = hdev->level + 1; in hub_port_connect_change()
2914 if (hdev->state == USB_STATE_NOTATTACHED) in hub_port_connect_change()
2917 hdev->children[port1-1] = udev; in hub_port_connect_change()
2925 hdev->children[port1-1] = NULL; in hub_port_connect_change()
2948 if (hub->hdev->parent || in hub_port_connect_change()
2956 if (hcd->driver->relinquish_port && !hub->hdev->parent) in hub_port_connect_change()
2963 struct usb_device *hdev; in hub_events() local
2996 hdev = hub->hdev; in hub_events()
3000 hdev->state, hub->descriptor in hub_events()
3009 usb_lock_device(hdev); in hub_events()
3014 if (hdev->state == USB_STATE_NOTATTACHED) { in hub_events()
3035 ret = usb_reset_device(hdev); in hub_events()
3061 clear_port_feature(hdev, i, in hub_events()
3072 clear_port_feature(hdev, i, in hub_events()
3083 && hdev->children[i-1]) { in hub_events()
3096 clear_port_feature(hdev, i, in hub_events()
3098 udev = hdev->children[i-1]; in hub_events()
3101 ret = remote_wakeup(hdev-> in hub_events()
3119 clear_port_feature(hdev, i, in hub_events()
3128 clear_port_feature(hdev, i, in hub_events()
3145 clear_hub_feature(hdev, C_HUB_LOCAL_POWER); in hub_events()
3155 clear_hub_feature(hdev, C_HUB_OVER_CURRENT); in hub_events()
3165 usb_unlock_device(hdev); in hub_events()