'\" t .\" Title: usb_make_path .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Host-Side Data Types and Macros .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "USB_MAKE_PATH" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Host-Side Data Types and Macro" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" usb_make_path \- returns stable device path in the usb tree .SH "SYNOPSIS" .HP \w'int\ usb_make_path('u .BI "int usb_make_path(struct\ usb_device\ *\ " "dev" ", char\ *\ " "buf" ", size_t\ " "size" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 the device whose path is being constructed .RE .PP \fIbuf\fR .RS 4 where to put the string .RE .PP \fIsize\fR .RS 4 how big is \(lqbuf\(rq? .RE .SH "RETURN" .PP Length of the string (> 0) or negative if size was too small\&. .SH "NOTE" .PP This identifier is intended to be \(lqstable\(rq, reflecting physical paths in hardware such as physical bus addresses for host controllers or ports on USB hubs\&. That makes it stay the same until systems are physically reconfigured, by re\-cabling a tree of USB devices or by moving USB host controllers\&. Adding and removing devices, including virtual root hubs in host controller driver modules, does not change these path identifiers; neither does rebooting or re\-enumerating\&. These are more useful identifiers than changeable (\(lqunstable\(rq) ones like bus numbers or device addresses\&. .PP With a partial exception for devices connected to USB 2\&.0 root hubs, these identifiers are also predictable\&. So long as the device tree isn\*(Aqt changed, plugging any USB device into a given hub port always gives it the same path\&. Because of the use of \(lqcompanion\(rq controllers, devices connected to ports on USB 2\&.0 root hubs (EHCI host controllers) will get one path ID if they are high speed, and a different one if they are full or low speed\&. .SH "COPYRIGHT" .br