aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h127
1 files changed, 57 insertions, 70 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index c16e4c511621..b393bb449624 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -23,14 +23,14 @@ struct module;
23 * until the tree gets cleaned up fully. 23 * until the tree gets cleaned up fully.
24 */ 24 */
25struct attribute { 25struct attribute {
26 const char * name; 26 const char *name;
27 struct module * owner; 27 struct module *owner;
28 mode_t mode; 28 mode_t mode;
29}; 29};
30 30
31struct attribute_group { 31struct attribute_group {
32 const char * name; 32 const char *name;
33 struct attribute ** attrs; 33 struct attribute **attrs;
34}; 34};
35 35
36 36
@@ -74,65 +74,43 @@ struct sysfs_ops {
74 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 74 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
75}; 75};
76 76
77#define SYSFS_TYPE_MASK 0x00ff
78#define SYSFS_ROOT 0x0001
79#define SYSFS_DIR 0x0002
80#define SYSFS_KOBJ_ATTR 0x0004
81#define SYSFS_KOBJ_BIN_ATTR 0x0008
82#define SYSFS_KOBJ_LINK 0x0020
83#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
84
85#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
86#define SYSFS_FLAG_REMOVED 0x0100
87
88#ifdef CONFIG_SYSFS 77#ifdef CONFIG_SYSFS
89 78
90extern int sysfs_schedule_callback(struct kobject *kobj, 79int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
91 void (*func)(void *), void *data, struct module *owner); 80 void *data, struct module *owner);
92
93extern int __must_check
94sysfs_create_dir(struct kobject *);
95
96extern void
97sysfs_remove_dir(struct kobject *);
98
99extern int __must_check
100sysfs_rename_dir(struct kobject *kobj, const char *new_name);
101
102extern int __must_check
103sysfs_move_dir(struct kobject *, struct kobject *);
104
105extern int __must_check
106sysfs_create_file(struct kobject *, const struct attribute *);
107
108extern int __must_check
109sysfs_update_file(struct kobject *, const struct attribute *);
110 81
111extern int __must_check 82int __must_check sysfs_create_dir(struct kobject *kobj);
112sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); 83void sysfs_remove_dir(struct kobject *kobj);
84int __must_check sysfs_rename_dir(struct kobject *kobj, const char *new_name);
85int __must_check sysfs_move_dir(struct kobject *kobj,
86 struct kobject *new_parent_kobj);
113 87
114extern void 88int __must_check sysfs_create_file(struct kobject *kobj,
115sysfs_remove_file(struct kobject *, const struct attribute *); 89 const struct attribute *attr);
116 90int __must_check sysfs_update_file(struct kobject *kobj,
117extern int __must_check 91 const struct attribute *attr);
118sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); 92int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr,
119 93 mode_t mode);
120extern void 94void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
121sysfs_remove_link(struct kobject *, const char * name);
122 95
123int __must_check sysfs_create_bin_file(struct kobject *kobj, 96int __must_check sysfs_create_bin_file(struct kobject *kobj,
124 struct bin_attribute *attr); 97 struct bin_attribute *attr);
125void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); 98void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr);
126 99
127int __must_check sysfs_create_group(struct kobject *, 100int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target,
128 const struct attribute_group *); 101 const char *name);
129void sysfs_remove_group(struct kobject *, const struct attribute_group *); 102void sysfs_remove_link(struct kobject *kobj, const char *name);
103
104int __must_check sysfs_create_group(struct kobject *kobj,
105 const struct attribute_group *grp);
106void sysfs_remove_group(struct kobject *kobj,
107 const struct attribute_group *grp);
130int sysfs_add_file_to_group(struct kobject *kobj, 108int sysfs_add_file_to_group(struct kobject *kobj,
131 const struct attribute *attr, const char *group); 109 const struct attribute *attr, const char *group);
132void sysfs_remove_file_from_group(struct kobject *kobj, 110void sysfs_remove_file_from_group(struct kobject *kobj,
133 const struct attribute *attr, const char *group); 111 const struct attribute *attr, const char *group);
134 112
135void sysfs_notify(struct kobject * k, char *dir, char *attr); 113void sysfs_notify(struct kobject *kobj, char *dir, char *attr);
136 114
137extern int __must_check sysfs_init(void); 115extern int __must_check sysfs_init(void);
138 116
@@ -144,72 +122,81 @@ static inline int sysfs_schedule_callback(struct kobject *kobj,
144 return -ENOSYS; 122 return -ENOSYS;
145} 123}
146 124
147static inline int sysfs_create_dir(struct kobject * kobj) 125static inline int sysfs_create_dir(struct kobject *kobj)
148{ 126{
149 return 0; 127 return 0;
150} 128}
151 129
152static inline void sysfs_remove_dir(struct kobject * k) 130static inline void sysfs_remove_dir(struct kobject *kobj)
153{ 131{
154 ; 132 ;
155} 133}
156 134
157static inline int sysfs_rename_dir(struct kobject * kobj, const char *new_name) 135static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
158{ 136{
159 return 0; 137 return 0;
160} 138}
161 139
162static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent) 140static inline int sysfs_move_dir(struct kobject *kobj,
141 struct kobject *new_parent_kobj)
163{ 142{
164 return 0; 143 return 0;
165} 144}
166 145
167static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) 146static inline int sysfs_create_file(struct kobject *kobj,
147 const struct attribute *attr)
168{ 148{
169 return 0; 149 return 0;
170} 150}
171 151
172static inline int sysfs_update_file(struct kobject * k, const struct attribute * a) 152static inline int sysfs_update_file(struct kobject *kobj,
153 const struct attribute *attr)
173{ 154{
174 return 0; 155 return 0;
175} 156}
176static inline int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) 157static inline int sysfs_chmod_file(struct kobject *kobj,
158 struct attribute *attr, mode_t mode)
177{ 159{
178 return 0; 160 return 0;
179} 161}
180 162
181static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a) 163static inline void sysfs_remove_file(struct kobject *kobj,
164 const struct attribute *attr)
182{ 165{
183 ; 166 ;
184} 167}
185 168
186static inline int sysfs_create_link(struct kobject * k, struct kobject * t, const char * n) 169static inline int sysfs_create_bin_file(struct kobject *kobj,
170 struct bin_attribute *attr)
187{ 171{
188 return 0; 172 return 0;
189} 173}
190 174
191static inline void sysfs_remove_link(struct kobject * k, const char * name) 175static inline int sysfs_remove_bin_file(struct kobject *kobj,
176 struct bin_attribute *attr)
192{ 177{
193 ; 178 return 0;
194} 179}
195 180
196 181static inline int sysfs_create_link(struct kobject *kobj,
197static inline int sysfs_create_bin_file(struct kobject * k, struct bin_attribute * a) 182 struct kobject *target, const char *name)
198{ 183{
199 return 0; 184 return 0;
200} 185}
201 186
202static inline int sysfs_remove_bin_file(struct kobject * k, struct bin_attribute * a) 187static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
203{ 188{
204 return 0; 189 ;
205} 190}
206 191
207static inline int sysfs_create_group(struct kobject * k, const struct attribute_group *g) 192static inline int sysfs_create_group(struct kobject *kobj,
193 const struct attribute_group *grp)
208{ 194{
209 return 0; 195 return 0;
210} 196}
211 197
212static inline void sysfs_remove_group(struct kobject * k, const struct attribute_group * g) 198static inline void sysfs_remove_group(struct kobject *kobj,
199 const struct attribute_group *grp)
213{ 200{
214 ; 201 ;
215} 202}
@@ -225,7 +212,7 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj,
225{ 212{
226} 213}
227 214
228static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) 215static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr)
229{ 216{
230} 217}
231 218