diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-31 02:42:08 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-31 02:42:08 -0800 |
| commit | 6dc1ec37627d69648bbfdaa460d026ae3f001798 (patch) | |
| tree | 65cda5fbb1c1f3ceb38d4e2125beb434ed9eaf91 /include/linux | |
| parent | 6e6e099b14dbeb1bd7ae1225d9992c482c9f6a78 (diff) | |
| parent | 808897cf48f7328cf5230fafd441be4f5f628c21 (diff) | |
Merge bk://ldm.bkbits.net/linux-2.5-kobject
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device.h | 29 | ||||
| -rw-r--r-- | include/linux/driverfs_fs.h | 68 | ||||
| -rw-r--r-- | include/linux/genhd.h | 6 | ||||
| -rw-r--r-- | include/linux/kobject.h | 4 | ||||
| -rw-r--r-- | include/linux/sysfs.h | 12 |
5 files changed, 25 insertions, 94 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 2e0948e96d68..0bea391871ae 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -28,7 +28,7 @@ #include <linux/ioport.h> #include <linux/list.h> #include <linux/sched.h> -#include <linux/driverfs_fs.h> +#include <linux/kobject.h> #define DEVICE_NAME_SIZE 80 #define DEVICE_ID_SIZE 32 @@ -65,14 +65,13 @@ struct bus_type { atomic_t refcount; u32 present; + struct subsystem subsys; + struct subsystem drvsubsys; + struct subsystem devsubsys; struct list_head node; struct list_head devices; struct list_head drivers; - struct driver_dir_entry dir; - struct driver_dir_entry device_dir; - struct driver_dir_entry driver_dir; - int (*match)(struct device * dev, struct device_driver * drv); struct device * (*add) (struct device * parent, char * bus_id); int (*hotplug) (struct device *dev, char **envp, @@ -119,12 +118,11 @@ struct device_driver { atomic_t refcount; u32 present; + struct kobject kobj; struct list_head bus_list; struct list_head class_list; struct list_head devices; - struct driver_dir_entry dir; - int (*probe) (struct device * dev); int (*remove) (struct device * dev); void (*shutdown) (struct device * dev); @@ -177,14 +175,13 @@ struct device_class { u32 devnum; + struct subsystem subsys; + struct subsystem devsubsys; + struct subsystem drvsubsys; struct list_head node; struct list_head drivers; struct list_head intf_list; - struct driver_dir_entry dir; - struct driver_dir_entry driver_dir; - struct driver_dir_entry device_dir; - int (*add_device)(struct device *); void (*remove_device)(struct device *); int (*hotplug)(struct device *dev, char **envp, @@ -232,9 +229,9 @@ struct device_interface { char * name; struct device_class * devclass; + struct kobject kobj; struct list_head node; struct list_head devices; - struct driver_dir_entry dir; u32 devnum; @@ -275,6 +272,7 @@ struct device { struct list_head intf_list; struct device * parent; + struct kobject kobj; char name[DEVICE_NAME_SIZE]; /* descriptive ascii string */ char bus_id[BUS_ID_SIZE]; /* position on parent bus */ @@ -285,8 +283,6 @@ struct 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 device */ void *driver_data; /* data private to the driver */ @@ -438,6 +434,11 @@ extern int device_suspend(u32 state, u32 level); extern void device_resume(u32 level); extern void device_shutdown(void); + +/* drivrs/base/firmware.c */ +extern int firmware_register(struct subsystem *); +extern void firmware_uregister(struct subsystem *); + /* debugging and troubleshooting/diagnostic helpers. */ #ifdef DEBUG #define dev_dbg(dev, format, arg...) \ diff --git a/include/linux/driverfs_fs.h b/include/linux/driverfs_fs.h deleted file mode 100644 index b4270e947a1e..000000000000 --- a/include/linux/driverfs_fs.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * driverfs_fs.h - definitions for the device driver filesystem - * - * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * This is a simple, ram-based filesystem, which allows kernel - * callbacks for read/write of files. - * - * Please see Documentation/filesystems/driverfs.txt for more information. - */ - -#ifndef _DRIVER_FS_H_ -#define _DRIVER_FS_H_ - -struct driver_dir_entry; -struct attribute; - -struct driverfs_ops { - int (*open)(struct driver_dir_entry *); - int (*close)(struct driver_dir_entry *); - ssize_t (*show)(struct driver_dir_entry *, struct attribute *,char *, size_t, loff_t); - ssize_t (*store)(struct driver_dir_entry *,struct attribute *,const char *, size_t, loff_t); -}; - -struct driver_dir_entry { - char * name; - struct dentry * dentry; - mode_t mode; - struct driverfs_ops * ops; -}; - -struct attribute { - char * name; - mode_t mode; -}; - -extern int -driverfs_create_dir(struct driver_dir_entry *, struct driver_dir_entry *); - -extern void -driverfs_remove_dir(struct driver_dir_entry * entry); - -extern int -driverfs_create_file(struct attribute * attr, - struct driver_dir_entry * parent); - -extern int -driverfs_create_symlink(struct driver_dir_entry * parent, - char * name, char * target); - -extern void -driverfs_remove_file(struct driver_dir_entry *, const char * name); - -#endif /* _DDFS_H_ */ diff --git a/include/linux/genhd.h b/include/linux/genhd.h index ff1885251c12..548e477daa4b 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -62,7 +62,7 @@ struct hd_struct { sector_t start_sect; sector_t nr_sects; devfs_handle_t de; /* primary (master) devfs entry */ - struct device *hd_driverfs_dev; /* support driverfs hiearchy */ + struct kobject kobj; unsigned reads, read_sectors, writes, write_sectors; int policy; }; @@ -93,7 +93,7 @@ struct gendisk { devfs_handle_t de; /* more of the same */ devfs_handle_t disk_de; /* piled higher and deeper */ struct device *driverfs_dev; - struct device disk_dev; + struct kobject kobj; struct timer_rand_state *random; int policy; @@ -130,8 +130,6 @@ static inline void set_capacity(struct gendisk *disk, sector_t size) disk->capacity = size; } -extern struct device_class disk_devclass; - #endif /* __KERNEL__ */ #ifdef CONFIG_SOLARIS_X86_PARTITION diff --git a/include/linux/kobject.h b/include/linux/kobject.h index d2f0629a6189..40de16d0a227 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -12,8 +12,10 @@ #include <linux/rwsem.h> #include <asm/atomic.h> +#define KOBJ_NAME_LEN 16 + struct kobject { - char name[16]; + char name[KOBJ_NAME_LEN]; atomic_t refcount; struct list_head entry; struct kobject * parent; diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 7a46c9f0c308..29c3eb8d2c9e 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -9,20 +9,18 @@ #ifndef _SYSFS_H_ #define _SYSFS_H_ -struct driver_dir_entry; -struct attribute; struct kobject; -struct sysfs_ops { - ssize_t (*show)(struct kobject *, struct attribute *,char *, size_t, loff_t); - ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t, loff_t); -}; - struct attribute { char * name; mode_t mode; }; +struct sysfs_ops { + ssize_t (*show)(struct kobject *, struct attribute *,char *, size_t, loff_t); + ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t, loff_t); +}; + extern int sysfs_create_dir(struct kobject *); |
