diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-01-18 17:23:54 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-18 17:23:54 -0500 |
commit | 27a7b0415f6e5c0ffdfb1ba42b9b96ddfbb78b8f (patch) | |
tree | 8107ee11c3fe7d3b4be36054af4475326af86d53 /net/tipc/port.c | |
parent | ad12583f46bcb6ce93ccd99fa063c0d701146b2e (diff) | |
parent | 4323add67792ced172d0d93b8b2e6187023115f1 (diff) |
Merge git://tipc.cslab.ericsson.net/pub/git/tipc
Diffstat (limited to 'net/tipc/port.c')
-rw-r--r-- | net/tipc/port.c | 274 |
1 files changed, 137 insertions, 137 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c index 66caca7abe92..72aae52bfec1 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -57,10 +57,10 @@ | |||
57 | static struct sk_buff *msg_queue_head = 0; | 57 | static struct sk_buff *msg_queue_head = 0; |
58 | static struct sk_buff *msg_queue_tail = 0; | 58 | static struct sk_buff *msg_queue_tail = 0; |
59 | 59 | ||
60 | spinlock_t port_list_lock = SPIN_LOCK_UNLOCKED; | 60 | spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED; |
61 | static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED; | 61 | static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED; |
62 | 62 | ||
63 | LIST_HEAD(ports); | 63 | static LIST_HEAD(ports); |
64 | static void port_handle_node_down(unsigned long ref); | 64 | static void port_handle_node_down(unsigned long ref); |
65 | static struct sk_buff* port_build_self_abort_msg(struct port *,u32 err); | 65 | static struct sk_buff* port_build_self_abort_msg(struct port *,u32 err); |
66 | static struct sk_buff* port_build_peer_abort_msg(struct port *,u32 err); | 66 | static struct sk_buff* port_build_peer_abort_msg(struct port *,u32 err); |
@@ -107,7 +107,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, u32 domain, | |||
107 | struct sk_buff *buf; | 107 | struct sk_buff *buf; |
108 | struct sk_buff *ibuf = NULL; | 108 | struct sk_buff *ibuf = NULL; |
109 | struct port_list dports = {0, NULL, }; | 109 | struct port_list dports = {0, NULL, }; |
110 | struct port *oport = port_deref(ref); | 110 | struct port *oport = tipc_port_deref(ref); |
111 | int ext_targets; | 111 | int ext_targets; |
112 | int res; | 112 | int res; |
113 | 113 | ||
@@ -129,8 +129,8 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, u32 domain, | |||
129 | 129 | ||
130 | /* Figure out where to send multicast message */ | 130 | /* Figure out where to send multicast message */ |
131 | 131 | ||
132 | ext_targets = nametbl_mc_translate(seq->type, seq->lower, seq->upper, | 132 | ext_targets = tipc_nametbl_mc_translate(seq->type, seq->lower, seq->upper, |
133 | TIPC_NODE_SCOPE, &dports); | 133 | TIPC_NODE_SCOPE, &dports); |
134 | 134 | ||
135 | /* Send message to destinations (duplicate it only if necessary) */ | 135 | /* Send message to destinations (duplicate it only if necessary) */ |
136 | 136 | ||
@@ -138,12 +138,12 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, u32 domain, | |||
138 | if (dports.count != 0) { | 138 | if (dports.count != 0) { |
139 | ibuf = skb_copy(buf, GFP_ATOMIC); | 139 | ibuf = skb_copy(buf, GFP_ATOMIC); |
140 | if (ibuf == NULL) { | 140 | if (ibuf == NULL) { |
141 | port_list_free(&dports); | 141 | tipc_port_list_free(&dports); |
142 | buf_discard(buf); | 142 | buf_discard(buf); |
143 | return -ENOMEM; | 143 | return -ENOMEM; |
144 | } | 144 | } |
145 | } | 145 | } |
146 | res = bclink_send_msg(buf); | 146 | res = tipc_bclink_send_msg(buf); |
147 | if ((res < 0) && (dports.count != 0)) { | 147 | if ((res < 0) && (dports.count != 0)) { |
148 | buf_discard(ibuf); | 148 | buf_discard(ibuf); |
149 | } | 149 | } |
@@ -153,20 +153,20 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, u32 domain, | |||
153 | 153 | ||
154 | if (res >= 0) { | 154 | if (res >= 0) { |
155 | if (ibuf) | 155 | if (ibuf) |
156 | port_recv_mcast(ibuf, &dports); | 156 | tipc_port_recv_mcast(ibuf, &dports); |
157 | } else { | 157 | } else { |
158 | port_list_free(&dports); | 158 | tipc_port_list_free(&dports); |
159 | } | 159 | } |
160 | return res; | 160 | return res; |
161 | } | 161 | } |
162 | 162 | ||
163 | /** | 163 | /** |
164 | * port_recv_mcast - deliver multicast message to all destination ports | 164 | * tipc_port_recv_mcast - deliver multicast message to all destination ports |
165 | * | 165 | * |
166 | * If there is no port list, perform a lookup to create one | 166 | * If there is no port list, perform a lookup to create one |
167 | */ | 167 | */ |
168 | 168 | ||
169 | void port_recv_mcast(struct sk_buff *buf, struct port_list *dp) | 169 | void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp) |
170 | { | 170 | { |
171 | struct tipc_msg* msg; | 171 | struct tipc_msg* msg; |
172 | struct port_list dports = {0, NULL, }; | 172 | struct port_list dports = {0, NULL, }; |
@@ -179,7 +179,7 @@ void port_recv_mcast(struct sk_buff *buf, struct port_list *dp) | |||
179 | /* Create destination port list, if one wasn't supplied */ | 179 | /* Create destination port list, if one wasn't supplied */ |
180 | 180 | ||
181 | if (dp == NULL) { | 181 | if (dp == NULL) { |
182 | nametbl_mc_translate(msg_nametype(msg), | 182 | tipc_nametbl_mc_translate(msg_nametype(msg), |
183 | msg_namelower(msg), | 183 | msg_namelower(msg), |
184 | msg_nameupper(msg), | 184 | msg_nameupper(msg), |
185 | TIPC_CLUSTER_SCOPE, | 185 | TIPC_CLUSTER_SCOPE, |
@@ -192,8 +192,8 @@ void port_recv_mcast(struct sk_buff *buf, struct port_list *dp) | |||
192 | if (dp->count != 0) { | 192 | if (dp->count != 0) { |
193 | if (dp->count == 1) { | 193 | if (dp->count == 1) { |
194 | msg_set_destport(msg, dp->ports[0]); | 194 | msg_set_destport(msg, dp->ports[0]); |
195 | port_recv_msg(buf); | 195 | tipc_port_recv_msg(buf); |
196 | port_list_free(dp); | 196 | tipc_port_list_free(dp); |
197 | return; | 197 | return; |
198 | } | 198 | } |
199 | for (; cnt < dp->count; cnt++) { | 199 | for (; cnt < dp->count; cnt++) { |
@@ -209,12 +209,12 @@ void port_recv_mcast(struct sk_buff *buf, struct port_list *dp) | |||
209 | item = item->next; | 209 | item = item->next; |
210 | } | 210 | } |
211 | msg_set_destport(buf_msg(b),item->ports[index]); | 211 | msg_set_destport(buf_msg(b),item->ports[index]); |
212 | port_recv_msg(b); | 212 | tipc_port_recv_msg(b); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | exit: | 215 | exit: |
216 | buf_discard(buf); | 216 | buf_discard(buf); |
217 | port_list_free(dp); | 217 | tipc_port_list_free(dp); |
218 | } | 218 | } |
219 | 219 | ||
220 | /** | 220 | /** |
@@ -238,14 +238,14 @@ u32 tipc_createport_raw(void *usr_handle, | |||
238 | return 0; | 238 | return 0; |
239 | } | 239 | } |
240 | memset(p_ptr, 0, sizeof(*p_ptr)); | 240 | memset(p_ptr, 0, sizeof(*p_ptr)); |
241 | ref = ref_acquire(p_ptr, &p_ptr->publ.lock); | 241 | ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock); |
242 | if (!ref) { | 242 | if (!ref) { |
243 | warn("Reference Table Exhausted\n"); | 243 | warn("Reference Table Exhausted\n"); |
244 | kfree(p_ptr); | 244 | kfree(p_ptr); |
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
247 | 247 | ||
248 | port_lock(ref); | 248 | tipc_port_lock(ref); |
249 | p_ptr->publ.ref = ref; | 249 | p_ptr->publ.ref = ref; |
250 | msg = &p_ptr->publ.phdr; | 250 | msg = &p_ptr->publ.phdr; |
251 | msg_init(msg, DATA_LOW, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, 0); | 251 | msg_init(msg, DATA_LOW, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, 0); |
@@ -264,12 +264,12 @@ u32 tipc_createport_raw(void *usr_handle, | |||
264 | p_ptr->wakeup = wakeup; | 264 | p_ptr->wakeup = wakeup; |
265 | p_ptr->user_port = 0; | 265 | p_ptr->user_port = 0; |
266 | k_init_timer(&p_ptr->timer, (Handler)port_timeout, ref); | 266 | k_init_timer(&p_ptr->timer, (Handler)port_timeout, ref); |
267 | spin_lock_bh(&port_list_lock); | 267 | spin_lock_bh(&tipc_port_list_lock); |
268 | INIT_LIST_HEAD(&p_ptr->publications); | 268 | INIT_LIST_HEAD(&p_ptr->publications); |
269 | INIT_LIST_HEAD(&p_ptr->port_list); | 269 | INIT_LIST_HEAD(&p_ptr->port_list); |
270 | list_add_tail(&p_ptr->port_list, &ports); | 270 | list_add_tail(&p_ptr->port_list, &ports); |
271 | spin_unlock_bh(&port_list_lock); | 271 | spin_unlock_bh(&tipc_port_list_lock); |
272 | port_unlock(p_ptr); | 272 | tipc_port_unlock(p_ptr); |
273 | return ref; | 273 | return ref; |
274 | } | 274 | } |
275 | 275 | ||
@@ -279,31 +279,31 @@ int tipc_deleteport(u32 ref) | |||
279 | struct sk_buff *buf = 0; | 279 | struct sk_buff *buf = 0; |
280 | 280 | ||
281 | tipc_withdraw(ref, 0, 0); | 281 | tipc_withdraw(ref, 0, 0); |
282 | p_ptr = port_lock(ref); | 282 | p_ptr = tipc_port_lock(ref); |
283 | if (!p_ptr) | 283 | if (!p_ptr) |
284 | return -EINVAL; | 284 | return -EINVAL; |
285 | 285 | ||
286 | ref_discard(ref); | 286 | tipc_ref_discard(ref); |
287 | port_unlock(p_ptr); | 287 | tipc_port_unlock(p_ptr); |
288 | 288 | ||
289 | k_cancel_timer(&p_ptr->timer); | 289 | k_cancel_timer(&p_ptr->timer); |
290 | if (p_ptr->publ.connected) { | 290 | if (p_ptr->publ.connected) { |
291 | buf = port_build_peer_abort_msg(p_ptr, TIPC_ERR_NO_PORT); | 291 | buf = port_build_peer_abort_msg(p_ptr, TIPC_ERR_NO_PORT); |
292 | nodesub_unsubscribe(&p_ptr->subscription); | 292 | tipc_nodesub_unsubscribe(&p_ptr->subscription); |
293 | } | 293 | } |
294 | if (p_ptr->user_port) { | 294 | if (p_ptr->user_port) { |
295 | reg_remove_port(p_ptr->user_port); | 295 | tipc_reg_remove_port(p_ptr->user_port); |
296 | kfree(p_ptr->user_port); | 296 | kfree(p_ptr->user_port); |
297 | } | 297 | } |
298 | 298 | ||
299 | spin_lock_bh(&port_list_lock); | 299 | spin_lock_bh(&tipc_port_list_lock); |
300 | list_del(&p_ptr->port_list); | 300 | list_del(&p_ptr->port_list); |
301 | list_del(&p_ptr->wait_list); | 301 | list_del(&p_ptr->wait_list); |
302 | spin_unlock_bh(&port_list_lock); | 302 | spin_unlock_bh(&tipc_port_list_lock); |
303 | k_term_timer(&p_ptr->timer); | 303 | k_term_timer(&p_ptr->timer); |
304 | kfree(p_ptr); | 304 | kfree(p_ptr); |
305 | dbg("Deleted port %u\n", ref); | 305 | dbg("Deleted port %u\n", ref); |
306 | net_route_msg(buf); | 306 | tipc_net_route_msg(buf); |
307 | return TIPC_OK; | 307 | return TIPC_OK; |
308 | } | 308 | } |
309 | 309 | ||
@@ -315,7 +315,7 @@ int tipc_deleteport(u32 ref) | |||
315 | 315 | ||
316 | struct tipc_port *tipc_get_port(const u32 ref) | 316 | struct tipc_port *tipc_get_port(const u32 ref) |
317 | { | 317 | { |
318 | return (struct tipc_port *)ref_deref(ref); | 318 | return (struct tipc_port *)tipc_ref_deref(ref); |
319 | } | 319 | } |
320 | 320 | ||
321 | /** | 321 | /** |
@@ -327,11 +327,11 @@ void *tipc_get_handle(const u32 ref) | |||
327 | struct port *p_ptr; | 327 | struct port *p_ptr; |
328 | void * handle; | 328 | void * handle; |
329 | 329 | ||
330 | p_ptr = port_lock(ref); | 330 | p_ptr = tipc_port_lock(ref); |
331 | if (!p_ptr) | 331 | if (!p_ptr) |
332 | return 0; | 332 | return 0; |
333 | handle = p_ptr->publ.usr_handle; | 333 | handle = p_ptr->publ.usr_handle; |
334 | port_unlock(p_ptr); | 334 | tipc_port_unlock(p_ptr); |
335 | return handle; | 335 | return handle; |
336 | } | 336 | } |
337 | 337 | ||
@@ -344,7 +344,7 @@ int tipc_portunreliable(u32 ref, unsigned int *isunreliable) | |||
344 | { | 344 | { |
345 | struct port *p_ptr; | 345 | struct port *p_ptr; |
346 | 346 | ||
347 | p_ptr = port_lock(ref); | 347 | p_ptr = tipc_port_lock(ref); |
348 | if (!p_ptr) | 348 | if (!p_ptr) |
349 | return -EINVAL; | 349 | return -EINVAL; |
350 | *isunreliable = port_unreliable(p_ptr); | 350 | *isunreliable = port_unreliable(p_ptr); |
@@ -356,11 +356,11 @@ int tipc_set_portunreliable(u32 ref, unsigned int isunreliable) | |||
356 | { | 356 | { |
357 | struct port *p_ptr; | 357 | struct port *p_ptr; |
358 | 358 | ||
359 | p_ptr = port_lock(ref); | 359 | p_ptr = tipc_port_lock(ref); |
360 | if (!p_ptr) | 360 | if (!p_ptr) |
361 | return -EINVAL; | 361 | return -EINVAL; |
362 | msg_set_src_droppable(&p_ptr->publ.phdr, (isunreliable != 0)); | 362 | msg_set_src_droppable(&p_ptr->publ.phdr, (isunreliable != 0)); |
363 | port_unlock(p_ptr); | 363 | tipc_port_unlock(p_ptr); |
364 | return TIPC_OK; | 364 | return TIPC_OK; |
365 | } | 365 | } |
366 | 366 | ||
@@ -373,7 +373,7 @@ int tipc_portunreturnable(u32 ref, unsigned int *isunrejectable) | |||
373 | { | 373 | { |
374 | struct port *p_ptr; | 374 | struct port *p_ptr; |
375 | 375 | ||
376 | p_ptr = port_lock(ref); | 376 | p_ptr = tipc_port_lock(ref); |
377 | if (!p_ptr) | 377 | if (!p_ptr) |
378 | return -EINVAL; | 378 | return -EINVAL; |
379 | *isunrejectable = port_unreturnable(p_ptr); | 379 | *isunrejectable = port_unreturnable(p_ptr); |
@@ -385,11 +385,11 @@ int tipc_set_portunreturnable(u32 ref, unsigned int isunrejectable) | |||
385 | { | 385 | { |
386 | struct port *p_ptr; | 386 | struct port *p_ptr; |
387 | 387 | ||
388 | p_ptr = port_lock(ref); | 388 | p_ptr = tipc_port_lock(ref); |
389 | if (!p_ptr) | 389 | if (!p_ptr) |
390 | return -EINVAL; | 390 | return -EINVAL; |
391 | msg_set_dest_droppable(&p_ptr->publ.phdr, (isunrejectable != 0)); | 391 | msg_set_dest_droppable(&p_ptr->publ.phdr, (isunrejectable != 0)); |
392 | port_unlock(p_ptr); | 392 | tipc_port_unlock(p_ptr); |
393 | return TIPC_OK; | 393 | return TIPC_OK; |
394 | } | 394 | } |
395 | 395 | ||
@@ -476,25 +476,25 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err) | |||
476 | /* send self-abort message when rejecting on a connected port */ | 476 | /* send self-abort message when rejecting on a connected port */ |
477 | if (msg_connected(msg)) { | 477 | if (msg_connected(msg)) { |
478 | struct sk_buff *abuf = 0; | 478 | struct sk_buff *abuf = 0; |
479 | struct port *p_ptr = port_lock(msg_destport(msg)); | 479 | struct port *p_ptr = tipc_port_lock(msg_destport(msg)); |
480 | 480 | ||
481 | if (p_ptr) { | 481 | if (p_ptr) { |
482 | if (p_ptr->publ.connected) | 482 | if (p_ptr->publ.connected) |
483 | abuf = port_build_self_abort_msg(p_ptr, err); | 483 | abuf = port_build_self_abort_msg(p_ptr, err); |
484 | port_unlock(p_ptr); | 484 | tipc_port_unlock(p_ptr); |
485 | } | 485 | } |
486 | net_route_msg(abuf); | 486 | tipc_net_route_msg(abuf); |
487 | } | 487 | } |
488 | 488 | ||
489 | /* send rejected message */ | 489 | /* send rejected message */ |
490 | buf_discard(buf); | 490 | buf_discard(buf); |
491 | net_route_msg(rbuf); | 491 | tipc_net_route_msg(rbuf); |
492 | return data_sz; | 492 | return data_sz; |
493 | } | 493 | } |
494 | 494 | ||
495 | int port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr, | 495 | int tipc_port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr, |
496 | struct iovec const *msg_sect, u32 num_sect, | 496 | struct iovec const *msg_sect, u32 num_sect, |
497 | int err) | 497 | int err) |
498 | { | 498 | { |
499 | struct sk_buff *buf; | 499 | struct sk_buff *buf; |
500 | int res; | 500 | int res; |
@@ -509,7 +509,7 @@ int port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr, | |||
509 | 509 | ||
510 | static void port_timeout(unsigned long ref) | 510 | static void port_timeout(unsigned long ref) |
511 | { | 511 | { |
512 | struct port *p_ptr = port_lock(ref); | 512 | struct port *p_ptr = tipc_port_lock(ref); |
513 | struct sk_buff *buf = 0; | 513 | struct sk_buff *buf = 0; |
514 | 514 | ||
515 | if (!p_ptr || !p_ptr->publ.connected) | 515 | if (!p_ptr || !p_ptr->publ.connected) |
@@ -532,21 +532,21 @@ static void port_timeout(unsigned long ref) | |||
532 | p_ptr->probing_state = PROBING; | 532 | p_ptr->probing_state = PROBING; |
533 | k_start_timer(&p_ptr->timer, p_ptr->probing_interval); | 533 | k_start_timer(&p_ptr->timer, p_ptr->probing_interval); |
534 | } | 534 | } |
535 | port_unlock(p_ptr); | 535 | tipc_port_unlock(p_ptr); |
536 | net_route_msg(buf); | 536 | tipc_net_route_msg(buf); |
537 | } | 537 | } |
538 | 538 | ||
539 | 539 | ||
540 | static void port_handle_node_down(unsigned long ref) | 540 | static void port_handle_node_down(unsigned long ref) |
541 | { | 541 | { |
542 | struct port *p_ptr = port_lock(ref); | 542 | struct port *p_ptr = tipc_port_lock(ref); |
543 | struct sk_buff* buf = 0; | 543 | struct sk_buff* buf = 0; |
544 | 544 | ||
545 | if (!p_ptr) | 545 | if (!p_ptr) |
546 | return; | 546 | return; |
547 | buf = port_build_self_abort_msg(p_ptr, TIPC_ERR_NO_NODE); | 547 | buf = port_build_self_abort_msg(p_ptr, TIPC_ERR_NO_NODE); |
548 | port_unlock(p_ptr); | 548 | tipc_port_unlock(p_ptr); |
549 | net_route_msg(buf); | 549 | tipc_net_route_msg(buf); |
550 | } | 550 | } |
551 | 551 | ||
552 | 552 | ||
@@ -589,10 +589,10 @@ static struct sk_buff *port_build_peer_abort_msg(struct port *p_ptr, u32 err) | |||
589 | 0); | 589 | 0); |
590 | } | 590 | } |
591 | 591 | ||
592 | void port_recv_proto_msg(struct sk_buff *buf) | 592 | void tipc_port_recv_proto_msg(struct sk_buff *buf) |
593 | { | 593 | { |
594 | struct tipc_msg *msg = buf_msg(buf); | 594 | struct tipc_msg *msg = buf_msg(buf); |
595 | struct port *p_ptr = port_lock(msg_destport(msg)); | 595 | struct port *p_ptr = tipc_port_lock(msg_destport(msg)); |
596 | u32 err = TIPC_OK; | 596 | u32 err = TIPC_OK; |
597 | struct sk_buff *r_buf = 0; | 597 | struct sk_buff *r_buf = 0; |
598 | struct sk_buff *abort_buf = 0; | 598 | struct sk_buff *abort_buf = 0; |
@@ -615,11 +615,11 @@ void port_recv_proto_msg(struct sk_buff *buf) | |||
615 | } | 615 | } |
616 | } | 616 | } |
617 | if (msg_type(msg) == CONN_ACK) { | 617 | if (msg_type(msg) == CONN_ACK) { |
618 | int wakeup = port_congested(p_ptr) && | 618 | int wakeup = tipc_port_congested(p_ptr) && |
619 | p_ptr->publ.congested && | 619 | p_ptr->publ.congested && |
620 | p_ptr->wakeup; | 620 | p_ptr->wakeup; |
621 | p_ptr->acked += msg_msgcnt(msg); | 621 | p_ptr->acked += msg_msgcnt(msg); |
622 | if (port_congested(p_ptr)) | 622 | if (tipc_port_congested(p_ptr)) |
623 | goto exit; | 623 | goto exit; |
624 | p_ptr->publ.congested = 0; | 624 | p_ptr->publ.congested = 0; |
625 | if (!wakeup) | 625 | if (!wakeup) |
@@ -659,9 +659,9 @@ void port_recv_proto_msg(struct sk_buff *buf) | |||
659 | port_incr_out_seqno(p_ptr); | 659 | port_incr_out_seqno(p_ptr); |
660 | exit: | 660 | exit: |
661 | if (p_ptr) | 661 | if (p_ptr) |
662 | port_unlock(p_ptr); | 662 | tipc_port_unlock(p_ptr); |
663 | net_route_msg(r_buf); | 663 | tipc_net_route_msg(r_buf); |
664 | net_route_msg(abort_buf); | 664 | tipc_net_route_msg(abort_buf); |
665 | buf_discard(buf); | 665 | buf_discard(buf); |
666 | } | 666 | } |
667 | 667 | ||
@@ -704,7 +704,7 @@ static void port_print(struct port *p_ptr, struct print_buf *buf, int full_id) | |||
704 | 704 | ||
705 | #define MAX_PORT_QUERY 32768 | 705 | #define MAX_PORT_QUERY 32768 |
706 | 706 | ||
707 | struct sk_buff *port_get_ports(void) | 707 | struct sk_buff *tipc_port_get_ports(void) |
708 | { | 708 | { |
709 | struct sk_buff *buf; | 709 | struct sk_buff *buf; |
710 | struct tlv_desc *rep_tlv; | 710 | struct tlv_desc *rep_tlv; |
@@ -712,20 +712,20 @@ struct sk_buff *port_get_ports(void) | |||
712 | struct port *p_ptr; | 712 | struct port *p_ptr; |
713 | int str_len; | 713 | int str_len; |
714 | 714 | ||
715 | buf = cfg_reply_alloc(TLV_SPACE(MAX_PORT_QUERY)); | 715 | buf = tipc_cfg_reply_alloc(TLV_SPACE(MAX_PORT_QUERY)); |
716 | if (!buf) | 716 | if (!buf) |
717 | return NULL; | 717 | return NULL; |
718 | rep_tlv = (struct tlv_desc *)buf->data; | 718 | rep_tlv = (struct tlv_desc *)buf->data; |
719 | 719 | ||
720 | printbuf_init(&pb, TLV_DATA(rep_tlv), MAX_PORT_QUERY); | 720 | tipc_printbuf_init(&pb, TLV_DATA(rep_tlv), MAX_PORT_QUERY); |
721 | spin_lock_bh(&port_list_lock); | 721 | spin_lock_bh(&tipc_port_list_lock); |
722 | list_for_each_entry(p_ptr, &ports, port_list) { | 722 | list_for_each_entry(p_ptr, &ports, port_list) { |
723 | spin_lock_bh(p_ptr->publ.lock); | 723 | spin_lock_bh(p_ptr->publ.lock); |
724 | port_print(p_ptr, &pb, 0); | 724 | port_print(p_ptr, &pb, 0); |
725 | spin_unlock_bh(p_ptr->publ.lock); | 725 | spin_unlock_bh(p_ptr->publ.lock); |
726 | } | 726 | } |
727 | spin_unlock_bh(&port_list_lock); | 727 | spin_unlock_bh(&tipc_port_list_lock); |
728 | str_len = printbuf_validate(&pb); | 728 | str_len = tipc_printbuf_validate(&pb); |
729 | 729 | ||
730 | skb_put(buf, TLV_SPACE(str_len)); | 730 | skb_put(buf, TLV_SPACE(str_len)); |
731 | TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len); | 731 | TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len); |
@@ -752,22 +752,22 @@ struct sk_buff *port_show_stats(const void *req_tlv_area, int req_tlv_space) | |||
752 | ref = *(u32 *)TLV_DATA(req_tlv_area); | 752 | ref = *(u32 *)TLV_DATA(req_tlv_area); |
753 | ref = ntohl(ref); | 753 | ref = ntohl(ref); |
754 | 754 | ||
755 | p_ptr = port_lock(ref); | 755 | p_ptr = tipc_port_lock(ref); |
756 | if (!p_ptr) | 756 | if (!p_ptr) |
757 | return cfg_reply_error_string("port not found"); | 757 | return cfg_reply_error_string("port not found"); |
758 | 758 | ||
759 | buf = cfg_reply_alloc(TLV_SPACE(MAX_PORT_STATS)); | 759 | buf = tipc_cfg_reply_alloc(TLV_SPACE(MAX_PORT_STATS)); |
760 | if (!buf) { | 760 | if (!buf) { |
761 | port_unlock(p_ptr); | 761 | tipc_port_unlock(p_ptr); |
762 | return NULL; | 762 | return NULL; |
763 | } | 763 | } |
764 | rep_tlv = (struct tlv_desc *)buf->data; | 764 | rep_tlv = (struct tlv_desc *)buf->data; |
765 | 765 | ||
766 | printbuf_init(&pb, TLV_DATA(rep_tlv), MAX_PORT_STATS); | 766 | tipc_printbuf_init(&pb, TLV_DATA(rep_tlv), MAX_PORT_STATS); |
767 | port_print(p_ptr, &pb, 1); | 767 | port_print(p_ptr, &pb, 1); |
768 | /* NEED TO FILL IN ADDITIONAL PORT STATISTICS HERE */ | 768 | /* NEED TO FILL IN ADDITIONAL PORT STATISTICS HERE */ |
769 | port_unlock(p_ptr); | 769 | tipc_port_unlock(p_ptr); |
770 | str_len = printbuf_validate(&pb); | 770 | str_len = tipc_printbuf_validate(&pb); |
771 | 771 | ||
772 | skb_put(buf, TLV_SPACE(str_len)); | 772 | skb_put(buf, TLV_SPACE(str_len)); |
773 | TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len); | 773 | TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len); |
@@ -777,19 +777,19 @@ struct sk_buff *port_show_stats(const void *req_tlv_area, int req_tlv_space) | |||
777 | 777 | ||
778 | #endif | 778 | #endif |
779 | 779 | ||
780 | void port_reinit(void) | 780 | void tipc_port_reinit(void) |
781 | { | 781 | { |
782 | struct port *p_ptr; | 782 | struct port *p_ptr; |
783 | struct tipc_msg *msg; | 783 | struct tipc_msg *msg; |
784 | 784 | ||
785 | spin_lock_bh(&port_list_lock); | 785 | spin_lock_bh(&tipc_port_list_lock); |
786 | list_for_each_entry(p_ptr, &ports, port_list) { | 786 | list_for_each_entry(p_ptr, &ports, port_list) { |
787 | msg = &p_ptr->publ.phdr; | 787 | msg = &p_ptr->publ.phdr; |
788 | if (msg_orignode(msg) == tipc_own_addr) | 788 | if (msg_orignode(msg) == tipc_own_addr) |
789 | break; | 789 | break; |
790 | msg_set_orignode(msg, tipc_own_addr); | 790 | msg_set_orignode(msg, tipc_own_addr); |
791 | } | 791 | } |
792 | spin_unlock_bh(&port_list_lock); | 792 | spin_unlock_bh(&tipc_port_list_lock); |
793 | } | 793 | } |
794 | 794 | ||
795 | 795 | ||
@@ -820,7 +820,7 @@ static void port_dispatcher_sigh(void *dummy) | |||
820 | struct tipc_msg *msg = buf_msg(buf); | 820 | struct tipc_msg *msg = buf_msg(buf); |
821 | u32 dref = msg_destport(msg); | 821 | u32 dref = msg_destport(msg); |
822 | 822 | ||
823 | p_ptr = port_lock(dref); | 823 | p_ptr = tipc_port_lock(dref); |
824 | if (!p_ptr) { | 824 | if (!p_ptr) { |
825 | /* Port deleted while msg in queue */ | 825 | /* Port deleted while msg in queue */ |
826 | tipc_reject_msg(buf, TIPC_ERR_NO_PORT); | 826 | tipc_reject_msg(buf, TIPC_ERR_NO_PORT); |
@@ -976,7 +976,7 @@ static u32 port_dispatcher(struct tipc_port *dummy, struct sk_buff *buf) | |||
976 | msg_queue_tail = buf; | 976 | msg_queue_tail = buf; |
977 | } else { | 977 | } else { |
978 | msg_queue_tail = msg_queue_head = buf; | 978 | msg_queue_tail = msg_queue_head = buf; |
979 | k_signal((Handler)port_dispatcher_sigh, 0); | 979 | tipc_k_signal((Handler)port_dispatcher_sigh, 0); |
980 | } | 980 | } |
981 | spin_unlock_bh(&queue_lock); | 981 | spin_unlock_bh(&queue_lock); |
982 | return TIPC_OK; | 982 | return TIPC_OK; |
@@ -994,14 +994,14 @@ static void port_wakeup_sh(unsigned long ref) | |||
994 | tipc_continue_event cb = 0; | 994 | tipc_continue_event cb = 0; |
995 | void *uh = 0; | 995 | void *uh = 0; |
996 | 996 | ||
997 | p_ptr = port_lock(ref); | 997 | p_ptr = tipc_port_lock(ref); |
998 | if (p_ptr) { | 998 | if (p_ptr) { |
999 | up_ptr = p_ptr->user_port; | 999 | up_ptr = p_ptr->user_port; |
1000 | if (up_ptr) { | 1000 | if (up_ptr) { |
1001 | cb = up_ptr->continue_event_cb; | 1001 | cb = up_ptr->continue_event_cb; |
1002 | uh = up_ptr->usr_handle; | 1002 | uh = up_ptr->usr_handle; |
1003 | } | 1003 | } |
1004 | port_unlock(p_ptr); | 1004 | tipc_port_unlock(p_ptr); |
1005 | } | 1005 | } |
1006 | if (cb) | 1006 | if (cb) |
1007 | cb(uh, ref); | 1007 | cb(uh, ref); |
@@ -1010,7 +1010,7 @@ static void port_wakeup_sh(unsigned long ref) | |||
1010 | 1010 | ||
1011 | static void port_wakeup(struct tipc_port *p_ptr) | 1011 | static void port_wakeup(struct tipc_port *p_ptr) |
1012 | { | 1012 | { |
1013 | k_signal((Handler)port_wakeup_sh, p_ptr->ref); | 1013 | tipc_k_signal((Handler)port_wakeup_sh, p_ptr->ref); |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | void tipc_acknowledge(u32 ref, u32 ack) | 1016 | void tipc_acknowledge(u32 ref, u32 ack) |
@@ -1018,7 +1018,7 @@ void tipc_acknowledge(u32 ref, u32 ack) | |||
1018 | struct port *p_ptr; | 1018 | struct port *p_ptr; |
1019 | struct sk_buff *buf = 0; | 1019 | struct sk_buff *buf = 0; |
1020 | 1020 | ||
1021 | p_ptr = port_lock(ref); | 1021 | p_ptr = tipc_port_lock(ref); |
1022 | if (!p_ptr) | 1022 | if (!p_ptr) |
1023 | return; | 1023 | return; |
1024 | if (p_ptr->publ.connected) { | 1024 | if (p_ptr->publ.connected) { |
@@ -1033,8 +1033,8 @@ void tipc_acknowledge(u32 ref, u32 ack) | |||
1033 | port_out_seqno(p_ptr), | 1033 | port_out_seqno(p_ptr), |
1034 | ack); | 1034 | ack); |
1035 | } | 1035 | } |
1036 | port_unlock(p_ptr); | 1036 | tipc_port_unlock(p_ptr); |
1037 | net_route_msg(buf); | 1037 | tipc_net_route_msg(buf); |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | /* | 1040 | /* |
@@ -1063,7 +1063,7 @@ int tipc_createport(u32 user_ref, | |||
1063 | return -ENOMEM; | 1063 | return -ENOMEM; |
1064 | } | 1064 | } |
1065 | ref = tipc_createport_raw(0, port_dispatcher, port_wakeup, importance); | 1065 | ref = tipc_createport_raw(0, port_dispatcher, port_wakeup, importance); |
1066 | p_ptr = port_lock(ref); | 1066 | p_ptr = tipc_port_lock(ref); |
1067 | if (!p_ptr) { | 1067 | if (!p_ptr) { |
1068 | kfree(up_ptr); | 1068 | kfree(up_ptr); |
1069 | return -ENOMEM; | 1069 | return -ENOMEM; |
@@ -1081,10 +1081,10 @@ int tipc_createport(u32 user_ref, | |||
1081 | up_ptr->conn_msg_cb = conn_msg_cb; | 1081 | up_ptr->conn_msg_cb = conn_msg_cb; |
1082 | up_ptr->continue_event_cb = continue_event_cb; | 1082 | up_ptr->continue_event_cb = continue_event_cb; |
1083 | INIT_LIST_HEAD(&up_ptr->uport_list); | 1083 | INIT_LIST_HEAD(&up_ptr->uport_list); |
1084 | reg_add_port(up_ptr); | 1084 | tipc_reg_add_port(up_ptr); |
1085 | *portref = p_ptr->publ.ref; | 1085 | *portref = p_ptr->publ.ref; |
1086 | dbg(" tipc_createport: %x with ref %u\n", p_ptr, p_ptr->publ.ref); | 1086 | dbg(" tipc_createport: %x with ref %u\n", p_ptr, p_ptr->publ.ref); |
1087 | port_unlock(p_ptr); | 1087 | tipc_port_unlock(p_ptr); |
1088 | return TIPC_OK; | 1088 | return TIPC_OK; |
1089 | } | 1089 | } |
1090 | 1090 | ||
@@ -1099,7 +1099,7 @@ int tipc_portimportance(u32 ref, unsigned int *importance) | |||
1099 | { | 1099 | { |
1100 | struct port *p_ptr; | 1100 | struct port *p_ptr; |
1101 | 1101 | ||
1102 | p_ptr = port_lock(ref); | 1102 | p_ptr = tipc_port_lock(ref); |
1103 | if (!p_ptr) | 1103 | if (!p_ptr) |
1104 | return -EINVAL; | 1104 | return -EINVAL; |
1105 | *importance = (unsigned int)msg_importance(&p_ptr->publ.phdr); | 1105 | *importance = (unsigned int)msg_importance(&p_ptr->publ.phdr); |
@@ -1114,7 +1114,7 @@ int tipc_set_portimportance(u32 ref, unsigned int imp) | |||
1114 | if (imp > TIPC_CRITICAL_IMPORTANCE) | 1114 | if (imp > TIPC_CRITICAL_IMPORTANCE) |
1115 | return -EINVAL; | 1115 | return -EINVAL; |
1116 | 1116 | ||
1117 | p_ptr = port_lock(ref); | 1117 | p_ptr = tipc_port_lock(ref); |
1118 | if (!p_ptr) | 1118 | if (!p_ptr) |
1119 | return -EINVAL; | 1119 | return -EINVAL; |
1120 | msg_set_importance(&p_ptr->publ.phdr, (u32)imp); | 1120 | msg_set_importance(&p_ptr->publ.phdr, (u32)imp); |
@@ -1130,7 +1130,7 @@ int tipc_publish(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1130 | u32 key; | 1130 | u32 key; |
1131 | int res = -EINVAL; | 1131 | int res = -EINVAL; |
1132 | 1132 | ||
1133 | p_ptr = port_lock(ref); | 1133 | p_ptr = tipc_port_lock(ref); |
1134 | dbg("tipc_publ %u, p_ptr = %x, conn = %x, scope = %x, " | 1134 | dbg("tipc_publ %u, p_ptr = %x, conn = %x, scope = %x, " |
1135 | "lower = %u, upper = %u\n", | 1135 | "lower = %u, upper = %u\n", |
1136 | ref, p_ptr, p_ptr->publ.connected, scope, seq->lower, seq->upper); | 1136 | ref, p_ptr, p_ptr->publ.connected, scope, seq->lower, seq->upper); |
@@ -1147,8 +1147,8 @@ int tipc_publish(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1147 | res = -EADDRINUSE; | 1147 | res = -EADDRINUSE; |
1148 | goto exit; | 1148 | goto exit; |
1149 | } | 1149 | } |
1150 | publ = nametbl_publish(seq->type, seq->lower, seq->upper, | 1150 | publ = tipc_nametbl_publish(seq->type, seq->lower, seq->upper, |
1151 | scope, p_ptr->publ.ref, key); | 1151 | scope, p_ptr->publ.ref, key); |
1152 | if (publ) { | 1152 | if (publ) { |
1153 | list_add(&publ->pport_list, &p_ptr->publications); | 1153 | list_add(&publ->pport_list, &p_ptr->publications); |
1154 | p_ptr->pub_count++; | 1154 | p_ptr->pub_count++; |
@@ -1156,7 +1156,7 @@ int tipc_publish(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1156 | res = TIPC_OK; | 1156 | res = TIPC_OK; |
1157 | } | 1157 | } |
1158 | exit: | 1158 | exit: |
1159 | port_unlock(p_ptr); | 1159 | tipc_port_unlock(p_ptr); |
1160 | return res; | 1160 | return res; |
1161 | } | 1161 | } |
1162 | 1162 | ||
@@ -1167,7 +1167,7 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1167 | struct publication *tpubl; | 1167 | struct publication *tpubl; |
1168 | int res = -EINVAL; | 1168 | int res = -EINVAL; |
1169 | 1169 | ||
1170 | p_ptr = port_lock(ref); | 1170 | p_ptr = tipc_port_lock(ref); |
1171 | if (!p_ptr) | 1171 | if (!p_ptr) |
1172 | return -EINVAL; | 1172 | return -EINVAL; |
1173 | if (!p_ptr->publ.published) | 1173 | if (!p_ptr->publ.published) |
@@ -1175,8 +1175,8 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1175 | if (!seq) { | 1175 | if (!seq) { |
1176 | list_for_each_entry_safe(publ, tpubl, | 1176 | list_for_each_entry_safe(publ, tpubl, |
1177 | &p_ptr->publications, pport_list) { | 1177 | &p_ptr->publications, pport_list) { |
1178 | nametbl_withdraw(publ->type, publ->lower, | 1178 | tipc_nametbl_withdraw(publ->type, publ->lower, |
1179 | publ->ref, publ->key); | 1179 | publ->ref, publ->key); |
1180 | } | 1180 | } |
1181 | res = TIPC_OK; | 1181 | res = TIPC_OK; |
1182 | } else { | 1182 | } else { |
@@ -1190,8 +1190,8 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1190 | continue; | 1190 | continue; |
1191 | if (publ->upper != seq->upper) | 1191 | if (publ->upper != seq->upper) |
1192 | break; | 1192 | break; |
1193 | nametbl_withdraw(publ->type, publ->lower, | 1193 | tipc_nametbl_withdraw(publ->type, publ->lower, |
1194 | publ->ref, publ->key); | 1194 | publ->ref, publ->key); |
1195 | res = TIPC_OK; | 1195 | res = TIPC_OK; |
1196 | break; | 1196 | break; |
1197 | } | 1197 | } |
@@ -1199,7 +1199,7 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) | |||
1199 | if (list_empty(&p_ptr->publications)) | 1199 | if (list_empty(&p_ptr->publications)) |
1200 | p_ptr->publ.published = 0; | 1200 | p_ptr->publ.published = 0; |
1201 | exit: | 1201 | exit: |
1202 | port_unlock(p_ptr); | 1202 | tipc_port_unlock(p_ptr); |
1203 | return res; | 1203 | return res; |
1204 | } | 1204 | } |
1205 | 1205 | ||
@@ -1209,7 +1209,7 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer) | |||
1209 | struct tipc_msg *msg; | 1209 | struct tipc_msg *msg; |
1210 | int res = -EINVAL; | 1210 | int res = -EINVAL; |
1211 | 1211 | ||
1212 | p_ptr = port_lock(ref); | 1212 | p_ptr = tipc_port_lock(ref); |
1213 | if (!p_ptr) | 1213 | if (!p_ptr) |
1214 | return -EINVAL; | 1214 | return -EINVAL; |
1215 | if (p_ptr->publ.published || p_ptr->publ.connected) | 1215 | if (p_ptr->publ.published || p_ptr->publ.connected) |
@@ -1234,13 +1234,13 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer) | |||
1234 | p_ptr->publ.connected = 1; | 1234 | p_ptr->publ.connected = 1; |
1235 | k_start_timer(&p_ptr->timer, p_ptr->probing_interval); | 1235 | k_start_timer(&p_ptr->timer, p_ptr->probing_interval); |
1236 | 1236 | ||
1237 | nodesub_subscribe(&p_ptr->subscription,peer->node, | 1237 | tipc_nodesub_subscribe(&p_ptr->subscription,peer->node, |
1238 | (void *)(unsigned long)ref, | 1238 | (void *)(unsigned long)ref, |
1239 | (net_ev_handler)port_handle_node_down); | 1239 | (net_ev_handler)port_handle_node_down); |
1240 | res = TIPC_OK; | 1240 | res = TIPC_OK; |
1241 | exit: | 1241 | exit: |
1242 | port_unlock(p_ptr); | 1242 | tipc_port_unlock(p_ptr); |
1243 | p_ptr->max_pkt = link_get_max_pkt(peer->node, ref); | 1243 | p_ptr->max_pkt = tipc_link_get_max_pkt(peer->node, ref); |
1244 | return res; | 1244 | return res; |
1245 | } | 1245 | } |
1246 | 1246 | ||
@@ -1254,16 +1254,16 @@ int tipc_disconnect(u32 ref) | |||
1254 | struct port *p_ptr; | 1254 | struct port *p_ptr; |
1255 | int res = -ENOTCONN; | 1255 | int res = -ENOTCONN; |
1256 | 1256 | ||
1257 | p_ptr = port_lock(ref); | 1257 | p_ptr = tipc_port_lock(ref); |
1258 | if (!p_ptr) | 1258 | if (!p_ptr) |
1259 | return -EINVAL; | 1259 | return -EINVAL; |
1260 | if (p_ptr->publ.connected) { | 1260 | if (p_ptr->publ.connected) { |
1261 | p_ptr->publ.connected = 0; | 1261 | p_ptr->publ.connected = 0; |
1262 | /* let timer expire on it's own to avoid deadlock! */ | 1262 | /* let timer expire on it's own to avoid deadlock! */ |
1263 | nodesub_unsubscribe(&p_ptr->subscription); | 1263 | tipc_nodesub_unsubscribe(&p_ptr->subscription); |
1264 | res = TIPC_OK; | 1264 | res = TIPC_OK; |
1265 | } | 1265 | } |
1266 | port_unlock(p_ptr); | 1266 | tipc_port_unlock(p_ptr); |
1267 | return res; | 1267 | return res; |
1268 | } | 1268 | } |
1269 | 1269 | ||
@@ -1275,7 +1275,7 @@ int tipc_shutdown(u32 ref) | |||
1275 | struct port *p_ptr; | 1275 | struct port *p_ptr; |
1276 | struct sk_buff *buf = 0; | 1276 | struct sk_buff *buf = 0; |
1277 | 1277 | ||
1278 | p_ptr = port_lock(ref); | 1278 | p_ptr = tipc_port_lock(ref); |
1279 | if (!p_ptr) | 1279 | if (!p_ptr) |
1280 | return -EINVAL; | 1280 | return -EINVAL; |
1281 | 1281 | ||
@@ -1293,8 +1293,8 @@ int tipc_shutdown(u32 ref) | |||
1293 | port_out_seqno(p_ptr), | 1293 | port_out_seqno(p_ptr), |
1294 | 0); | 1294 | 0); |
1295 | } | 1295 | } |
1296 | port_unlock(p_ptr); | 1296 | tipc_port_unlock(p_ptr); |
1297 | net_route_msg(buf); | 1297 | tipc_net_route_msg(buf); |
1298 | return tipc_disconnect(ref); | 1298 | return tipc_disconnect(ref); |
1299 | } | 1299 | } |
1300 | 1300 | ||
@@ -1302,11 +1302,11 @@ int tipc_isconnected(u32 ref, int *isconnected) | |||
1302 | { | 1302 | { |
1303 | struct port *p_ptr; | 1303 | struct port *p_ptr; |
1304 | 1304 | ||
1305 | p_ptr = port_lock(ref); | 1305 | p_ptr = tipc_port_lock(ref); |
1306 | if (!p_ptr) | 1306 | if (!p_ptr) |
1307 | return -EINVAL; | 1307 | return -EINVAL; |
1308 | *isconnected = p_ptr->publ.connected; | 1308 | *isconnected = p_ptr->publ.connected; |
1309 | port_unlock(p_ptr); | 1309 | tipc_port_unlock(p_ptr); |
1310 | return TIPC_OK; | 1310 | return TIPC_OK; |
1311 | } | 1311 | } |
1312 | 1312 | ||
@@ -1315,7 +1315,7 @@ int tipc_peer(u32 ref, struct tipc_portid *peer) | |||
1315 | struct port *p_ptr; | 1315 | struct port *p_ptr; |
1316 | int res; | 1316 | int res; |
1317 | 1317 | ||
1318 | p_ptr = port_lock(ref); | 1318 | p_ptr = tipc_port_lock(ref); |
1319 | if (!p_ptr) | 1319 | if (!p_ptr) |
1320 | return -EINVAL; | 1320 | return -EINVAL; |
1321 | if (p_ptr->publ.connected) { | 1321 | if (p_ptr->publ.connected) { |
@@ -1324,23 +1324,23 @@ int tipc_peer(u32 ref, struct tipc_portid *peer) | |||
1324 | res = TIPC_OK; | 1324 | res = TIPC_OK; |
1325 | } else | 1325 | } else |
1326 | res = -ENOTCONN; | 1326 | res = -ENOTCONN; |
1327 | port_unlock(p_ptr); | 1327 | tipc_port_unlock(p_ptr); |
1328 | return res; | 1328 | return res; |
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | int tipc_ref_valid(u32 ref) | 1331 | int tipc_ref_valid(u32 ref) |
1332 | { | 1332 | { |
1333 | /* Works irrespective of type */ | 1333 | /* Works irrespective of type */ |
1334 | return !!ref_deref(ref); | 1334 | return !!tipc_ref_deref(ref); |
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | 1337 | ||
1338 | /* | 1338 | /* |
1339 | * port_recv_sections(): Concatenate and deliver sectioned | 1339 | * tipc_port_recv_sections(): Concatenate and deliver sectioned |
1340 | * message for this node. | 1340 | * message for this node. |
1341 | */ | 1341 | */ |
1342 | 1342 | ||
1343 | int port_recv_sections(struct port *sender, unsigned int num_sect, | 1343 | int tipc_port_recv_sections(struct port *sender, unsigned int num_sect, |
1344 | struct iovec const *msg_sect) | 1344 | struct iovec const *msg_sect) |
1345 | { | 1345 | { |
1346 | struct sk_buff *buf; | 1346 | struct sk_buff *buf; |
@@ -1349,7 +1349,7 @@ int port_recv_sections(struct port *sender, unsigned int num_sect, | |||
1349 | res = msg_build(&sender->publ.phdr, msg_sect, num_sect, | 1349 | res = msg_build(&sender->publ.phdr, msg_sect, num_sect, |
1350 | MAX_MSG_SIZE, !sender->user_port, &buf); | 1350 | MAX_MSG_SIZE, !sender->user_port, &buf); |
1351 | if (likely(buf)) | 1351 | if (likely(buf)) |
1352 | port_recv_msg(buf); | 1352 | tipc_port_recv_msg(buf); |
1353 | return res; | 1353 | return res; |
1354 | } | 1354 | } |
1355 | 1355 | ||
@@ -1363,18 +1363,18 @@ int tipc_send(u32 ref, unsigned int num_sect, struct iovec const *msg_sect) | |||
1363 | u32 destnode; | 1363 | u32 destnode; |
1364 | int res; | 1364 | int res; |
1365 | 1365 | ||
1366 | p_ptr = port_deref(ref); | 1366 | p_ptr = tipc_port_deref(ref); |
1367 | if (!p_ptr || !p_ptr->publ.connected) | 1367 | if (!p_ptr || !p_ptr->publ.connected) |
1368 | return -EINVAL; | 1368 | return -EINVAL; |
1369 | 1369 | ||
1370 | p_ptr->publ.congested = 1; | 1370 | p_ptr->publ.congested = 1; |
1371 | if (!port_congested(p_ptr)) { | 1371 | if (!tipc_port_congested(p_ptr)) { |
1372 | destnode = port_peernode(p_ptr); | 1372 | destnode = port_peernode(p_ptr); |
1373 | if (likely(destnode != tipc_own_addr)) | 1373 | if (likely(destnode != tipc_own_addr)) |
1374 | res = link_send_sections_fast(p_ptr, msg_sect, num_sect, | 1374 | res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect, |
1375 | destnode); | 1375 | destnode); |
1376 | else | 1376 | else |
1377 | res = port_recv_sections(p_ptr, num_sect, msg_sect); | 1377 | res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect); |
1378 | 1378 | ||
1379 | if (likely(res != -ELINKCONG)) { | 1379 | if (likely(res != -ELINKCONG)) { |
1380 | port_incr_out_seqno(p_ptr); | 1380 | port_incr_out_seqno(p_ptr); |
@@ -1404,7 +1404,7 @@ int tipc_send_buf(u32 ref, struct sk_buff *buf, unsigned int dsz) | |||
1404 | u32 sz; | 1404 | u32 sz; |
1405 | u32 res; | 1405 | u32 res; |
1406 | 1406 | ||
1407 | p_ptr = port_deref(ref); | 1407 | p_ptr = tipc_port_deref(ref); |
1408 | if (!p_ptr || !p_ptr->publ.connected) | 1408 | if (!p_ptr || !p_ptr->publ.connected) |
1409 | return -EINVAL; | 1409 | return -EINVAL; |
1410 | 1410 | ||
@@ -1419,11 +1419,11 @@ int tipc_send_buf(u32 ref, struct sk_buff *buf, unsigned int dsz) | |||
1419 | memcpy(buf->data, (unchar *)msg, hsz); | 1419 | memcpy(buf->data, (unchar *)msg, hsz); |
1420 | destnode = msg_destnode(msg); | 1420 | destnode = msg_destnode(msg); |
1421 | p_ptr->publ.congested = 1; | 1421 | p_ptr->publ.congested = 1; |
1422 | if (!port_congested(p_ptr)) { | 1422 | if (!tipc_port_congested(p_ptr)) { |
1423 | if (likely(destnode != tipc_own_addr)) | 1423 | if (likely(destnode != tipc_own_addr)) |
1424 | res = tipc_send_buf_fast(buf, destnode); | 1424 | res = tipc_send_buf_fast(buf, destnode); |
1425 | else { | 1425 | else { |
1426 | port_recv_msg(buf); | 1426 | tipc_port_recv_msg(buf); |
1427 | res = sz; | 1427 | res = sz; |
1428 | } | 1428 | } |
1429 | if (likely(res != -ELINKCONG)) { | 1429 | if (likely(res != -ELINKCONG)) { |
@@ -1458,7 +1458,7 @@ int tipc_forward2name(u32 ref, | |||
1458 | u32 destport = 0; | 1458 | u32 destport = 0; |
1459 | int res; | 1459 | int res; |
1460 | 1460 | ||
1461 | p_ptr = port_deref(ref); | 1461 | p_ptr = tipc_port_deref(ref); |
1462 | if (!p_ptr || p_ptr->publ.connected) | 1462 | if (!p_ptr || p_ptr->publ.connected) |
1463 | return -EINVAL; | 1463 | return -EINVAL; |
1464 | 1464 | ||
@@ -1472,16 +1472,16 @@ int tipc_forward2name(u32 ref, | |||
1472 | msg_set_lookup_scope(msg, addr_scope(domain)); | 1472 | msg_set_lookup_scope(msg, addr_scope(domain)); |
1473 | if (importance <= TIPC_CRITICAL_IMPORTANCE) | 1473 | if (importance <= TIPC_CRITICAL_IMPORTANCE) |
1474 | msg_set_importance(msg,importance); | 1474 | msg_set_importance(msg,importance); |
1475 | destport = nametbl_translate(name->type, name->instance, &destnode); | 1475 | destport = tipc_nametbl_translate(name->type, name->instance, &destnode); |
1476 | msg_set_destnode(msg, destnode); | 1476 | msg_set_destnode(msg, destnode); |
1477 | msg_set_destport(msg, destport); | 1477 | msg_set_destport(msg, destport); |
1478 | 1478 | ||
1479 | if (likely(destport || destnode)) { | 1479 | if (likely(destport || destnode)) { |
1480 | p_ptr->sent++; | 1480 | p_ptr->sent++; |
1481 | if (likely(destnode == tipc_own_addr)) | 1481 | if (likely(destnode == tipc_own_addr)) |
1482 | return port_recv_sections(p_ptr, num_sect, msg_sect); | 1482 | return tipc_port_recv_sections(p_ptr, num_sect, msg_sect); |
1483 | res = link_send_sections_fast(p_ptr, msg_sect, num_sect, | 1483 | res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect, |
1484 | destnode); | 1484 | destnode); |
1485 | if (likely(res != -ELINKCONG)) | 1485 | if (likely(res != -ELINKCONG)) |
1486 | return res; | 1486 | return res; |
1487 | if (port_unreliable(p_ptr)) { | 1487 | if (port_unreliable(p_ptr)) { |
@@ -1490,8 +1490,8 @@ int tipc_forward2name(u32 ref, | |||
1490 | } | 1490 | } |
1491 | return -ELINKCONG; | 1491 | return -ELINKCONG; |
1492 | } | 1492 | } |
1493 | return port_reject_sections(p_ptr, msg, msg_sect, num_sect, | 1493 | return tipc_port_reject_sections(p_ptr, msg, msg_sect, num_sect, |
1494 | TIPC_ERR_NO_NAME); | 1494 | TIPC_ERR_NO_NAME); |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | /** | 1497 | /** |
@@ -1530,7 +1530,7 @@ int tipc_forward_buf2name(u32 ref, | |||
1530 | u32 destport = 0; | 1530 | u32 destport = 0; |
1531 | int res; | 1531 | int res; |
1532 | 1532 | ||
1533 | p_ptr = (struct port *)ref_deref(ref); | 1533 | p_ptr = (struct port *)tipc_ref_deref(ref); |
1534 | if (!p_ptr || p_ptr->publ.connected) | 1534 | if (!p_ptr || p_ptr->publ.connected) |
1535 | return -EINVAL; | 1535 | return -EINVAL; |
1536 | 1536 | ||
@@ -1545,7 +1545,7 @@ int tipc_forward_buf2name(u32 ref, | |||
1545 | msg_set_lookup_scope(msg, addr_scope(domain)); | 1545 | msg_set_lookup_scope(msg, addr_scope(domain)); |
1546 | msg_set_hdr_sz(msg, LONG_H_SIZE); | 1546 | msg_set_hdr_sz(msg, LONG_H_SIZE); |
1547 | msg_set_size(msg, LONG_H_SIZE + dsz); | 1547 | msg_set_size(msg, LONG_H_SIZE + dsz); |
1548 | destport = nametbl_translate(name->type, name->instance, &destnode); | 1548 | destport = tipc_nametbl_translate(name->type, name->instance, &destnode); |
1549 | msg_set_destnode(msg, destnode); | 1549 | msg_set_destnode(msg, destnode); |
1550 | msg_set_destport(msg, destport); | 1550 | msg_set_destport(msg, destport); |
1551 | msg_dbg(msg, "forw2name ==> "); | 1551 | msg_dbg(msg, "forw2name ==> "); |
@@ -1557,7 +1557,7 @@ int tipc_forward_buf2name(u32 ref, | |||
1557 | if (likely(destport || destnode)) { | 1557 | if (likely(destport || destnode)) { |
1558 | p_ptr->sent++; | 1558 | p_ptr->sent++; |
1559 | if (destnode == tipc_own_addr) | 1559 | if (destnode == tipc_own_addr) |
1560 | return port_recv_msg(buf); | 1560 | return tipc_port_recv_msg(buf); |
1561 | res = tipc_send_buf_fast(buf, destnode); | 1561 | res = tipc_send_buf_fast(buf, destnode); |
1562 | if (likely(res != -ELINKCONG)) | 1562 | if (likely(res != -ELINKCONG)) |
1563 | return res; | 1563 | return res; |
@@ -1601,7 +1601,7 @@ int tipc_forward2port(u32 ref, | |||
1601 | struct tipc_msg *msg; | 1601 | struct tipc_msg *msg; |
1602 | int res; | 1602 | int res; |
1603 | 1603 | ||
1604 | p_ptr = port_deref(ref); | 1604 | p_ptr = tipc_port_deref(ref); |
1605 | if (!p_ptr || p_ptr->publ.connected) | 1605 | if (!p_ptr || p_ptr->publ.connected) |
1606 | return -EINVAL; | 1606 | return -EINVAL; |
1607 | 1607 | ||
@@ -1616,8 +1616,8 @@ int tipc_forward2port(u32 ref, | |||
1616 | msg_set_importance(msg, importance); | 1616 | msg_set_importance(msg, importance); |
1617 | p_ptr->sent++; | 1617 | p_ptr->sent++; |
1618 | if (dest->node == tipc_own_addr) | 1618 | if (dest->node == tipc_own_addr) |
1619 | return port_recv_sections(p_ptr, num_sect, msg_sect); | 1619 | return tipc_port_recv_sections(p_ptr, num_sect, msg_sect); |
1620 | res = link_send_sections_fast(p_ptr, msg_sect, num_sect, dest->node); | 1620 | res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect, dest->node); |
1621 | if (likely(res != -ELINKCONG)) | 1621 | if (likely(res != -ELINKCONG)) |
1622 | return res; | 1622 | return res; |
1623 | if (port_unreliable(p_ptr)) { | 1623 | if (port_unreliable(p_ptr)) { |
@@ -1658,7 +1658,7 @@ int tipc_forward_buf2port(u32 ref, | |||
1658 | struct tipc_msg *msg; | 1658 | struct tipc_msg *msg; |
1659 | int res; | 1659 | int res; |
1660 | 1660 | ||
1661 | p_ptr = (struct port *)ref_deref(ref); | 1661 | p_ptr = (struct port *)tipc_ref_deref(ref); |
1662 | if (!p_ptr || p_ptr->publ.connected) | 1662 | if (!p_ptr || p_ptr->publ.connected) |
1663 | return -EINVAL; | 1663 | return -EINVAL; |
1664 | 1664 | ||
@@ -1680,7 +1680,7 @@ int tipc_forward_buf2port(u32 ref, | |||
1680 | msg_dbg(msg, "buf2port: "); | 1680 | msg_dbg(msg, "buf2port: "); |
1681 | p_ptr->sent++; | 1681 | p_ptr->sent++; |
1682 | if (dest->node == tipc_own_addr) | 1682 | if (dest->node == tipc_own_addr) |
1683 | return port_recv_msg(buf); | 1683 | return tipc_port_recv_msg(buf); |
1684 | res = tipc_send_buf_fast(buf, dest->node); | 1684 | res = tipc_send_buf_fast(buf, dest->node); |
1685 | if (likely(res != -ELINKCONG)) | 1685 | if (likely(res != -ELINKCONG)) |
1686 | return res; | 1686 | return res; |