diff options
Diffstat (limited to 'net/tipc/core.h')
-rw-r--r-- | net/tipc/core.h | 65 |
1 files changed, 5 insertions, 60 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h index 2a9bb99537b3..fd42e106c185 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
@@ -37,6 +37,8 @@ | |||
37 | #ifndef _TIPC_CORE_H | 37 | #ifndef _TIPC_CORE_H |
38 | #define _TIPC_CORE_H | 38 | #define _TIPC_CORE_H |
39 | 39 | ||
40 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
41 | |||
40 | #include <linux/tipc.h> | 42 | #include <linux/tipc.h> |
41 | #include <linux/tipc_config.h> | 43 | #include <linux/tipc_config.h> |
42 | #include <linux/types.h> | 44 | #include <linux/types.h> |
@@ -58,68 +60,11 @@ | |||
58 | 60 | ||
59 | #define TIPC_MOD_VER "2.0.0" | 61 | #define TIPC_MOD_VER "2.0.0" |
60 | 62 | ||
61 | struct tipc_msg; /* msg.h */ | 63 | #define ULTRA_STRING_MAX_LEN 32768 |
62 | struct print_buf; /* log.h */ | ||
63 | |||
64 | /* | ||
65 | * TIPC system monitoring code | ||
66 | */ | ||
67 | |||
68 | /* | ||
69 | * TIPC's print buffer subsystem supports the following print buffers: | ||
70 | * | ||
71 | * TIPC_NULL : null buffer (i.e. print nowhere) | ||
72 | * TIPC_CONS : system console | ||
73 | * TIPC_LOG : TIPC log buffer | ||
74 | * &buf : user-defined buffer (struct print_buf *) | ||
75 | * | ||
76 | * Note: TIPC_LOG is configured to echo its output to the system console; | ||
77 | * user-defined buffers can be configured to do the same thing. | ||
78 | */ | ||
79 | extern struct print_buf *const TIPC_NULL; | ||
80 | extern struct print_buf *const TIPC_CONS; | ||
81 | extern struct print_buf *const TIPC_LOG; | ||
82 | |||
83 | void tipc_printf(struct print_buf *, const char *fmt, ...); | ||
84 | |||
85 | /* | ||
86 | * TIPC_OUTPUT is the destination print buffer for system messages. | ||
87 | */ | ||
88 | #ifndef TIPC_OUTPUT | ||
89 | #define TIPC_OUTPUT TIPC_LOG | ||
90 | #endif | ||
91 | 64 | ||
92 | #define err(fmt, arg...) tipc_printf(TIPC_OUTPUT, \ | 65 | struct tipc_msg; /* msg.h */ |
93 | KERN_ERR "TIPC: " fmt, ## arg) | ||
94 | #define warn(fmt, arg...) tipc_printf(TIPC_OUTPUT, \ | ||
95 | KERN_WARNING "TIPC: " fmt, ## arg) | ||
96 | #define info(fmt, arg...) tipc_printf(TIPC_OUTPUT, \ | ||
97 | KERN_NOTICE "TIPC: " fmt, ## arg) | ||
98 | |||
99 | #ifdef CONFIG_TIPC_DEBUG | ||
100 | |||
101 | /* | ||
102 | * DBG_OUTPUT is the destination print buffer for debug messages. | ||
103 | */ | ||
104 | #ifndef DBG_OUTPUT | ||
105 | #define DBG_OUTPUT TIPC_LOG | ||
106 | #endif | ||
107 | |||
108 | #define dbg(fmt, arg...) tipc_printf(DBG_OUTPUT, KERN_DEBUG fmt, ## arg); | ||
109 | |||
110 | #define msg_dbg(msg, txt) tipc_msg_dbg(DBG_OUTPUT, msg, txt); | ||
111 | |||
112 | void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *); | ||
113 | |||
114 | #else | ||
115 | |||
116 | #define dbg(fmt, arg...) do {} while (0) | ||
117 | #define msg_dbg(msg, txt) do {} while (0) | ||
118 | |||
119 | #define tipc_msg_dbg(buf, msg, txt) do {} while (0) | ||
120 | |||
121 | #endif | ||
122 | 66 | ||
67 | int tipc_snprintf(char *buf, int len, const char *fmt, ...); | ||
123 | 68 | ||
124 | /* | 69 | /* |
125 | * TIPC-specific error codes | 70 | * TIPC-specific error codes |