4 # Linux 2.6 Device Driver Model
6 * Design and Implementation by GregKH
12 * A way to communicate with device
13 * Interface between Linux and hardware
14 * May allow hotplug of devices
26 * A view of the device
27 * Interface between Linux and user space software
28 * The interface may use character devices and/or sysfs or other interfaces
29 * Specific interface classes:
42 * Implement the communication with the hardware, usually through a bus
43 * Present a view of the device, communicating with user space
44 * Basically, links the bus and the class for a given device model (or a family)
48 * An object representing a device in the bus or a class device
49 * Establishes an hierarchy through the parent link
50 * A class device usually has a device in the bus as its parent
61 * class\\_create(owner, name)
62 * class\\_destroy(class)
63 * class\\_register(class)
64 * class\\_unregister(class)
76 * device\\_initialize(dev)
79 * dev\\_set\\_name(dev, fmt, ...)
80 * dev\\_set\\_drvdata(dev, drvdata)
81 * dev\\_get\\_drvdata(dev)
83 # Devices API (cont...)
87 * device\\_register(dev)
88 * device\\_unregister(dev)
89 * device\\_create(class, parent, devt, drvdata, fmt, ...)
90 * device\\_destroy(class, devt)
94 * struct device\\_attribute
100 * ssize\\_t show(dev, attr, char *buf)
101 * ssize\\_t store(dev, attr, char *buf, size\\_t count)
109 * device\\_create\\_file(dev, attr)
110 * device\\_remove\\_file(dev, attr)
115 * char *devnode(dev, mode\\_t *)
126 * Buses usually implement their API to create bus drivers
127 * The bus API is what should be used most of the time
141 * struct device\\_driver
148 * driver\\_unregister
153 * struct pci\\_driver
158 * pci\\_register\\_driver(driver)
159 * pci\\_unregister\\_driver(driver)
161 # PCI IDs and device matching
163 * struct pci\\_device\\_id
164 * DEFINE\\_PCI\\_DEVICE\\_TABLE
166 * PCI\\_DEVICE\\_CLASS
167 * struct pci\\_device\\_id