| @@ -87,6 +87,7 @@ struct bcbearer { · 86 unmodified lines |
| 87 | 87 | * struct bclink - link used for broadcast messages |
| 88 | 88 | * @link: (non-standard) broadcast link structure |
| 89 | 89 | * @node: (non-standard) node structure representing b'cast link's peer node |
| 90 | + * @bcast_nodes: map of broadcast-capable nodes |
| 90 | 91 | * @retransmit_to: node that most recently requested a retransmit |
| 91 | 92 | * |
| 92 | 93 | * Handles sequence numbering, fragmentation, bundling, etc. |
| @@ -95,6 +96,7 @@ struct bcbearer { · 2 unmodified lines |
| 95 | 96 | struct bclink { |
| 96 | 97 | struct link link; |
| 97 | 98 | struct tipc_node node; |
| 99 | + struct tipc_node_map bcast_nodes; |
| 98 | 100 | struct tipc_node *retransmit_to; |
| 99 | 101 | }; |
| 100 | 102 | |
| @@ -107,9 +109,6 @@ static struct link *bcl = &bcast_link.link; · 6 unmodified lines |
| 107 | 109 | |
| 108 | 110 | static DEFINE_SPINLOCK(bc_lock); |
| 109 | 111 | |
| 110 | | −/* broadcast-capable node map */ |
| 111 | | −struct tipc_node_map tipc_bcast_nmap; |
| 112 | | − |
| 113 | 112 | const char tipc_bclink_name[] = "broadcast-link"; |
| 114 | 113 | |
| 115 | 114 | static void tipc_nmap_diff(struct tipc_node_map *nm_a, |
| @@ -136,6 +135,19 @@ static void bcbuf_decr_acks(struct sk_buff *buf) · 20 unmodified lines |
| 136 | 135 | bcbuf_set_acks(buf, bcbuf_acks(buf) - 1); |
| 137 | 136 | } |
| 138 | 137 | |
| 138 | +void tipc_bclink_add_node(u32 addr) |
| 139 | +{ |
| 140 | + spin_lock_bh(&bc_lock); |
| 141 | + tipc_nmap_add(&bclink->bcast_nodes, addr); |
| 142 | + spin_unlock_bh(&bc_lock); |
| 143 | +} |
| 144 | + |
| 145 | +void tipc_bclink_remove_node(u32 addr) |
| 146 | +{ |
| 147 | + spin_lock_bh(&bc_lock); |
| 148 | + tipc_nmap_remove(&bclink->bcast_nodes, addr); |
| 149 | + spin_unlock_bh(&bc_lock); |
| 150 | +} |
| 139 | 151 | |
| 140 | 152 | static void bclink_set_last_sent(void) |
| 141 | 153 | { |
| @@ -575,13 +587,13 @@ static int tipc_bcbearer_send(struct sk_buff *buf, · 433 unmodified lines |
| 575 | 587 | if (likely(!msg_non_seq(buf_msg(buf)))) { |
| 576 | 588 | struct tipc_msg *msg; |
| 577 | 589 | |
| 578 | | − bcbuf_set_acks(buf, tipc_bcast_nmap.count); |
| 590 | + bcbuf_set_acks(buf, bclink->bcast_nodes.count); |
| 579 | 591 | msg = buf_msg(buf); |
| 580 | 592 | msg_set_non_seq(msg, 1); |
| 581 | 593 | msg_set_mc_netid(msg, tipc_net_id); |
| 582 | 594 | bcl->stats.sent_info++; |
| 583 | 595 | |
| 584 | | − if (WARN_ON(!tipc_bcast_nmap.count)) { |
| 596 | + if (WARN_ON(!bclink->bcast_nodes.count)) { |
| 585 | 597 | dump_stack(); |
| 586 | 598 | return 0; |
| 587 | 599 | } |
| @@ -589,7 +601,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf, · 1 unmodified line |
| 589 | 601 | |
| 590 | 602 | /* Send buffer over bearers until all targets reached */ |
| 591 | 603 | |
| 592 | | − bcbearer->remains = tipc_bcast_nmap; |
| 604 | + bcbearer->remains = bclink->bcast_nodes; |
| 593 | 605 | |
| 594 | 606 | for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { |
| 595 | 607 | struct tipc_bearer *p = bcbearer->bpairs[bp_index].primary; |