svn commit: r210593 - projects/ofed/head/sys/ofed/include/linux
Jeff Roberson
jeff at FreeBSD.org
Thu Jul 29 02:22:54 UTC 2010
Author: jeff
Date: Thu Jul 29 02:22:54 2010
New Revision: 210593
URL: http://svn.freebsd.org/changeset/base/210593
Log:
- Add convenience macros for defining sysfs entries.
Sponsored by: Isilon Systems, iX Systems, and Panasas.
Modified:
projects/ofed/head/sys/ofed/include/linux/sysfs.h
Modified: projects/ofed/head/sys/ofed/include/linux/sysfs.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/linux/sysfs.h Thu Jul 29 02:21:51 2010 (r210592)
+++ projects/ofed/head/sys/ofed/include/linux/sysfs.h Thu Jul 29 02:22:54 2010 (r210593)
@@ -48,4 +48,16 @@ struct attribute_group {
struct attribute **attrs;
};
+#define __ATTR(_name, _mode, _show, _store) { \
+ .attr = { .name = __stringify(_name), .mode = _mode }, \
+ .show = _show, .store = _store, \
+}
+
+#define __ATTR_RO(_name) { \
+ .attr = { .name = __stringify(_name), .mode = 0444 }, \
+ .show = _name##_show, \
+}
+
+#define __ATTR_NULL { .attr = { .name = NULL } }
+
#endif /* _LINUX_SYSFS_H_ */
More information about the svn-src-projects
mailing list