summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-12-04 17:54:13 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-12-04 17:54:13 -0800
commitff7b031902e38acaf56f8ae6119c09db8ba1761d (patch)
treefa61d3031abc9fd3d8bc9a91700bd36e33b41751 /include/linux
parent4ab5d76b5731e7ab938694b5c55e6d87a6e98d01 (diff)
parent3642fd58627578bc58a7108d3d2e00d2f750b6a6 (diff)
Merge bk://ldm.bkbits.net/linux-2.5-core
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h26
-rw-r--r--include/linux/kobject.h9
2 files changed, 24 insertions, 11 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index a88c4c7a3433..48612267bd65 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -85,6 +85,15 @@ extern struct bus_type * get_bus(struct bus_type * bus);
extern void put_bus(struct bus_type * bus);
+/* iterator helpers for buses */
+
+int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
+ int (*fn)(struct device *, void *));
+
+int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
+ void * data, int (*fn)(struct device_driver *, void *));
+
+
/* driverfs interface for exporting bus attributes */
struct bus_attribute {
@@ -159,6 +168,7 @@ struct device_class {
struct subsystem devsubsys;
struct subsystem drvsubsys;
struct list_head drivers;
+ struct list_head devices;
int (*add_device)(struct device *);
void (*remove_device)(struct device *);
@@ -207,9 +217,7 @@ struct device_interface {
char * name;
struct device_class * devclass;
- struct kobject kobj;
- struct list_head devices;
-
+ struct subsystem subsys;
u32 devnum;
int (*add_device) (struct device *);
@@ -230,10 +238,11 @@ extern void interface_unregister(struct device_interface *);
* and create a driverfs symlink for it.
*/
struct intf_data {
- struct list_head node;
struct device_interface * intf;
struct device * dev;
u32 intf_num;
+ struct list_head dev_entry;
+ struct kobject kobj;
};
extern int interface_add_data(struct intf_data *);
@@ -241,9 +250,9 @@ extern int interface_add_data(struct intf_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 class_list;
struct list_head driver_list;
struct list_head children;
struct list_head intf_list;
@@ -270,6 +279,7 @@ struct device {
being off. */
unsigned char *saved_state; /* saved device state */
+ u64 *dma_mask; /* dma mask (if dma'able device) */
void (*release)(struct device * dev);
};
@@ -280,12 +290,6 @@ list_to_dev(struct list_head *node)
return list_entry(node, struct device, node);
}
-static inline struct device *
-g_list_to_dev(struct list_head *g_list)
-{
- return list_entry(g_list, struct device, g_list);
-}
-
static inline void *
dev_get_drvdata (struct device *dev)
{
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 7b3157a78f7e..6b528c5a61cb 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -60,4 +60,13 @@ static inline void subsys_put(struct subsystem * s)
kobject_put(&s->kobj);
}
+struct subsys_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct subsystem *, char *, size_t, loff_t);
+ ssize_t (*store)(struct subsystem *, const char *, size_t, loff_t);
+};
+
+extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
+extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
+
#endif /* _KOBJECT_H_ */