Lines Matching +full:usb +full:- +full:hub

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
35 #include <dev/usb/usb.h>
36 #include <dev/usb/usbdi.h>
37 #include <dev/usb/usb_process.h>
38 #include <dev/usb/usb_busdma.h>
39 #include <dev/usb/usb_controller.h>
40 #include <dev/usb/usb_bus.h>
41 #include <dev/usb/usb_device.h>
42 #include <dev/usb/usb_freebsd.h>
43 #include <dev/usb/usb_fdt_support.h>
44 #include <dev/usb/net/usb_ethernet.h>
49 * stack ends with the device itself, so add 1 to the max hub nesting depth.
62 * USB device nodes in FDT have a compatible string of "usb" followed by in find_udev_in_children()
64 * in the standard 'reg' property; it is one-based in the FDT data, but in find_udev_in_children()
65 * usb_device.port_index is zero-based. To uniquely identify a device, in find_udev_in_children()
68 snprintf(compat, sizeof(compat), "usb%x,%x", in find_udev_in_children()
69 UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct)); in find_udev_in_children()
76 if (port == (udev->port_index + 1)) in find_udev_in_children()
79 return (-1); in find_udev_in_children()
87 * All-bits-zero and all-bits-one are a couple common cases of what in is_valid_mac_addr()
102 uint8_t mac[sizeof(ue->ue_eaddr)]; in usb_fdt_get_mac_addr()
104 "mac-address", in usb_fdt_get_mac_addr()
105 "local-mac-address" in usb_fdt_get_mac_addr()
108 if ((node = usb_fdt_get_node(ue->ue_dev, ue->ue_udev)) == -1) in usb_fdt_get_mac_addr()
113 memcpy(ue->ue_eaddr, mac, sizeof(ue->ue_eaddr)); in usb_fdt_get_mac_addr()
133 if ((controller_node = ofw_bus_get_node(udev->bus->parent)) == -1) in usb_fdt_get_node()
134 return (-1); in usb_fdt_get_node()
137 * Walk up the usb hub ancestor hierarchy, building a stack of devices in usb_fdt_get_node()
139 * between it and the controller, NOT including the root hub (the FDT in usb_fdt_get_node()
140 * bindings treat the controller and root hub as the same thing). in usb_fdt_get_node()
142 for (ud = udev, idx = 0; ud->parent_hub != NULL; ud = ud->parent_hub) { in usb_fdt_get_node()
154 * within the children of the just-found child for the next-deepest hub. in usb_fdt_get_node()
160 node = find_udev_in_children(node, udev_stack[--idx]); in usb_fdt_get_node()
161 if (idx == 0 || node == -1) in usb_fdt_get_node()