#define SYSFS_NAME_LEN 64
#define SYSFS_BUS_ID_SIZE 32
+/* mount path for sysfs, can be overridden by exporting SYSFS_PATH */
+#define SYSFS_MNT_PATH "/sys"
+
enum sysfs_attribute_method {
SYSFS_METHOD_SHOW = 0x01, /* attr can be read by user */
SYSFS_METHOD_STORE = 0x02, /* attr can be changed by user */
};
-/* NOTE: statically define mnt path for sysfs */
-#define SYSFS_MNT_PATH "/sys"
-
/*
* NOTE:
* 1. We have the statically allocated "name" as the first element of all
(struct sysfs_class_device *clsdev);
extern struct sysfs_device *sysfs_get_classdev_device
(struct sysfs_class_device *clsdev);
+extern void sysfs_close_class(struct sysfs_class *cls);
+extern struct sysfs_class *sysfs_open_class(const char *name);
+extern struct sysfs_class_device *sysfs_get_class_device
+ (struct sysfs_class *cls, const char *name);
+extern struct dlist *sysfs_get_class_devices(struct sysfs_class *cls);
+
+/* generic sysfs bus access */
+extern void sysfs_close_bus(struct sysfs_bus *bus);
+extern struct sysfs_bus *sysfs_open_bus(const char *name);
+extern struct dlist *sysfs_get_bus_devices(struct sysfs_bus *bus);
+extern struct dlist *sysfs_get_bus_drivers(struct sysfs_bus *bus);
+extern struct sysfs_device *sysfs_get_bus_device
+ (struct sysfs_bus *bus, const char *id);
+extern struct sysfs_driver *sysfs_get_bus_driver
+ (struct sysfs_bus *bus, const char *drvname);
/**
* sort_list: sorter function to keep list elements sorted in alphabetical