1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct device_driver</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="devdrivers.html#idp1109043876" title="The Basic Device Driver-Model Structures"><link rel="prev" href="API-struct-bus-type.html" title="struct bus_type"><link rel="next" href="API-struct-subsys-interface.html" title="struct subsys_interface"></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 device_driver</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-bus-type.html">Prev</a> </td><th width="60%" align="center">The Basic Device Driver-Model Structures </th><td width="20%" align="right"> <a accesskey="n" href="API-struct-subsys-interface.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-device-driver"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct device_driver — 2 The basic device driver structure 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct device_driver { 5 const char * name; 6 struct bus_type * bus; 7 struct module * owner; 8 const char * mod_name; 9 bool suppress_bind_attrs; 10 const struct of_device_id * of_match_table; 11 const struct acpi_device_id * acpi_match_table; 12 int (* probe) (struct device *dev); 13 int (* remove) (struct device *dev); 14 void (* shutdown) (struct device *dev); 15 int (* suspend) (struct device *dev, pm_message_t state); 16 int (* resume) (struct device *dev); 17 const struct attribute_group ** groups; 18 const struct dev_pm_ops * pm; 19 struct driver_private * p; 20}; </pre></div><div class="refsect1"><a name="idp1103616188"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">name</span></dt><dd><p> 21 Name of the device driver. 22 </p></dd><dt><span class="term">bus</span></dt><dd><p> 23 The bus which the device of this driver belongs to. 24 </p></dd><dt><span class="term">owner</span></dt><dd><p> 25 The module owner. 26 </p></dd><dt><span class="term">mod_name</span></dt><dd><p> 27 Used for built-in modules. 28 </p></dd><dt><span class="term">suppress_bind_attrs</span></dt><dd><p> 29 Disables bind/unbind via sysfs. 30 </p></dd><dt><span class="term">of_match_table</span></dt><dd><p> 31 The open firmware table. 32 </p></dd><dt><span class="term">acpi_match_table</span></dt><dd><p> 33 The ACPI match table. 34 </p></dd><dt><span class="term">probe</span></dt><dd><p> 35 Called to query the existence of a specific device, 36 whether this driver can work with it, and bind the driver 37 to a specific device. 38 </p></dd><dt><span class="term">remove</span></dt><dd><p> 39 Called when the device is removed from the system to 40 unbind a device from this driver. 41 </p></dd><dt><span class="term">shutdown</span></dt><dd><p> 42 Called at shut-down time to quiesce the device. 43 </p></dd><dt><span class="term">suspend</span></dt><dd><p> 44 Called to put the device to sleep mode. Usually to a 45 low power state. 46 </p></dd><dt><span class="term">resume</span></dt><dd><p> 47 Called to bring a device from sleep mode. 48 </p></dd><dt><span class="term">groups</span></dt><dd><p> 49 Default attributes that get created by the driver core 50 automatically. 51 </p></dd><dt><span class="term">pm</span></dt><dd><p> 52 Power management operations of the device which matched 53 this driver. 54 </p></dd><dt><span class="term">p</span></dt><dd><p> 55 Driver core's private data, no one other than the driver 56 core can touch this. 57 </p></dd></dl></div></div><div class="refsect1"><a name="idp1109090004"></a><h2>Description</h2><p> 58 The device driver-model tracks all of the drivers known to the system. 59 The main reason for this tracking is to enable the driver core to match 60 up drivers with new devices. Once drivers are known objects within the 61 system, however, a number of other things become possible. Device drivers 62 can export information and configuration variables that are independent 63 of any specific device. 64</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-bus-type.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="devdrivers.html#idp1109043876">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-subsys-interface.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct bus_type</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">struct subsys_interface</span></td></tr></table></div></body></html> 65