diff options
author | Javier Martinez Canillas <martinez.javier@gmail.com> | 2010-11-27 07:49:17 +0100 |
---|---|---|
committer | Javier Martinez Canillas <martinez.javier@gmail.com> | 2010-11-27 07:49:17 +0100 |
commit | ab121f379a3cff458c90e6f480ba4bb68c8733dd (patch) | |
tree | a9851af109ee83646d108bc247d03b131461b764 /include/lddbus.h | |
download | ldd3-ab121f379a3cff458c90e6f480ba4bb68c8733dd.tar.gz |
Linux Device Drivers 3 examples
Diffstat (limited to 'include/lddbus.h')
-rw-r--r-- | include/lddbus.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/lddbus.h b/include/lddbus.h new file mode 100644 index 0000000..a6b349e --- /dev/null +++ b/include/lddbus.h @@ -0,0 +1,39 @@ +/* + * Definitions for the virtual LDD bus. + * + * $Id: lddbus.h,v 1.4 2004/08/20 18:49:44 corbet Exp $ + */ + +//extern struct device ldd_bus; +extern struct bus_type ldd_bus_type; + + +/* + * The LDD driver type. + */ + +struct ldd_driver { + char *version; + struct module *module; + struct device_driver driver; + struct driver_attribute version_attr; +}; + +#define to_ldd_driver(drv) container_of(drv, struct ldd_driver, driver); + +/* + * A device type for things "plugged" into the LDD bus. + */ + +struct ldd_device { + char *name; + struct ldd_driver *driver; + struct device dev; +}; + +#define to_ldd_device(dev) container_of(dev, struct ldd_device, dev); + +extern int register_ldd_device(struct ldd_device *); +extern void unregister_ldd_device(struct ldd_device *); +extern int register_ldd_driver(struct ldd_driver *); +extern void unregister_ldd_driver(struct ldd_driver *); |