2 * sysfs.h - definitions for the device driver filesystem
4 * Copyright (c) 2001,2002 Patrick Mochel
6 * Please see Documentation/filesystems/sysfs.txt for more information.
17 struct module * owner;
21 struct attribute_group {
23 struct attribute ** attrs;
27 struct bin_attribute {
28 struct attribute attr;
30 ssize_t (*read)(struct kobject *, char *, loff_t, size_t);
31 ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
35 ssize_t (*show)(struct kobject *, struct attribute *,char *);
36 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
42 sysfs_create_dir(struct kobject *);
45 sysfs_remove_dir(struct kobject *);
48 sysfs_rename_dir(struct kobject *, const char *new_name);
51 sysfs_create_file(struct kobject *, const struct attribute *);
54 sysfs_update_file(struct kobject *, const struct attribute *);
57 sysfs_remove_file(struct kobject *, const struct attribute *);
60 sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name);
63 sysfs_remove_link(struct kobject *, char * name);
65 int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
66 int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
68 int sysfs_create_group(struct kobject *, const struct attribute_group *);
69 void sysfs_remove_group(struct kobject *, const struct attribute_group *);
71 #else /* CONFIG_SYSFS */
73 static inline int sysfs_create_dir(struct kobject * k)
78 static inline void sysfs_remove_dir(struct kobject * k)
83 static inline void sysfs_rename_dir(struct kobject * k, const char *new_name)
88 static inline int sysfs_create_file(struct kobject * k, const struct attribute * a)
93 static inline int sysfs_update_file(struct kobject * k, const struct attribute * a)
98 static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a)
103 static inline int sysfs_create_link(struct kobject * k, struct kobject * t, char * n)
108 static inline void sysfs_remove_link(struct kobject * k, char * name)
114 static inline int sysfs_create_bin_file(struct kobject * k, struct bin_attribute * a)
119 static inline int sysfs_remove_bin_file(struct kobject * k, struct bin_attribute * a)
124 static inline int sysfs_create_group(struct kobject * k, const struct attribute_group *g)
129 static inline void sysfs_remove_group(struct kobject * k, const struct attribute_group * g)
134 #endif /* CONFIG_SYSFS */
136 #endif /* _SYSFS_H_ */