Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2010 02:22:54 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r210593 - projects/ofed/head/sys/ofed/include/linux
Message-ID:  <201007290222.o6T2Mspq002140@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007290222.o6T2Mspq002140>