41 |
41 |
42 #include "globals.h" |
42 #include "globals.h" |
43 #include "slave.h" |
43 #include "slave.h" |
44 #include "sync_config.h" |
44 #include "sync_config.h" |
45 #include "fmmu_config.h" |
45 #include "fmmu_config.h" |
|
46 |
|
47 /*****************************************************************************/ |
|
48 |
|
49 /** Convenience macro for printing configuration-specific information to |
|
50 * syslog. |
|
51 * |
|
52 * This will print the message in \a fmt with a prefixed |
|
53 * "EtherCAT <INDEX> <ALIAS>:<POSITION>: ", where INDEX is the master index |
|
54 * and ALIAS and POSITION identify the configuration. |
|
55 * |
|
56 * \param sc EtherCAT slave configuration |
|
57 * \param fmt format string (like in printf()) |
|
58 * \param args arguments (optional) |
|
59 */ |
|
60 #define EC_CONFIG_INFO(sc, fmt, args...) \ |
|
61 printk(KERN_INFO "EtherCAT %u %u:%u: " fmt, sc->master->index, \ |
|
62 sc->alias, sc->position, ##args) |
|
63 |
|
64 /** Convenience macro for printing configuration-specific errors to syslog. |
|
65 * |
|
66 * This will print the message in \a fmt with a prefixed |
|
67 * "EtherCAT <INDEX> <ALIAS>:<POSITION>: ", where INDEX is the master index |
|
68 * and ALIAS and POSITION identify the configuration. |
|
69 * |
|
70 * \param sc EtherCAT slave configuration |
|
71 * \param fmt format string (like in printf()) |
|
72 * \param args arguments (optional) |
|
73 */ |
|
74 #define EC_CONFIG_ERR(sc, fmt, args...) \ |
|
75 printk(KERN_ERR "EtherCAT ERROR %u %u:%u: " fmt, sc->master->index, \ |
|
76 sc->alias, sc->position, ##args) |
|
77 |
|
78 /** Convenience macro for printing configuration-specific warnings to syslog. |
|
79 * |
|
80 * This will print the message in \a fmt with a prefixed |
|
81 * "EtherCAT <INDEX> <ALIAS>:<POSITION>: ", where INDEX is the master index |
|
82 * and ALIAS and POSITION identify the configuration. |
|
83 * |
|
84 * \param sc EtherCAT slave configuration |
|
85 * \param fmt format string (like in printf()) |
|
86 * \param args arguments (optional) |
|
87 */ |
|
88 #define EC_CONFIG_WARN(sc, fmt, args...) \ |
|
89 printk(KERN_WARNING "EtherCAT WARNING %u %u:%u: " fmt, \ |
|
90 sc->master->index, sc->alias, sc->position, ##args) |
|
91 |
|
92 /** Convenience macro for printing configuration-specific debug messages to |
|
93 * syslog. |
|
94 * |
|
95 * This will print the message in \a fmt with a prefixed |
|
96 * "EtherCAT <INDEX> <ALIAS>:<POSITION>: ", where INDEX is the master index |
|
97 * and ALIAS and POSITION identify the configuration. |
|
98 * |
|
99 * \param sc EtherCAT slave configuration |
|
100 * \param fmt format string (like in printf()) |
|
101 * \param args arguments (optional) |
|
102 */ |
|
103 #define EC_CONFIG_DBG(sc, level, fmt, args...) \ |
|
104 do { \ |
|
105 if (sc->master->debug_level >= level) { \ |
|
106 printk(KERN_DEBUG "EtherCAT DEBUG %u %u:%u: " fmt, \ |
|
107 sc->master->index, sc->alias, sc->position, ##args); \ |
|
108 } \ |
|
109 } while (0) |
46 |
110 |
47 /*****************************************************************************/ |
111 /*****************************************************************************/ |
48 |
112 |
49 /** EtherCAT slave configuration. |
113 /** EtherCAT slave configuration. |
50 */ |
114 */ |