diff options
| author | Patrick Mochel <mochel@geena.pdx.osdl.net> | 2002-05-27 22:00:25 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@hera.kernel.org> | 2002-05-27 22:00:25 -0700 |
| commit | 1f5bbbe447abdfbce71d4a6c7f4e66ff3626a987 (patch) | |
| tree | 335bbc5e7321f8618ebf4d10d0cab31366ae3bf1 /include | |
| parent | 4c9558f5572f5675122541aa45caf4e93087cdba (diff) | |
| parent | b5c822f3575901576ce1fa43ed959e8e90d7f5c4 (diff) | |
Merge master.kernel.org:/home/mochel/BK/linux-2.5-linus
into geena.pdx.osdl.net:/home/mochel/src/kernel/devel/linux-2.5-linus
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/device.h | 30 | ||||
| -rw-r--r-- | include/linux/driverfs_fs.h | 5 | ||||
| -rw-r--r-- | include/linux/pci.h | 1 |
3 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index ccfd221d5dcd..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 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. |
