VSF Documented
sysfs.h
Go to the documentation of this file.
1#ifndef __VSF_LINUX_SYSFS_H__
2#define __VSF_LINUX_SYSFS_H__
3
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10struct attribute {
11 const char *name;
13};
14
16 const char *name;
17 struct attribute **attrs;
18};
19
20#define __ATTR(__NAME, __MODE, __SHOW, __STORE) { \
21 .attr = { .name = VSF_STR(__NAME), .mode = (__MODE), }, \
22 .show = (__SHOW), \
23 .store = (__STORE), \
24}
25
26#define __ATTRIBUTE_GROUPS(__NAME) \
27static const struct attribute_group * __NAME##_groups[] = { \
28 &__NAME##_group, NULL, \
29}
30
31#define ATTRIBUTE_GROUPS(__NAME) \
32static const struct attribute_group __NAME##_group = { \
33 .attrs = __NAME##_attrs, \
34}; \
35__ATTRIBUTE_GROUPS(__NAME)
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif
unsigned short umode_t
Definition types.h:88
Definition sysfs.h:15
struct attribute ** attrs
Definition sysfs.h:17
const char * name
Definition sysfs.h:16
Definition sysfs.h:10
const char * name
Definition sysfs.h:11
umode_t mode
Definition sysfs.h:12