diff options
author | ananthmg@rediffmail.com <ananthmg@rediffmail.com> | 2004-01-14 22:21:38 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:13:16 -0700 |
commit | 616a7078071362b32a4db73fe3314feb46438258 (patch) | |
tree | e41db664958d69cde4bcc7bcf91a96a1ba8eec78 /libsysfs/libsysfs.h | |
parent | 1782087e4f80fd1d8c4d8bd9a6edeed27414426e (diff) |
[PATCH] libsysfs update for refresh + namedev.c changes
Please find inlined a patch which contains updates to libsysfs
(pre-release) for refresh and also changes to namedev.c to take
advantage of it.
Diffstat (limited to 'libsysfs/libsysfs.h')
-rw-r--r-- | libsysfs/libsysfs.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/libsysfs/libsysfs.h b/libsysfs/libsysfs.h index 2ffe1005cc..10faab92aa 100644 --- a/libsysfs/libsysfs.h +++ b/libsysfs/libsysfs.h @@ -62,18 +62,20 @@ struct sysfs_link { }; struct sysfs_directory { + unsigned char name[SYSFS_NAME_LEN]; + unsigned char path[SYSFS_PATH_MAX]; + + /* Private: for internal use only */ struct dlist *subdirs; struct dlist *links; struct dlist *attributes; - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; }; struct sysfs_driver { unsigned char name[SYSFS_NAME_LEN]; unsigned char path[SYSFS_PATH_MAX]; - /* for internal use only */ + /* Private: for internal use only */ struct dlist *devices; struct sysfs_directory *directory; }; @@ -85,7 +87,7 @@ struct sysfs_device { unsigned char driver_name[SYSFS_NAME_LEN]; unsigned char path[SYSFS_PATH_MAX]; - /* for internal use only */ + /* Private: for internal use only */ struct sysfs_device *parent; struct dlist *children; struct sysfs_directory *directory; @@ -95,7 +97,7 @@ struct sysfs_root_device { unsigned char name[SYSFS_NAME_LEN]; unsigned char path[SYSFS_PATH_MAX]; - /* for internal use only */ + /* Private: for internal use only */ struct dlist *devices; struct sysfs_directory *directory; }; @@ -104,7 +106,7 @@ struct sysfs_bus { unsigned char name[SYSFS_NAME_LEN]; unsigned char path[SYSFS_PATH_MAX]; - /* internal use only */ + /* Private: for internal use only */ struct dlist *drivers; struct dlist *devices; struct sysfs_directory *directory; @@ -115,7 +117,7 @@ struct sysfs_class_device { unsigned char classname[SYSFS_NAME_LEN]; unsigned char path[SYSFS_PATH_MAX]; - /* for internal use only */ + /* Private: for internal use only */ struct sysfs_class_device *parent; struct sysfs_device *sysdevice; /* NULL if virtual */ struct sysfs_driver *driver; /* NULL if not implemented */ @@ -126,7 +128,7 @@ struct sysfs_class { unsigned char name[SYSFS_NAME_LEN]; unsigned char path[SYSFS_PATH_MAX]; - /* for internal use only */ + /* Private: for internal use only */ struct dlist *devices; struct sysfs_directory *directory; }; @@ -138,8 +140,8 @@ extern "C" { /* * Function Prototypes */ -extern int sysfs_trailing_slash(unsigned char *path); extern int sysfs_get_mnt_path(unsigned char *mnt_path, size_t len); +extern int sysfs_remove_trailing_slash(unsigned char *path); extern int sysfs_get_name_from_path(const unsigned char *path, unsigned char *name, size_t len); extern int sysfs_path_is_dir(const unsigned char *path); @@ -161,7 +163,9 @@ extern int sysfs_write_attribute(struct sysfs_attribute *sysattr, const unsigned char *new_value, size_t len); extern unsigned char *sysfs_get_value_from_attributes(struct dlist *attr, const unsigned char * name); -extern int sysfs_refresh_attributes(struct dlist *attrlist); +extern int sysfs_refresh_dir_attributes(struct sysfs_directory *sysdir); +extern int sysfs_refresh_dir_links(struct sysfs_directory *sysdir); +extern int sysfs_refresh_dir_subdirs(struct sysfs_directory *sysdir); extern void sysfs_close_directory(struct sysfs_directory *sysdir); extern struct sysfs_directory *sysfs_open_directory(const unsigned char *path); extern int sysfs_read_dir_attributes(struct sysfs_directory *sysdir); @@ -179,6 +183,9 @@ extern struct sysfs_link *sysfs_get_subdirectory_link (struct sysfs_directory *dir, unsigned char *linkname); extern struct sysfs_attribute *sysfs_get_directory_attribute (struct sysfs_directory *dir, unsigned char *attrname); +extern struct dlist *sysfs_get_dir_attributes(struct sysfs_directory *dir); +extern struct dlist *sysfs_get_dir_links(struct sysfs_directory *dir); +extern struct dlist *sysfs_get_dir_subdirs(struct sysfs_directory *dir); /* sysfs driver access */ extern void sysfs_close_driver(struct sysfs_driver *driver); @@ -189,9 +196,12 @@ extern struct sysfs_attribute *sysfs_get_driver_attr (struct sysfs_driver *drv, const unsigned char *name); extern struct dlist *sysfs_get_driver_attributes(struct sysfs_driver *driver); extern struct dlist *sysfs_get_driver_devices(struct sysfs_driver *driver); +extern struct dlist *sysfs_refresh_driver_devices(struct sysfs_driver *driver); extern struct dlist *sysfs_get_driver_links(struct sysfs_driver *driver); extern struct sysfs_device *sysfs_get_driver_device (struct sysfs_driver *driver, const unsigned char *name); +extern struct dlist *sysfs_refresh_driver_attributes + (struct sysfs_driver *driver); extern struct sysfs_attribute *sysfs_open_driver_attr(const unsigned char *bus, const unsigned char *drv, const unsigned char *attrib); @@ -205,9 +215,12 @@ extern struct sysfs_device *sysfs_open_device (const unsigned char *bus_id, const unsigned char *bus); extern struct sysfs_device *sysfs_get_device_parent(struct sysfs_device *dev); extern struct sysfs_device *sysfs_open_device_path(const unsigned char *path); +extern int sysfs_get_device_bus(struct sysfs_device *dev); extern struct sysfs_attribute *sysfs_get_device_attr (struct sysfs_device *dev, const unsigned char *name); extern struct dlist *sysfs_get_device_attributes(struct sysfs_device *device); +extern struct dlist *sysfs_refresh_device_attributes + (struct sysfs_device *device); extern struct sysfs_attribute *sysfs_open_device_attr(const unsigned char *bus, const unsigned char *bus_id, const unsigned char *attrib); @@ -221,6 +234,7 @@ extern struct sysfs_driver *sysfs_get_bus_driver(struct sysfs_bus *bus, extern struct dlist *sysfs_get_bus_drivers(struct sysfs_bus *bus); extern struct dlist *sysfs_get_bus_devices(struct sysfs_bus *bus); extern struct dlist *sysfs_get_bus_attributes(struct sysfs_bus *bus); +extern struct dlist *sysfs_refresh_bus_attributes(struct sysfs_bus *bus); extern struct sysfs_attribute *sysfs_get_bus_attribute(struct sysfs_bus *bus, unsigned char *attrname); extern struct sysfs_device *sysfs_open_bus_device(unsigned char *busname, @@ -247,6 +261,8 @@ extern struct sysfs_class_device *sysfs_get_class_device (struct sysfs_class *class, unsigned char *name); extern struct dlist *sysfs_get_classdev_attributes (struct sysfs_class_device *cdev); +extern struct dlist *sysfs_refresh_classdev_attributes + (struct sysfs_class_device *cdev); extern struct sysfs_attribute *sysfs_get_classdev_attr (struct sysfs_class_device *clsdev, const unsigned char *name); extern struct sysfs_attribute *sysfs_open_classdev_attr |