aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/bcast.c
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2011-01-07 13:00:11 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-02-23 18:05:05 -0500
commit2d627b92fd1e39d83c3ee0b9d410403f98cb3981 (patch)
tree38fc08bfe87ed28785c7dd464577e947397dfa7c /net/tipc/bcast.c
parent23dd4cce387124ec3ea06ca30d17854ae4d9b772 (diff)
tipc: Combine bearer structure with tipc_bearer structure
Combines two distinct structures containing information about a TIPC bearer into a single structure. The structures were previously kept separate so that public information about a bearer could be made available to plug-in media types using TIPC's native API, while the remaining information was kept private for use by TIPC itself. However, now that the native API has been removed there is no longer any need for this arrangement. Since one of the structures was already embedded within the other, the change largely involves replacing instances of "publ.foo" with "foo". The changes do not otherwise alter the operation of TIPC bearers. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r--net/tipc/bcast.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 70ab5ef48766..b4d659df465f 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (c) 2004-2006, Ericsson AB 4 * Copyright (c) 2004-2006, Ericsson AB
5 * Copyright (c) 2004, Intel Corporation. 5 * Copyright (c) 2004, Intel Corporation.
6 * Copyright (c) 2005, Wind River Systems 6 * Copyright (c) 2005, 2010-2011, Wind River Systems
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
@@ -61,8 +61,8 @@
61 */ 61 */
62 62
63struct bcbearer_pair { 63struct bcbearer_pair {
64 struct bearer *primary; 64 struct tipc_bearer *primary;
65 struct bearer *secondary; 65 struct tipc_bearer *secondary;
66}; 66};
67 67
68/** 68/**
@@ -81,7 +81,7 @@ struct bcbearer_pair {
81 */ 81 */
82 82
83struct bcbearer { 83struct bcbearer {
84 struct bearer bearer; 84 struct tipc_bearer bearer;
85 struct media media; 85 struct media media;
86 struct bcbearer_pair bpairs[MAX_BEARERS]; 86 struct bcbearer_pair bpairs[MAX_BEARERS];
87 struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; 87 struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];
@@ -574,8 +574,8 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
574 bcbearer->remains = tipc_bcast_nmap; 574 bcbearer->remains = tipc_bcast_nmap;
575 575
576 for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { 576 for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) {
577 struct bearer *p = bcbearer->bpairs[bp_index].primary; 577 struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary;
578 struct bearer *s = bcbearer->bpairs[bp_index].secondary; 578 struct tipc_bearer *s = bcbearer->bpairs[bp_index].secondary;
579 579
580 if (!p) 580 if (!p)
581 break; /* no more bearers to try */ 581 break; /* no more bearers to try */
@@ -584,11 +584,11 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
584 if (bcbearer->remains_new.count == bcbearer->remains.count) 584 if (bcbearer->remains_new.count == bcbearer->remains.count)
585 continue; /* bearer pair doesn't add anything */ 585 continue; /* bearer pair doesn't add anything */
586 586
587 if (p->publ.blocked || 587 if (p->blocked ||
588 p->media->send_msg(buf, &p->publ, &p->media->bcast_addr)) { 588 p->media->send_msg(buf, p, &p->media->bcast_addr)) {
589 /* unable to send on primary bearer */ 589 /* unable to send on primary bearer */
590 if (!s || s->publ.blocked || 590 if (!s || s->blocked ||
591 s->media->send_msg(buf, &s->publ, 591 s->media->send_msg(buf, s,
592 &s->media->bcast_addr)) { 592 &s->media->bcast_addr)) {
593 /* unable to send on either bearer */ 593 /* unable to send on either bearer */
594 continue; 594 continue;
@@ -633,7 +633,7 @@ void tipc_bcbearer_sort(void)
633 memset(bp_temp, 0, sizeof(bcbearer->bpairs_temp)); 633 memset(bp_temp, 0, sizeof(bcbearer->bpairs_temp));
634 634
635 for (b_index = 0; b_index < MAX_BEARERS; b_index++) { 635 for (b_index = 0; b_index < MAX_BEARERS; b_index++) {
636 struct bearer *b = &tipc_bearers[b_index]; 636 struct tipc_bearer *b = &tipc_bearers[b_index];
637 637
638 if (!b->active || !b->nodes.count) 638 if (!b->active || !b->nodes.count)
639 continue; 639 continue;
@@ -682,12 +682,12 @@ void tipc_bcbearer_sort(void)
682 682
683void tipc_bcbearer_push(void) 683void tipc_bcbearer_push(void)
684{ 684{
685 struct bearer *b_ptr; 685 struct tipc_bearer *b_ptr;
686 686
687 spin_lock_bh(&bc_lock); 687 spin_lock_bh(&bc_lock);
688 b_ptr = &bcbearer->bearer; 688 b_ptr = &bcbearer->bearer;
689 if (b_ptr->publ.blocked) { 689 if (b_ptr->blocked) {
690 b_ptr->publ.blocked = 0; 690 b_ptr->blocked = 0;
691 tipc_bearer_lock_push(b_ptr); 691 tipc_bearer_lock_push(b_ptr);
692 } 692 }
693 spin_unlock_bh(&bc_lock); 693 spin_unlock_bh(&bc_lock);