1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>usb_make_path</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux-USB Host Side API"><link rel="up" href="hostside.html" title="Chapter&#160;4.&#160;Host-Side Data Types and Macros"><link rel="prev" href="API-usb-interface-claimed.html" title="usb_interface_claimed"><link rel="next" href="API-USB-DEVICE.html" title="USB_DEVICE"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">usb_make_path</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-interface-claimed.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;4.&#160;Host-Side Data Types and Macros</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-USB-DEVICE.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-usb-make-path"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_make_path &#8212; 
2     returns stable device path in the usb tree
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">usb_make_path </b>(</code></td><td>struct usb_device * <var class="pdparam">dev</var>, </td></tr><tr><td>&#160;</td><td>char * <var class="pdparam">buf</var>, </td></tr><tr><td>&#160;</td><td>size_t <var class="pdparam">size</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1115658788"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p>
4     the device whose path is being constructed
5    </p></dd><dt><span class="term"><em class="parameter"><code>buf</code></em></span></dt><dd><p>
6     where to put the string
7    </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
8     how big is <span class="quote">&#8220;<span class="quote">buf</span>&#8221;</span>?
9    </p></dd></dl></div></div><div class="refsect1"><a name="idp1115662516"></a><h2>Return</h2><p>
10   Length of the string (&gt; 0) or negative if size was too small.
11</p></div><div class="refsect1"><a name="idp1115663292"></a><h2>Note</h2><p>
12   This identifier is intended to be <span class="quote">&#8220;<span class="quote">stable</span>&#8221;</span>, reflecting physical paths in
13   hardware such as physical bus addresses for host controllers or ports on
14   USB hubs.  That makes it stay the same until systems are physically
15   reconfigured, by re-cabling a tree of USB devices or by moving USB host
16   controllers.  Adding and removing devices, including virtual root hubs
17   in host controller driver modules, does not change these path identifiers;
18   neither does rebooting or re-enumerating.  These are more useful identifiers
19   than changeable (<span class="quote">&#8220;<span class="quote">unstable</span>&#8221;</span>) ones like bus numbers or device addresses.
20   </p><p>
21
22   With a partial exception for devices connected to USB 2.0 root hubs, these
23   identifiers are also predictable.  So long as the device tree isn't changed,
24   plugging any USB device into a given hub port always gives it the same path.
25   Because of the use of <span class="quote">&#8220;<span class="quote">companion</span>&#8221;</span> controllers, devices connected to ports on
26   USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are
27   high speed, and a different one if they are full or low speed.
28</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-usb-interface-claimed.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="hostside.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-USB-DEVICE.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_interface_claimed</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">USB_DEVICE</span></td></tr></table></div></body></html>
29