Lines Matching refs:bus

187 		 * has changed status. Notify the bus
191 usb_needs_explore(sc->sc_udev->bus, 0);
235 USB_BUS_UNLOCK(udev->bus);
241 USB_BUS_LOCK(udev->bus);
281 USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
312 (void)usb_proc_msignal(USB_BUS_TT_PROC(udev->bus),
335 USB_BUS_LOCK(udev->bus);
352 USB_BUS_UNLOCK(udev->bus);
357 USB_BUS_UNLOCK(udev->bus);
396 child = usb_bus_port_get_device(udev->bus, up);
501 struct usb_bus *bus;
506 bus = sc->sc_udev->bus;
509 /* get driver added refcount from USB bus */
510 refcount = bus->driver_added_refcount;
513 child = usb_bus_port_get_device(bus, up);
669 child = usb_bus_port_get_device(udev->bus,
875 child = usb_alloc_device(sc->sc_dev, udev->bus, udev,
945 child = usb_bus_port_get_device(udev->bus,
1019 uhub_root_intr(struct usb_bus *bus, const uint8_t *ptr, uint8_t len)
1021 USB_BUS_LOCK_ASSERT(bus, MA_OWNED);
1023 usb_needs_explore(bus, 0);
1303 "bus powered HUB. HUB ignored\n");
1476 * These are the events on the bus when a hub is attached:
1558 if (udev->parent_hub == NULL) { /* parent is bus */
1581 removable, udev->flags.self_powered ? "self" : "bus");
1616 struct usb_bus *bus;
1627 bus = sc->sc_udev->bus;
1645 child = usb_bus_port_get_device(bus, hub->ports + x);
1659 USB_BUS_LOCK(bus);
1660 usb_proc_mwait(USB_BUS_TT_PROC(bus),
1662 USB_BUS_UNLOCK(bus);
1715 udev = usb_bus_port_get_device(hub->hubudev->bus,
1765 (void)snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u",
1766 device_get_unit(res.udev->bus->bdev),
1927 struct usb_bus *bus = udev->bus;
1932 USB_BUS_LOCK_ASSERT(bus, MA_OWNED);
1957 bus->uframe_usage[x] += len;
1963 slot = usb_intr_find_best_slot(bus->uframe_usage, 0,
1968 bus->uframe_usage[x] += len;
2111 usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr)
2115 USB_BUS_LOCK_ASSERT(bus, MA_OWNED);
2117 rem = bus->isoc_time_last & (USB_ISOC_TIME_MAX - 1);
2123 bus->isoc_time_last += USB_ISOC_TIME_MAX;
2127 bus->isoc_time_last &= ~(USB_ISOC_TIME_MAX - 1);
2128 bus->isoc_time_last |= isoc_time_curr;
2130 return (bus->isoc_time_last);
2149 struct usb_bus *bus;
2159 bus = isoc_xfer->xroot->bus;
2161 TAILQ_FOREACH(xfer, &bus->intr_q.head, wait_entry) {
2267 usb_bus_port_get_device(struct usb_bus *bus, struct usb_port *up)
2269 if ((bus == NULL) || (up == NULL)) {
2277 return (bus->devices[up->device_index]);
2286 usb_bus_port_set_device(struct usb_bus *bus, struct usb_port *up,
2289 if (bus == NULL) {
2312 bus->devices[device_index] = udev;
2320 DPRINTFN(2, "bus %p devices[%u] = %p\n", bus, device_index, udev);
2324 struct usb_bus *bus;
2337 struct usb_bus *bus;
2344 bus = arg->bus;
2347 if (bus == NULL) {
2348 DPRINTF("No bus pointer!\n");
2351 if ((bus->devices == NULL) ||
2352 (bus->devices[USB_ROOT_HUB_ADDR] == NULL)) {
2356 if (mtx_owned(&bus->bus_mtx)) {
2359 USB_BUS_LOCK(bus);
2363 bus->do_probe = 1;
2365 if (usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus),
2366 &bus->explore_msg[0], &bus->explore_msg[1])) {
2370 USB_BUS_UNLOCK(bus);
2378 usb_needs_explore(struct usb_bus *bus, uint8_t do_probe)
2383 data->bus = bus;
2403 struct usb_bus *bus;
2422 bus = device_get_softc(dev);
2423 if (bus) {
2424 usb_needs_explore(bus, 1);
2434 * This function will ensure that all USB devices on the given bus are
2440 usb_bus_power_update(struct usb_bus *bus)
2443 usb_needs_explore(bus, 0 /* no probe */ );
2476 USB_BUS_LOCK(udev->bus);
2504 if (!(udev->bus->hw_power_state & power_mask[xfer_type])) {
2506 udev->bus->hw_power_state |= power_mask[xfer_type];
2516 USB_BUS_UNLOCK(udev->bus);
2520 usb_bus_power_update(udev->bus);
2523 if (udev->bus->methods->set_hw_power != NULL) {
2524 (udev->bus->methods->set_hw_power) (udev->bus);
2540 (udev->driver_added_refcount != udev->bus->driver_added_refcount) ||
2557 usb_bus_powerd(struct usb_bus *bus)
2574 DPRINTF("bus=%p\n", bus);
2576 USB_BUS_LOCK(bus);
2583 x != bus->devices_max; x++) {
2584 udev = bus->devices[x];
2593 USB_BUS_UNLOCK(bus);
2595 USB_BUS_LOCK(bus);
2602 USB_BUS_UNLOCK(bus);
2604 USB_BUS_LOCK(bus);
2620 x != bus->devices_max; x++) {
2621 udev = bus->devices[x];
2633 * bus:
2649 bus->hw_power_state = 0;
2651 bus->hw_power_state |= USB_HW_POWER_CONTROL;
2653 bus->hw_power_state |= USB_HW_POWER_BULK;
2655 bus->hw_power_state |= USB_HW_POWER_INTERRUPT;
2657 bus->hw_power_state |= USB_HW_POWER_ISOC;
2659 bus->hw_power_state |= USB_HW_POWER_NON_ROOT_HUB;
2661 USB_BUS_UNLOCK(bus);
2663 if (bus->methods->set_hw_power != NULL) {
2665 (bus->methods->set_hw_power) (bus);
2724 struct usb_bus *bus;
2750 /* get bus pointer */
2751 bus = udev->bus;
2777 if (bus->methods->device_resume != NULL) {
2779 (bus->methods->device_resume) (udev);
2781 USB_BUS_LOCK(bus);
2790 bus->hw_power_state |= USB_HW_POWER_CONTROL;
2792 bus->hw_power_state |= USB_HW_POWER_BULK;
2794 bus->hw_power_state |= USB_HW_POWER_INTERRUPT;
2796 bus->hw_power_state |= USB_HW_POWER_ISOC;
2798 USB_BUS_UNLOCK(bus);
2800 if (bus->methods->set_hw_power != NULL) {
2802 (bus->methods->set_hw_power) (bus);
2860 child = usb_bus_port_get_device(udev->bus,
2889 if (udev->bus == NULL)
2892 USB_BUS_LOCK(udev->bus);
2906 USB_BUS_UNLOCK(udev->bus);
2947 if (udev->bus->methods->device_suspend != NULL) {
2950 (udev->bus->methods->device_suspend) (udev);
2999 usb_bus_power_update(udev->bus);
3001 usb_needs_explore(udev->bus, 0 /* no probe */ );
3015 mtod = udev->bus->methods;
3041 usb_needs_explore(udev->bus, 0);
3062 usb_needs_explore(udev->bus, 0);