equal
deleted
inserted
replaced
1 /****************************************************************************** |
1 /****************************************************************************** |
2 * |
|
3 * g l o b a l s . h |
|
4 * |
|
5 * Global definitions and macros. |
|
6 * |
2 * |
7 * $Id$ |
3 * $Id$ |
8 * |
4 * |
9 * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH |
5 * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH |
10 * |
6 * |
22 * You should have received a copy of the GNU General Public License |
18 * You should have received a copy of the GNU General Public License |
23 * along with the IgH EtherCAT Master; if not, write to the Free Software |
19 * along with the IgH EtherCAT Master; if not, write to the Free Software |
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
25 * |
21 * |
26 *****************************************************************************/ |
22 *****************************************************************************/ |
|
23 |
|
24 /** |
|
25 \file |
|
26 Global definitions and macros. |
|
27 */ |
|
28 |
|
29 /*****************************************************************************/ |
27 |
30 |
28 #ifndef _EC_GLOBALS_ |
31 #ifndef _EC_GLOBALS_ |
29 #define _EC_GLOBALS_ |
32 #define _EC_GLOBALS_ |
30 |
33 |
31 #include <linux/types.h> |
34 #include <linux/types.h> |
87 printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args) |
90 printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args) |
88 |
91 |
89 #define EC_LIT(X) #X |
92 #define EC_LIT(X) #X |
90 #define EC_STR(X) EC_LIT(X) |
93 #define EC_STR(X) EC_LIT(X) |
91 |
94 |
|
95 /** |
|
96 Convenience macro for defining SysFS attributes. |
|
97 */ |
|
98 |
92 #define EC_SYSFS_READ_ATTR(NAME) \ |
99 #define EC_SYSFS_READ_ATTR(NAME) \ |
93 static struct attribute attr_##NAME = { \ |
100 static struct attribute attr_##NAME = { \ |
94 .name = EC_STR(NAME), .owner = THIS_MODULE, .mode = S_IRUGO \ |
101 .name = EC_STR(NAME), .owner = THIS_MODULE, .mode = S_IRUGO \ |
95 } |
102 } |
96 |
103 |