1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>usb_reset_device</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="usbcore.html" title="Chapter 5. USB Core APIs"><link rel="prev" href="API-usb-root-hub-lost-power.html" title="usb_root_hub_lost_power"><link rel="next" href="API-usb-queue-reset-device.html" title="usb_queue_reset_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_reset_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-root-hub-lost-power.html">Prev</a> </td><th width="60%" align="center">Chapter 5. USB Core APIs</th><td width="20%" align="right"> <a accesskey="n" href="API-usb-queue-reset-device.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-usb-reset-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_reset_device — 2 warn interface drivers and perform a USB port reset 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_reset_device </b>(</code></td><td>struct usb_device * <var class="pdparam">udev</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1116678300"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>udev</code></em></span></dt><dd><p> 4 device to reset (not in SUSPENDED or NOTATTACHED state) 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1116679948"></a><h2>Description</h2><p> 6 Warns all drivers bound to registered interfaces (using their pre_reset 7 method), performs the port reset, and then lets the drivers know that 8 the reset is over (using their post_reset method). 9</p></div><div class="refsect1"><a name="idp1116680748"></a><h2>Return</h2><p> 10 The same as for <code class="function">usb_reset_and_verify_device</code>. 11</p></div><div class="refsect1"><a name="idp1116681732"></a><h2>Note</h2><p> 12 The caller must own the device lock. For example, it's safe to use 13 this from a driver <code class="function">probe</code> routine after downloading new firmware. 14 For calls that might not occur during <code class="function">probe</code>, drivers should lock 15 the device using <code class="function">usb_lock_device_for_reset</code>. 16 </p><p> 17 18 If an interface is currently being probed or disconnected, we assume 19 its driver knows how to handle resets. For all other interfaces, 20 if the driver doesn't have pre_reset and post_reset methods then 21 we attempt to unbind it and rebind afterward. 22</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-root-hub-lost-power.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="usbcore.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-usb-queue-reset-device.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_root_hub_lost_power</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">usb_queue_reset_device</span></td></tr></table></div></body></html> 23