diff options
Diffstat (limited to 'net/tipc/discover.c')
-rw-r--r-- | net/tipc/discover.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 3b0cd12f37da..5d643e5721eb 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * net/tipc/discover.c | 2 | * net/tipc/discover.c |
3 | * | 3 | * |
4 | * Copyright (c) 2003-2006, Ericsson AB | 4 | * Copyright (c) 2003-2006, Ericsson AB |
5 | * Copyright (c) 2005-2006, Wind River Systems | 5 | * Copyright (c) 2005-2006, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
@@ -56,10 +56,10 @@ | |||
56 | #define CHECK_LINK_COUNT 306 | 56 | #define CHECK_LINK_COUNT 306 |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * TODO: Most of the inter-cluster setup stuff should be | 60 | * TODO: Most of the inter-cluster setup stuff should be |
61 | * rewritten, and be made conformant with specification. | 61 | * rewritten, and be made conformant with specification. |
62 | */ | 62 | */ |
63 | 63 | ||
64 | 64 | ||
65 | /** | 65 | /** |
@@ -80,10 +80,10 @@ struct link_req { | |||
80 | 80 | ||
81 | 81 | ||
82 | #if 0 | 82 | #if 0 |
83 | int disc_create_link(const struct tipc_link_create *argv) | 83 | int disc_create_link(const struct tipc_link_create *argv) |
84 | { | 84 | { |
85 | /* | 85 | /* |
86 | * Code for inter cluster link setup here | 86 | * Code for inter cluster link setup here |
87 | */ | 87 | */ |
88 | return TIPC_OK; | 88 | return TIPC_OK; |
89 | } | 89 | } |
@@ -93,16 +93,16 @@ int disc_create_link(const struct tipc_link_create *argv) | |||
93 | * disc_lost_link(): A link has lost contact | 93 | * disc_lost_link(): A link has lost contact |
94 | */ | 94 | */ |
95 | 95 | ||
96 | void tipc_disc_link_event(u32 addr, char *name, int up) | 96 | void tipc_disc_link_event(u32 addr, char *name, int up) |
97 | { | 97 | { |
98 | if (in_own_cluster(addr)) | 98 | if (in_own_cluster(addr)) |
99 | return; | 99 | return; |
100 | /* | 100 | /* |
101 | * Code for inter cluster link setup here | 101 | * Code for inter cluster link setup here |
102 | */ | 102 | */ |
103 | } | 103 | } |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * tipc_disc_init_msg - initialize a link setup message | 106 | * tipc_disc_init_msg - initialize a link setup message |
107 | * @type: message type (request or response) | 107 | * @type: message type (request or response) |
108 | * @req_links: number of links associated with message | 108 | * @req_links: number of links associated with message |
@@ -210,7 +210,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf) | |||
210 | dbg("creating link\n"); | 210 | dbg("creating link\n"); |
211 | link = tipc_link_create(b_ptr, orig, &media_addr); | 211 | link = tipc_link_create(b_ptr, orig, &media_addr); |
212 | if (!link) { | 212 | if (!link) { |
213 | spin_unlock_bh(&n_ptr->lock); | 213 | spin_unlock_bh(&n_ptr->lock); |
214 | return; | 214 | return; |
215 | } | 215 | } |
216 | } | 216 | } |
@@ -224,10 +224,10 @@ void tipc_disc_recv_msg(struct sk_buff *buf) | |||
224 | warn("Resetting link <%s>, peer interface address changed\n", | 224 | warn("Resetting link <%s>, peer interface address changed\n", |
225 | link->name); | 225 | link->name); |
226 | memcpy(addr, &media_addr, sizeof(*addr)); | 226 | memcpy(addr, &media_addr, sizeof(*addr)); |
227 | tipc_link_reset(link); | 227 | tipc_link_reset(link); |
228 | } | 228 | } |
229 | link_fully_up = (link->state == WORKING_WORKING); | 229 | link_fully_up = (link->state == WORKING_WORKING); |
230 | spin_unlock_bh(&n_ptr->lock); | 230 | spin_unlock_bh(&n_ptr->lock); |
231 | if ((type == DSC_RESP_MSG) || link_fully_up) | 231 | if ((type == DSC_RESP_MSG) || link_fully_up) |
232 | return; | 232 | return; |
233 | rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr); | 233 | rbuf = tipc_disc_init_msg(DSC_RESP_MSG, 1, orig, b_ptr); |
@@ -244,23 +244,23 @@ void tipc_disc_recv_msg(struct sk_buff *buf) | |||
244 | * @req: ptr to link request structure | 244 | * @req: ptr to link request structure |
245 | */ | 245 | */ |
246 | 246 | ||
247 | void tipc_disc_stop_link_req(struct link_req *req) | 247 | void tipc_disc_stop_link_req(struct link_req *req) |
248 | { | 248 | { |
249 | if (!req) | 249 | if (!req) |
250 | return; | 250 | return; |
251 | 251 | ||
252 | k_cancel_timer(&req->timer); | 252 | k_cancel_timer(&req->timer); |
253 | k_term_timer(&req->timer); | 253 | k_term_timer(&req->timer); |
254 | buf_discard(req->buf); | 254 | buf_discard(req->buf); |
255 | kfree(req); | 255 | kfree(req); |
256 | } | 256 | } |
257 | 257 | ||
258 | /** | 258 | /** |
259 | * tipc_disc_update_link_req - update frequency of periodic link setup requests | 259 | * tipc_disc_update_link_req - update frequency of periodic link setup requests |
260 | * @req: ptr to link request structure | 260 | * @req: ptr to link request structure |
261 | */ | 261 | */ |
262 | 262 | ||
263 | void tipc_disc_update_link_req(struct link_req *req) | 263 | void tipc_disc_update_link_req(struct link_req *req) |
264 | { | 264 | { |
265 | if (!req) | 265 | if (!req) |
266 | return; | 266 | return; |
@@ -278,16 +278,16 @@ void tipc_disc_update_link_req(struct link_req *req) | |||
278 | } else { | 278 | } else { |
279 | /* leave timer "as is" if haven't yet reached a "normal" rate */ | 279 | /* leave timer "as is" if haven't yet reached a "normal" rate */ |
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | /** | 283 | /** |
284 | * disc_timeout - send a periodic link setup request | 284 | * disc_timeout - send a periodic link setup request |
285 | * @req: ptr to link request structure | 285 | * @req: ptr to link request structure |
286 | * | 286 | * |
287 | * Called whenever a link setup request timer associated with a bearer expires. | 287 | * Called whenever a link setup request timer associated with a bearer expires. |
288 | */ | 288 | */ |
289 | 289 | ||
290 | static void disc_timeout(struct link_req *req) | 290 | static void disc_timeout(struct link_req *req) |
291 | { | 291 | { |
292 | spin_lock_bh(&req->bearer->publ.lock); | 292 | spin_lock_bh(&req->bearer->publ.lock); |
293 | 293 | ||
@@ -300,7 +300,7 @@ static void disc_timeout(struct link_req *req) | |||
300 | req->timer_intv *= 2; | 300 | req->timer_intv *= 2; |
301 | if (req->timer_intv > TIPC_LINK_REQ_FAST) | 301 | if (req->timer_intv > TIPC_LINK_REQ_FAST) |
302 | req->timer_intv = TIPC_LINK_REQ_FAST; | 302 | req->timer_intv = TIPC_LINK_REQ_FAST; |
303 | if ((req->timer_intv == TIPC_LINK_REQ_FAST) && | 303 | if ((req->timer_intv == TIPC_LINK_REQ_FAST) && |
304 | (req->bearer->nodes.count)) | 304 | (req->bearer->nodes.count)) |
305 | req->timer_intv = TIPC_LINK_REQ_SLOW; | 305 | req->timer_intv = TIPC_LINK_REQ_SLOW; |
306 | } | 306 | } |
@@ -315,14 +315,14 @@ static void disc_timeout(struct link_req *req) | |||
315 | * @dest: destination address for request messages | 315 | * @dest: destination address for request messages |
316 | * @dest_domain: network domain of node(s) which should respond to message | 316 | * @dest_domain: network domain of node(s) which should respond to message |
317 | * @req_links: max number of desired links | 317 | * @req_links: max number of desired links |
318 | * | 318 | * |
319 | * Returns pointer to link request structure, or NULL if unable to create. | 319 | * Returns pointer to link request structure, or NULL if unable to create. |
320 | */ | 320 | */ |
321 | 321 | ||
322 | struct link_req *tipc_disc_init_link_req(struct bearer *b_ptr, | 322 | struct link_req *tipc_disc_init_link_req(struct bearer *b_ptr, |
323 | const struct tipc_media_addr *dest, | 323 | const struct tipc_media_addr *dest, |
324 | u32 dest_domain, | 324 | u32 dest_domain, |
325 | u32 req_links) | 325 | u32 req_links) |
326 | { | 326 | { |
327 | struct link_req *req; | 327 | struct link_req *req; |
328 | 328 | ||
@@ -342,5 +342,5 @@ struct link_req *tipc_disc_init_link_req(struct bearer *b_ptr, | |||
342 | k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req); | 342 | k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req); |
343 | k_start_timer(&req->timer, req->timer_intv); | 343 | k_start_timer(&req->timer, req->timer_intv); |
344 | return req; | 344 | return req; |
345 | } | 345 | } |
346 | 346 | ||