Rev | Line | |
---|
[615] | 1 | #ifndef _LINUX_SYSFS_H
|
---|
| 2 | #define _LINUX_SYSFS_H
|
---|
| 3 | #include <linux/types.h>
|
---|
| 4 |
|
---|
[777] | 5 | int sysfs_emit(char *buf, const char *fmt, ...);
|
---|
| 6 | int sysfs_emit_at(char *buf, int at, const char *fmt, ...);
|
---|
| 7 |
|
---|
[615] | 8 | struct attribute {
|
---|
| 9 | const char *name;
|
---|
| 10 | umode_t mode;
|
---|
| 11 | };
|
---|
| 12 |
|
---|
| 13 | struct attribute_group {
|
---|
| 14 | const char *name;
|
---|
| 15 | umode_t (*is_visible)(struct kobject *,
|
---|
| 16 | struct attribute *, int);
|
---|
| 17 | struct attribute **attrs;
|
---|
| 18 | struct bin_attribute **bin_attrs;
|
---|
| 19 | };
|
---|
| 20 |
|
---|
| 21 | #define __ATTR_RO(_name) { \
|
---|
| 22 | .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \
|
---|
| 23 | .show = _name##_show, \
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | static inline int sysfs_create_groups(struct kobject *kobj,
|
---|
| 27 | const struct attribute_group **groups)
|
---|
| 28 | {
|
---|
| 29 | return 0;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | struct sysfs_ops {
|
---|
| 33 | ssize_t (*show)(struct kobject *, struct attribute *,char *);
|
---|
| 34 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
|
---|
| 35 | };
|
---|
| 36 |
|
---|
| 37 | #endif /* _LINUX_SYSFS_H */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.