PCI driver.
[cascardo/kernel/slides/.git] / 12dd / dd
diff --git a/12dd/dd b/12dd/dd
index fcc69f5..64a52c3 100644 (file)
--- a/12dd/dd
+++ b/12dd/dd
 * An object representing a device in the bus or a class device
 * Establishes an hierarchy through the parent link
 * A class device usually has a device in the bus as its parent
+
+# API
+
+# Classes
+
+* linux/device.h
+* struct class
+       - name
+       - owner
+       - dev\\_release
+* class\\_create(owner, name)
+* class\\_destroy(class)
+* class\\_register(class)
+* class\\_unregister(class)
+
+# Devices
+
+* struct device
+       - parent
+       - devt
+       - class
+       - release
+
+# Devices API
+
+* device\\_initialize(dev)
+* get\\_device(dev)
+* put\\_device(dev)
+* dev\\_set\\_name(dev, fmt, ...)
+* dev\\_set\\_drvdata(dev, drvdata)
+* dev\\_get\\_drvdata(dev)
+
+# Devices API (cont...)
+
+* device\\_add(dev)
+* device\\_del(dev)
+* device\\_register(dev)
+* device\\_unregister(dev)
+* device\\_create(class, parent, devt, drvdata, fmt, ...)
+* device\\_destroy(class, devt)
+
+# Attributes
+
+* struct device\\_attribute
+       - attr
+               * name
+               * mode
+       - show
+       - store
+* ssize\\_t show(dev, attr, char *buf)
+* ssize\\_t store(dev, attr, char *buf, size\\_t count)
+* sprintf
+* strict\\_strtol
+* strnlen
+
+# Adding attributes
+
+* class.dev\\_attrs
+* device\\_create\\_file(dev, attr)
+* device\\_remove\\_file(dev, attr)
+
+# devtmpfs
+
+* class.devnode
+* char *devnode(dev, mode\\_t *)
+
+# Power Management
+
+* linux/pm.h
+* dev\\_pm\\_ops
+* resume
+* suspend
+
+# Buses and drivers
+
+* Buses usually implement their API to create bus drivers
+* The bus API is what should be used most of the time
+
+# Bus
+
+* struct bus\\_type
+       - name
+       - match
+       - probe
+       - remove
+* bus\\_register
+* bus\\_unregister
+
+# Drivers
+
+* struct device\\_driver
+       - name
+       - bus
+       - owner
+       - probe
+       - remove
+* driver\\_register
+* driver\\_unregister
+
+# PCI
+
+* linux/pci.h
+* struct pci\\_driver
+       - name
+       - id\\_table
+       - probe
+       - remove
+* pci\\_register\\_driver(driver)
+* pci\\_unregister\\_driver(driver)
+
+# PCI IDs and device matching
+
+* struct pci\\_device\\_id
+* DEFINE\\_PCI\\_DEVICE\\_TABLE
+* PCI\\_DEVICE
+* PCI\\_DEVICE\\_CLASS
+* struct pci\\_device\\_id