Lines Matching refs:bus

198 		usb_needs_explore(sc->sc_udev->bus, 0);  in uhub_intr_callback()
242 USB_BUS_UNLOCK(udev->bus); in uhub_reset_tt_proc()
248 USB_BUS_LOCK(udev->bus); in uhub_reset_tt_proc()
288 USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); in uhub_tt_buffer_reset_async_locked()
319 usb_proc_msignal(USB_BUS_TT_PROC(udev->bus), in uhub_tt_buffer_reset_async_locked()
342 USB_BUS_LOCK(udev->bus); in uhub_reset_tt_callback()
359 USB_BUS_UNLOCK(udev->bus); in uhub_reset_tt_callback()
364 USB_BUS_UNLOCK(udev->bus); in uhub_reset_tt_callback()
403 child = usb_bus_port_get_device(udev->bus, up); in uhub_count_active_host_ports()
509 struct usb_bus *bus; in uhub_explore_sub() local
514 bus = sc->sc_udev->bus; in uhub_explore_sub()
518 refcount = bus->driver_added_refcount; in uhub_explore_sub()
521 child = usb_bus_port_get_device(bus, up); in uhub_explore_sub()
613 child = usb_bus_port_get_device(udev->bus, in uhub_reattach_port()
813 child = usb_alloc_device(sc->sc_dev, udev->bus, udev, in uhub_reattach_port()
883 child = usb_bus_port_get_device(udev->bus, in uhub_suspend_resume_port()
957 uhub_root_intr(struct usb_bus *bus, const uint8_t *ptr, uint8_t len) in uhub_root_intr() argument
959 USB_BUS_LOCK_ASSERT(bus, MA_OWNED); in uhub_root_intr()
961 usb_needs_explore(bus, 0); in uhub_root_intr()
1552 struct usb_bus *bus = sc->sc_udev->bus; in uhub_detach() local
1564 child = usb_bus_port_get_device(bus, hub->ports + x); in uhub_detach()
1578 USB_BUS_LOCK(bus); in uhub_detach()
1579 usb_proc_mwait(USB_BUS_TT_PROC(bus), in uhub_detach()
1581 USB_BUS_UNLOCK(bus); in uhub_detach()
1628 udev = usb_bus_port_get_device(hub->hubudev->bus, in uhub_find_iface_index()
1673 , device_get_unit(res.udev->bus->bdev) in uhub_child_location()
1688 uhub_get_device_path(device_t bus, device_t child, const char *locator, in uhub_get_device_path() argument
1697 rv = bus_generic_get_device_path(device_get_parent(bus), bus, locator, sb); in uhub_get_device_path()
1701 sc = device_get_softc(bus); in uhub_get_device_path()
1717 return (bus_generic_get_device_path(bus, child, locator, sb)); in uhub_get_device_path()
1865 struct usb_bus *bus = udev->bus; in usb_hs_bandwidth_adjust() local
1870 USB_BUS_LOCK_ASSERT(bus, MA_OWNED); in usb_hs_bandwidth_adjust()
1895 bus->uframe_usage[x] += len; in usb_hs_bandwidth_adjust()
1901 slot = usb_intr_find_best_slot(bus->uframe_usage, 0, in usb_hs_bandwidth_adjust()
1906 bus->uframe_usage[x] += len; in usb_hs_bandwidth_adjust()
2049 usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr) in usb_isoc_time_expand() argument
2053 USB_BUS_LOCK_ASSERT(bus, MA_OWNED); in usb_isoc_time_expand()
2055 rem = bus->isoc_time_last & (USB_ISOC_TIME_MAX - 1); in usb_isoc_time_expand()
2061 bus->isoc_time_last += USB_ISOC_TIME_MAX; in usb_isoc_time_expand()
2065 bus->isoc_time_last &= ~(USB_ISOC_TIME_MAX - 1); in usb_isoc_time_expand()
2066 bus->isoc_time_last |= isoc_time_curr; in usb_isoc_time_expand()
2068 return (bus->isoc_time_last); in usb_isoc_time_expand()
2087 struct usb_bus *bus; in usbd_fs_isoc_schedule_alloc_slot() local
2097 bus = isoc_xfer->xroot->bus; in usbd_fs_isoc_schedule_alloc_slot()
2099 TAILQ_FOREACH(xfer, &bus->intr_q.head, wait_entry) { in usbd_fs_isoc_schedule_alloc_slot()
2205 usb_bus_port_get_device(struct usb_bus *bus, struct usb_port *up) in usb_bus_port_get_device() argument
2207 if ((bus == NULL) || (up == NULL)) { in usb_bus_port_get_device()
2215 return (bus->devices[up->device_index]); in usb_bus_port_get_device()
2224 usb_bus_port_set_device(struct usb_bus *bus, struct usb_port *up, in usb_bus_port_set_device() argument
2227 if (bus == NULL) { in usb_bus_port_set_device()
2250 bus->devices[device_index] = udev; in usb_bus_port_set_device()
2258 DPRINTFN(2, "bus %p devices[%u] = %p\n", bus, device_index, udev); in usb_bus_port_set_device()
2267 usb_needs_explore(struct usb_bus *bus, uint8_t do_probe) in usb_needs_explore() argument
2278 if (bus == NULL) { in usb_needs_explore()
2282 if ((bus->devices == NULL) || in usb_needs_explore()
2283 (bus->devices[USB_ROOT_HUB_ADDR] == NULL)) { in usb_needs_explore()
2287 if (mtx_owned(&bus->bus_mtx)) { in usb_needs_explore()
2290 USB_BUS_LOCK(bus); in usb_needs_explore()
2294 bus->do_probe = 1; in usb_needs_explore()
2296 if (usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), in usb_needs_explore()
2297 &bus->explore_msg[0], &bus->explore_msg[1])) { in usb_needs_explore()
2301 USB_BUS_UNLOCK(bus); in usb_needs_explore()
2314 struct usb_bus *bus; in usb_needs_explore_all() local
2333 bus = device_get_softc(dev); in usb_needs_explore_all()
2334 if (bus) { in usb_needs_explore_all()
2335 usb_needs_explore(bus, 1); in usb_needs_explore_all()
2371 usb_bus_power_update(struct usb_bus *bus) in usb_bus_power_update() argument
2373 usb_needs_explore(bus, 0 /* no probe */ ); in usb_bus_power_update()
2405 USB_BUS_LOCK(udev->bus); in usbd_transfer_power_ref()
2433 if (!(udev->bus->hw_power_state & power_mask[xfer_type])) { in usbd_transfer_power_ref()
2435 udev->bus->hw_power_state |= power_mask[xfer_type]; in usbd_transfer_power_ref()
2445 USB_BUS_UNLOCK(udev->bus); in usbd_transfer_power_ref()
2449 usb_bus_power_update(udev->bus); in usbd_transfer_power_ref()
2452 if (udev->bus->methods->set_hw_power != NULL) { in usbd_transfer_power_ref()
2453 (udev->bus->methods->set_hw_power) (udev->bus); in usbd_transfer_power_ref()
2469 (udev->driver_added_refcount != udev->bus->driver_added_refcount) || in usb_peer_should_wakeup()
2486 usb_bus_powerd(struct usb_bus *bus) in usb_bus_powerd() argument
2503 DPRINTF("bus=%p\n", bus); in usb_bus_powerd()
2505 USB_BUS_LOCK(bus); in usb_bus_powerd()
2512 x != bus->devices_max; x++) { in usb_bus_powerd()
2513 udev = bus->devices[x]; in usb_bus_powerd()
2522 USB_BUS_UNLOCK(bus); in usb_bus_powerd()
2524 USB_BUS_LOCK(bus); in usb_bus_powerd()
2531 USB_BUS_UNLOCK(bus); in usb_bus_powerd()
2533 USB_BUS_LOCK(bus); in usb_bus_powerd()
2549 x != bus->devices_max; x++) { in usb_bus_powerd()
2550 udev = bus->devices[x]; in usb_bus_powerd()
2578 bus->hw_power_state = 0; in usb_bus_powerd()
2580 bus->hw_power_state |= USB_HW_POWER_CONTROL; in usb_bus_powerd()
2582 bus->hw_power_state |= USB_HW_POWER_BULK; in usb_bus_powerd()
2584 bus->hw_power_state |= USB_HW_POWER_INTERRUPT; in usb_bus_powerd()
2586 bus->hw_power_state |= USB_HW_POWER_ISOC; in usb_bus_powerd()
2588 bus->hw_power_state |= USB_HW_POWER_NON_ROOT_HUB; in usb_bus_powerd()
2590 USB_BUS_UNLOCK(bus); in usb_bus_powerd()
2592 if (bus->methods->set_hw_power != NULL) { in usb_bus_powerd()
2594 (bus->methods->set_hw_power) (bus); in usb_bus_powerd()
2653 struct usb_bus *bus; in usb_dev_resume_peer() local
2680 bus = udev->bus; in usb_dev_resume_peer()
2706 if (bus->methods->device_resume != NULL) { in usb_dev_resume_peer()
2708 (bus->methods->device_resume) (udev); in usb_dev_resume_peer()
2710 USB_BUS_LOCK(bus); in usb_dev_resume_peer()
2719 bus->hw_power_state |= USB_HW_POWER_CONTROL; in usb_dev_resume_peer()
2721 bus->hw_power_state |= USB_HW_POWER_BULK; in usb_dev_resume_peer()
2723 bus->hw_power_state |= USB_HW_POWER_INTERRUPT; in usb_dev_resume_peer()
2725 bus->hw_power_state |= USB_HW_POWER_ISOC; in usb_dev_resume_peer()
2727 USB_BUS_UNLOCK(bus); in usb_dev_resume_peer()
2729 if (bus->methods->set_hw_power != NULL) { in usb_dev_resume_peer()
2731 (bus->methods->set_hw_power) (bus); in usb_dev_resume_peer()
2788 child = usb_bus_port_get_device(udev->bus, in usb_dev_suspend_peer()
2816 USB_BUS_LOCK(udev->bus); in usb_dev_suspend_peer()
2830 USB_BUS_UNLOCK(udev->bus); in usb_dev_suspend_peer()
2867 if (udev->bus->methods->device_suspend != NULL) { in usb_dev_suspend_peer()
2871 (udev->bus->methods->device_suspend) (udev); in usb_dev_suspend_peer()
2920 usb_bus_power_update(udev->bus); in usbd_set_power_mode()
2922 usb_needs_explore(udev->bus, 0 /* no probe */ ); in usbd_set_power_mode()
2937 mtod = udev->bus->methods; in usbd_filter_power_mode()
2963 usb_needs_explore(udev->bus, 0); in usbd_start_re_enumerate()
2984 usb_needs_explore(udev->bus, 0); in usbd_start_set_config()