freebsd-nq/sys/dev/usb
Ian Lepore bac5ec96f4 Add common support functions for USB devices configured via FDT data.
FDT data is sometimes used to configure usb devices which are hardwired into
an embedded system. Because the devices are instantiated by the usb
enumeration process rather than by ofwbus iterating through the fdt data, it
is somewhat difficult for a usb driver to locate fdt data that belongs to
it. In the past, various ad-hoc methods have been used, which can lead to
errors such applying configuration that should apply only to a hardwired
device onto a similar device attached by the user at runtime. For example,
if the user adds an ethernet device that uses the same driver as the builtin
ethernet, both devices might end up with the same MAC address.

These changes add a new usb_fdt_get_node() helper function that a driver can
use to locate FDT data that belongs to a single unique instance of the
device. This function locates the proper FDT data using the mechanism
detailed in the standard "usb-device.txt" binding document [1].

There is also a new usb_fdt_get_mac_addr() function, used to retrieve the
mac address for a given device instance from the fdt data. It uses
usb_fdt_get_node() to locate the right node in the FDT data, and attempts to
obtain the mac-address or local-mac-address property (in that order, the
same as linux does it).

The existing if_smsc driver is modified to use the new functions, both as an
example and for testing the new functions. Rpi and rpi2 boards use this
driver and provide the mac address via the fdt data.

[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/usb/usb-device.txt

Differential Revision:	https://reviews.freebsd.org/D20262
2019-05-19 16:56:59 +00:00
..
controller Add support for USB 3.0 XHCI via ACPI 2019-05-08 15:42:39 +00:00
gadget
input wmt(4): Add PNP record so it could be picked by devd/devmatch. 2018-11-10 22:14:09 +00:00
misc
net Add common support functions for USB devices configured via FDT data. 2019-05-19 16:56:59 +00:00
quirk Add new USB quirk. 2019-02-22 21:57:27 +00:00
serial Added support for formula-based arbitrary baud rates, in contrast to 2018-10-22 11:58:30 +00:00
storage
template
video
wlan urtw(4), otus(4), iwi(4): allow to set non-default MAC address via ifconfig(8) 2019-04-10 08:17:56 +00:00
ufm_ioctl.h
uftdiio.h
uled_ioctl.h
usb_bus.h
usb_busdma.c
usb_busdma.h
usb_cdc.h
usb_controller.h
usb_core.c
usb_core.h
usb_debug.c
usb_debug.h
usb_dev.c
usb_dev.h
usb_device.c
usb_device.h
usb_dynamic.c
usb_dynamic.h
usb_endian.h
usb_error.c
usb_fdt_support.c Add common support functions for USB devices configured via FDT data. 2019-05-19 16:56:59 +00:00
usb_fdt_support.h Add common support functions for USB devices configured via FDT data. 2019-05-19 16:56:59 +00:00
usb_freebsd_loader.h
usb_freebsd.h
usb_generic.c Improve USB generic debug messages. Print process ID and name when opening 2019-01-03 14:27:51 +00:00
usb_generic.h
usb_handle_request.c
usb_hid.c
usb_hub.c Reduce timeout for reading the USB HUB port status to 1000ms and try to filter 2019-01-04 21:09:38 +00:00
usb_hub.h
usb_if.m
usb_ioctl.h
usb_lookup.c
usb_mbuf.c
usb_mbuf.h
usb_msctest.c
usb_msctest.h
usb_parse.c
usb_pci.h
usb_pf.c
usb_pf.h
usb_process.c
usb_process.h
usb_request.c Reduce timeout for reading the USB HUB port status to 1000ms and try to filter 2019-01-04 21:09:38 +00:00
usb_request.h
usb_transfer.c
usb_transfer.h
usb_util.c
usb_util.h
usb.h
usbdevs Add two more products found inside a T480 to usbdevs. 2019-03-09 03:15:09 +00:00
usbdi_util.h
usbdi.h Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
usbhid.h