1USB_MAKE_PATH(9) Host-Side Data Types and Macro USB_MAKE_PATH(9)
2
3
4
6 usb_make_path - returns stable device path in the usb tree
7
9 int usb_make_path(struct usb_device * dev, char * buf, size_t size);
10
12 dev
13 the device whose path is being constructed
14
15 buf
16 where to put the string
17
18 size
19 how big is “buf”?
20
22 Length of the string (> 0) or negative if size was too small.
23
25 This identifier is intended to be “stable”, reflecting physical paths
26 in hardware such as physical bus addresses for host controllers or
27 ports on USB hubs. That makes it stay the same until systems are
28 physically reconfigured, by re-cabling a tree of USB devices or by
29 moving USB host controllers. Adding and removing devices, including
30 virtual root hubs in host controller driver modules, does not change
31 these path identifiers; neither does rebooting or re-enumerating. These
32 are more useful identifiers than changeable (“unstable”) ones like bus
33 numbers or device addresses.
34
35 With a partial exception for devices connected to USB 2.0 root hubs,
36 these identifiers are also predictable. So long as the device tree
37 isn't changed, plugging any USB device into a given hub port always
38 gives it the same path. Because of the use of “companion” controllers,
39 devices connected to ports on USB 2.0 root hubs (EHCI host controllers)
40 will get one path ID if they are high speed, and a different one if
41 they are full or low speed.
42
44Kernel Hackers Manual 3.10 June 2019 USB_MAKE_PATH(9)