diff options
| author | Patrick Mochel <mochel@geena.pdx.osdl.net> | 2002-05-27 21:41:15 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@geena.pdx.osdl.net> | 2002-05-27 21:41:15 -0700 |
| commit | 53e61445c225e893b693c84ab85fc5f864c50ad2 (patch) | |
| tree | 44f8e8b3985cd386a6252283a7995aabbab8a447 /include | |
| parent | c43626f4822b7c6183fa864b53d3b39c2180cdae (diff) | |
| parent | 593e7b23881806eaafd6b8819b3b1fc0048eb1a8 (diff) | |
Merge geena.pdx.osdl.net:/home/mochel/src/kernel/devel/linux-2.5-virgin
into geena.pdx.osdl.net:/home/mochel/src/kernel/devel/linux-2.5-sync
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/device.h | 32 | ||||
| -rw-r--r-- | include/linux/driverfs_fs.h | 5 | ||||
| -rw-r--r-- | include/linux/pci.h | 1 |
3 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 96d9cb108139..078c65e02370 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -55,6 +55,34 @@ enum { struct device; + +struct bus_type { + char * name; + rwlock_t lock; + atomic_t refcount; + + list_t node; + list_t devices; + list_t drivers; + + struct driver_dir_entry dir; + struct driver_dir_entry device_dir; + struct driver_dir_entry driver_dir; +}; + + +extern int bus_register(struct bus_type * bus); + +static inline struct bus_type * get_bus(struct bus_type * bus) +{ + BUG_ON(!atomic_read(&bus->refcount)); + atomic_inc(&bus->refcount); + return bus; +} + +extern void put_bus(struct bus_type * bus); + + struct device_driver { int (*probe) (struct device * dev); int (*remove) (struct device * dev, u32 flags); @@ -66,6 +94,7 @@ struct device_driver { 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 children; struct device * parent; @@ -78,6 +107,7 @@ struct device { atomic_t refcount; /* refcount to make sure the device * persists for the right amount of time */ + struct bus_type * bus; /* type of bus device is on */ struct driver_dir_entry dir; struct device_driver *driver; /* which driver has allocated this @@ -92,6 +122,8 @@ struct device { being off. */ unsigned char *saved_state; /* saved device state */ + + void (*release)(struct device * dev); }; static inline struct device * diff --git a/include/linux/driverfs_fs.h b/include/linux/driverfs_fs.h index 48a773dcfb9a..f9cc70450e6b 100644 --- a/include/linux/driverfs_fs.h +++ b/include/linux/driverfs_fs.h @@ -56,6 +56,11 @@ extern int driverfs_create_file(struct driver_file_entry * entry, struct driver_dir_entry * parent); +extern int +driverfs_create_symlink(struct driver_dir_entry * parent, + struct driver_file_entry * entry, + char * target); + extern void driverfs_remove_file(struct driver_dir_entry *, const char * name); diff --git a/include/linux/pci.h b/include/linux/pci.h index d138ba50a678..f6e3a68a2a0d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -439,6 +439,7 @@ struct pci_bus { extern struct list_head pci_root_buses; /* list of all known PCI buses */ extern struct list_head pci_devices; /* list of all devices */ +extern struct bus_type pci_bus_type; /* * Error values that may be returned by PCI functions. |
