summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-05-28 18:54:23 -0700
committerPatrick Mochel <mochel@osdl.org>2002-05-28 18:54:23 -0700
commit21a16f65b95259e28e99eb81977c790e77133ffb (patch)
tree8c7bf46d4cf7f13a5dd32aeb899f957df6ad4adc /include/linux
parent83ca4c7e89ffc8fb30dd05754895dc381e0afbc6 (diff)
parent4b4a837f2b57467de03001bb9003382d1c9a7f18 (diff)
Merge master.kernel.org:/home/mochel/BK/linux-2.5
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-sync
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h31
-rw-r--r--include/linux/pci.h2
2 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 078c65e02370..2ad1e9ff4f75 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -84,17 +84,48 @@ extern void put_bus(struct bus_type * bus);
struct device_driver {
+ char * name;
+ struct bus_type * bus;
+
+ rwlock_t lock;
+ atomic_t refcount;
+
+ list_t bus_list;
+ list_t devices;
+
+ struct driver_dir_entry dir;
+
int (*probe) (struct device * dev);
int (*remove) (struct device * dev, u32 flags);
int (*suspend) (struct device * dev, u32 state, u32 level);
int (*resume) (struct device * dev, u32 level);
+
+ void (*release) (struct device_driver * drv);
};
+
+
+extern int driver_register(struct device_driver * drv);
+
+static inline struct device_driver * get_driver(struct device_driver * drv)
+{
+ BUG_ON(!atomic_read(&drv->refcount));
+ atomic_inc(&drv->refcount);
+ return drv;
+}
+
+extern void put_driver(struct device_driver * drv);
+
+extern int driver_for_each_dev(struct device_driver * drv, void * data,
+ int (*callback)(struct device * dev, void * data));
+
+
struct device {
struct list_head g_list; /* node in depth-first order list */
struct list_head node; /* node in sibling list */
struct list_head bus_list; /* node in bus's list */
+ struct list_head driver_list;
struct list_head children;
struct device * parent;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f6e3a68a2a0d..7cbc68fdb743 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -487,6 +487,8 @@ struct pci_driver {
int (*suspend) (struct pci_dev *dev, u32 state); /* Device suspended */
int (*resume) (struct pci_dev *dev); /* Device woken up */
int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */
+
+ struct device_driver driver;
};