1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct usb_device_driver</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-struct-usb-driver.html" title="struct usb_driver"><link rel="next" href="API-struct-usb-class-driver.html" title="struct usb_class_driver"></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">struct usb_device_driver</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-usb-driver.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-struct-usb-class-driver.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-usb-device-driver"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct usb_device_driver &#8212; 
2     identifies USB device driver to usbcore
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct usb_device_driver {
5  const char * name;
6  int (* probe) (struct usb_device *udev);
7  void (* disconnect) (struct usb_device *udev);
8  int (* suspend) (struct usb_device *udev, pm_message_t message);
9  int (* resume) (struct usb_device *udev, pm_message_t message);
10  struct usbdrv_wrap drvwrap;
11  unsigned int supports_autosuspend:1;
12};  </pre></div><div class="refsect1"><a name="idp1115789380"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">name</span></dt><dd><p>
13   The driver name should be unique among USB drivers,
14   and should normally be the same as the module name.
15      </p></dd><dt><span class="term">probe</span></dt><dd><p>
16   Called to see if the driver is willing to manage a particular
17   device.  If it is, probe returns zero and uses <code class="function">dev_set_drvdata</code>
18   to associate driver-specific data with the device.  If unwilling
19   to manage the device, return a negative errno value.
20      </p></dd><dt><span class="term">disconnect</span></dt><dd><p>
21   Called when the device is no longer accessible, usually
22   because it has been (or is being) disconnected or the driver's
23   module is being unloaded.
24      </p></dd><dt><span class="term">suspend</span></dt><dd><p>
25   Called when the device is going to be suspended by the system.
26      </p></dd><dt><span class="term">resume</span></dt><dd><p>
27   Called when the device is being resumed by the system.
28      </p></dd><dt><span class="term">drvwrap</span></dt><dd><p>
29   Driver-model core structure wrapper.
30      </p></dd><dt><span class="term">supports_autosuspend</span></dt><dd><p>
31   if set to 0, the USB core will not allow autosuspend
32   for devices bound to this driver.
33      </p></dd></dl></div></div><div class="refsect1"><a name="idp1115795628"></a><h2>Description</h2><p>
34   USB drivers must provide all the fields listed above except drvwrap.
35</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-usb-driver.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-struct-usb-class-driver.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct usb_driver</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">struct usb_class_driver</span></td></tr></table></div></body></html>
36