Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | /* |
2 | * sysfs.h - definitions for the device driver filesystem |
||
3 | * |
||
4 | * Copyright (c) 2001,2002 Patrick Mochel |
||
5 | * |
||
6 | * Please see Documentation/filesystems/sysfs.txt for more information. |
||
7 | */ |
||
8 | |||
9 | #ifndef _SYSFS_H_ |
||
10 | #define _SYSFS_H_ |
||
11 | |||
12 | struct kobject; |
||
13 | struct module; |
||
14 | |||
15 | struct attribute { |
||
16 | char * name; |
||
17 | struct module * owner; |
||
18 | mode_t mode; |
||
19 | }; |
||
20 | |||
21 | struct bin_attribute { |
||
22 | struct attribute attr; |
||
23 | size_t size; |
||
24 | ssize_t (*read)(struct kobject *, char *, loff_t, size_t); |
||
25 | ssize_t (*write)(struct kobject *, char *, loff_t, size_t); |
||
26 | }; |
||
27 | |||
28 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); |
||
29 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); |
||
30 | |||
31 | struct sysfs_ops { |
||
32 | ssize_t (*show)(struct kobject *, struct attribute *,char *); |
||
33 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
||
34 | }; |
||
35 | |||
36 | extern int |
||
37 | sysfs_create_dir(struct kobject *); |
||
38 | |||
39 | extern void |
||
40 | sysfs_remove_dir(struct kobject *); |
||
41 | |||
42 | extern void |
||
43 | sysfs_rename_dir(struct kobject *, const char *new_name); |
||
44 | |||
45 | extern int |
||
46 | sysfs_create_file(struct kobject *, const struct attribute *); |
||
47 | |||
48 | extern int |
||
49 | sysfs_update_file(struct kobject *, const struct attribute *); |
||
50 | |||
51 | extern void |
||
52 | sysfs_remove_file(struct kobject *, const struct attribute *); |
||
53 | |||
54 | extern int |
||
55 | sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name); |
||
56 | |||
57 | extern void |
||
58 | sysfs_remove_link(struct kobject *, char * name); |
||
59 | |||
60 | |||
61 | struct attribute_group { |
||
62 | char * name; |
||
63 | struct attribute ** attrs; |
||
64 | }; |
||
65 | |||
66 | int sysfs_create_group(struct kobject *, const struct attribute_group *); |
||
67 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
||
68 | |||
69 | #endif /* _SYSFS_H_ */ |