diff options
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r-- | net/tipc/core.c | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c index e83ac06e31ba..3d0a8ee4e1d3 100644 --- a/net/tipc/core.c +++ b/net/tipc/core.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/module.h> | 38 | #include <linux/module.h> |
39 | #include <linux/kernel.h> | 39 | #include <linux/kernel.h> |
40 | #include <linux/version.h> | ||
41 | #include <linux/random.h> | 40 | #include <linux/random.h> |
42 | 41 | ||
43 | #include "core.h" | 42 | #include "core.h" |
@@ -49,14 +48,14 @@ | |||
49 | #include "subscr.h" | 48 | #include "subscr.h" |
50 | #include "config.h" | 49 | #include "config.h" |
51 | 50 | ||
52 | int eth_media_start(void); | 51 | int tipc_eth_media_start(void); |
53 | void eth_media_stop(void); | 52 | void tipc_eth_media_stop(void); |
54 | int handler_start(void); | 53 | int tipc_handler_start(void); |
55 | void handler_stop(void); | 54 | void tipc_handler_stop(void); |
56 | int socket_init(void); | 55 | int tipc_socket_init(void); |
57 | void socket_stop(void); | 56 | void tipc_socket_stop(void); |
58 | int netlink_start(void); | 57 | int tipc_netlink_start(void); |
59 | void netlink_stop(void); | 58 | void tipc_netlink_stop(void); |
60 | 59 | ||
61 | #define MOD_NAME "tipc_start: " | 60 | #define MOD_NAME "tipc_start: " |
62 | 61 | ||
@@ -113,56 +112,56 @@ int tipc_get_mode(void) | |||
113 | } | 112 | } |
114 | 113 | ||
115 | /** | 114 | /** |
116 | * stop_net - shut down TIPC networking sub-systems | 115 | * tipc_core_stop_net - shut down TIPC networking sub-systems |
117 | */ | 116 | */ |
118 | 117 | ||
119 | void stop_net(void) | 118 | void tipc_core_stop_net(void) |
120 | { | 119 | { |
121 | eth_media_stop(); | 120 | tipc_eth_media_stop(); |
122 | tipc_stop_net(); | 121 | tipc_net_stop(); |
123 | } | 122 | } |
124 | 123 | ||
125 | /** | 124 | /** |
126 | * start_net - start TIPC networking sub-systems | 125 | * start_net - start TIPC networking sub-systems |
127 | */ | 126 | */ |
128 | 127 | ||
129 | int start_net(void) | 128 | int tipc_core_start_net(void) |
130 | { | 129 | { |
131 | int res; | 130 | int res; |
132 | 131 | ||
133 | if ((res = tipc_start_net()) || | 132 | if ((res = tipc_net_start()) || |
134 | (res = eth_media_start())) { | 133 | (res = tipc_eth_media_start())) { |
135 | stop_net(); | 134 | tipc_core_stop_net(); |
136 | } | 135 | } |
137 | return res; | 136 | return res; |
138 | } | 137 | } |
139 | 138 | ||
140 | /** | 139 | /** |
141 | * stop_core - switch TIPC from SINGLE NODE to NOT RUNNING mode | 140 | * tipc_core_stop - switch TIPC from SINGLE NODE to NOT RUNNING mode |
142 | */ | 141 | */ |
143 | 142 | ||
144 | void stop_core(void) | 143 | void tipc_core_stop(void) |
145 | { | 144 | { |
146 | if (tipc_mode != TIPC_NODE_MODE) | 145 | if (tipc_mode != TIPC_NODE_MODE) |
147 | return; | 146 | return; |
148 | 147 | ||
149 | tipc_mode = TIPC_NOT_RUNNING; | 148 | tipc_mode = TIPC_NOT_RUNNING; |
150 | 149 | ||
151 | netlink_stop(); | 150 | tipc_netlink_stop(); |
152 | handler_stop(); | 151 | tipc_handler_stop(); |
153 | cfg_stop(); | 152 | tipc_cfg_stop(); |
154 | subscr_stop(); | 153 | tipc_subscr_stop(); |
155 | reg_stop(); | 154 | tipc_reg_stop(); |
156 | nametbl_stop(); | 155 | tipc_nametbl_stop(); |
157 | ref_table_stop(); | 156 | tipc_ref_table_stop(); |
158 | socket_stop(); | 157 | tipc_socket_stop(); |
159 | } | 158 | } |
160 | 159 | ||
161 | /** | 160 | /** |
162 | * start_core - switch TIPC from NOT RUNNING to SINGLE NODE mode | 161 | * tipc_core_start - switch TIPC from NOT RUNNING to SINGLE NODE mode |
163 | */ | 162 | */ |
164 | 163 | ||
165 | int start_core(void) | 164 | int tipc_core_start(void) |
166 | { | 165 | { |
167 | int res; | 166 | int res; |
168 | 167 | ||
@@ -172,16 +171,16 @@ int start_core(void) | |||
172 | get_random_bytes(&tipc_random, sizeof(tipc_random)); | 171 | get_random_bytes(&tipc_random, sizeof(tipc_random)); |
173 | tipc_mode = TIPC_NODE_MODE; | 172 | tipc_mode = TIPC_NODE_MODE; |
174 | 173 | ||
175 | if ((res = handler_start()) || | 174 | if ((res = tipc_handler_start()) || |
176 | (res = ref_table_init(tipc_max_ports + tipc_max_subscriptions, | 175 | (res = tipc_ref_table_init(tipc_max_ports + tipc_max_subscriptions, |
177 | tipc_random)) || | 176 | tipc_random)) || |
178 | (res = reg_start()) || | 177 | (res = tipc_reg_start()) || |
179 | (res = nametbl_init()) || | 178 | (res = tipc_nametbl_init()) || |
180 | (res = k_signal((Handler)subscr_start, 0)) || | 179 | (res = tipc_k_signal((Handler)tipc_subscr_start, 0)) || |
181 | (res = k_signal((Handler)cfg_init, 0)) || | 180 | (res = tipc_k_signal((Handler)tipc_cfg_init, 0)) || |
182 | (res = netlink_start()) || | 181 | (res = tipc_netlink_start()) || |
183 | (res = socket_init())) { | 182 | (res = tipc_socket_init())) { |
184 | stop_core(); | 183 | tipc_core_stop(); |
185 | } | 184 | } |
186 | return res; | 185 | return res; |
187 | } | 186 | } |
@@ -191,7 +190,7 @@ static int __init tipc_init(void) | |||
191 | { | 190 | { |
192 | int res; | 191 | int res; |
193 | 192 | ||
194 | log_reinit(CONFIG_TIPC_LOG); | 193 | tipc_log_reinit(CONFIG_TIPC_LOG); |
195 | info("Activated (compiled " __DATE__ " " __TIME__ ")\n"); | 194 | info("Activated (compiled " __DATE__ " " __TIME__ ")\n"); |
196 | 195 | ||
197 | tipc_own_addr = 0; | 196 | tipc_own_addr = 0; |
@@ -205,7 +204,7 @@ static int __init tipc_init(void) | |||
205 | tipc_max_slaves = delimit(CONFIG_TIPC_SLAVE_NODES, 0, 2047); | 204 | tipc_max_slaves = delimit(CONFIG_TIPC_SLAVE_NODES, 0, 2047); |
206 | tipc_net_id = 4711; | 205 | tipc_net_id = 4711; |
207 | 206 | ||
208 | if ((res = start_core())) | 207 | if ((res = tipc_core_start())) |
209 | err("Unable to start in single node mode\n"); | 208 | err("Unable to start in single node mode\n"); |
210 | else | 209 | else |
211 | info("Started in single node mode\n"); | 210 | info("Started in single node mode\n"); |
@@ -214,10 +213,10 @@ static int __init tipc_init(void) | |||
214 | 213 | ||
215 | static void __exit tipc_exit(void) | 214 | static void __exit tipc_exit(void) |
216 | { | 215 | { |
217 | stop_net(); | 216 | tipc_core_stop_net(); |
218 | stop_core(); | 217 | tipc_core_stop(); |
219 | info("Deactivated\n"); | 218 | info("Deactivated\n"); |
220 | log_stop(); | 219 | tipc_log_stop(); |
221 | } | 220 | } |
222 | 221 | ||
223 | module_init(tipc_init); | 222 | module_init(tipc_init); |