Lines Matching +full:1 +full:br +full:- +full:10

1 // SPDX-License-Identifier: GPL-2.0-or-later
44 skb->dev = p->dev; in br_send_bpdu()
45 skb->protocol = htons(ETH_P_802_2); in br_send_bpdu()
46 skb->priority = TC_PRIO_CONTROL; in br_send_bpdu()
55 llc_mac_hdr_init(skb, p->dev->dev_addr, p->br->group_addr); in br_send_bpdu()
60 dev_net(p->dev), NULL, skb, NULL, skb->dev, in br_send_bpdu()
83 if (p->br->stp_enabled != BR_KERNEL_STP) in br_send_config_bpdu()
87 buf[1] = 0; in br_send_config_bpdu()
90 buf[4] = (bpdu->topology_change ? 0x01 : 0) | in br_send_config_bpdu()
91 (bpdu->topology_change_ack ? 0x80 : 0); in br_send_config_bpdu()
92 buf[5] = bpdu->root.prio[0]; in br_send_config_bpdu()
93 buf[6] = bpdu->root.prio[1]; in br_send_config_bpdu()
94 buf[7] = bpdu->root.addr[0]; in br_send_config_bpdu()
95 buf[8] = bpdu->root.addr[1]; in br_send_config_bpdu()
96 buf[9] = bpdu->root.addr[2]; in br_send_config_bpdu()
97 buf[10] = bpdu->root.addr[3]; in br_send_config_bpdu()
98 buf[11] = bpdu->root.addr[4]; in br_send_config_bpdu()
99 buf[12] = bpdu->root.addr[5]; in br_send_config_bpdu()
100 buf[13] = (bpdu->root_path_cost >> 24) & 0xFF; in br_send_config_bpdu()
101 buf[14] = (bpdu->root_path_cost >> 16) & 0xFF; in br_send_config_bpdu()
102 buf[15] = (bpdu->root_path_cost >> 8) & 0xFF; in br_send_config_bpdu()
103 buf[16] = bpdu->root_path_cost & 0xFF; in br_send_config_bpdu()
104 buf[17] = bpdu->bridge_id.prio[0]; in br_send_config_bpdu()
105 buf[18] = bpdu->bridge_id.prio[1]; in br_send_config_bpdu()
106 buf[19] = bpdu->bridge_id.addr[0]; in br_send_config_bpdu()
107 buf[20] = bpdu->bridge_id.addr[1]; in br_send_config_bpdu()
108 buf[21] = bpdu->bridge_id.addr[2]; in br_send_config_bpdu()
109 buf[22] = bpdu->bridge_id.addr[3]; in br_send_config_bpdu()
110 buf[23] = bpdu->bridge_id.addr[4]; in br_send_config_bpdu()
111 buf[24] = bpdu->bridge_id.addr[5]; in br_send_config_bpdu()
112 buf[25] = (bpdu->port_id >> 8) & 0xFF; in br_send_config_bpdu()
113 buf[26] = bpdu->port_id & 0xFF; in br_send_config_bpdu()
115 br_set_ticks(buf+27, bpdu->message_age); in br_send_config_bpdu()
116 br_set_ticks(buf+29, bpdu->max_age); in br_send_config_bpdu()
117 br_set_ticks(buf+31, bpdu->hello_time); in br_send_config_bpdu()
118 br_set_ticks(buf+33, bpdu->forward_delay); in br_send_config_bpdu()
122 p->stp_xstats.tx_bpdu++; in br_send_config_bpdu()
130 if (p->br->stp_enabled != BR_KERNEL_STP) in br_send_tcn_bpdu()
134 buf[1] = 0; in br_send_tcn_bpdu()
139 p->stp_xstats.tx_tcn++; in br_send_tcn_bpdu()
151 struct net_bridge *br; in br_stp_rcv() local
158 buf = skb->data; in br_stp_rcv()
159 if (buf[0] != 0 || buf[1] != 0 || buf[2] != 0) in br_stp_rcv()
166 br = p->br; in br_stp_rcv()
167 spin_lock(&br->lock); in br_stp_rcv()
169 if (br->stp_enabled != BR_KERNEL_STP) in br_stp_rcv()
172 if (!(br->dev->flags & IFF_UP)) in br_stp_rcv()
175 if (p->state == BR_STATE_DISABLED) in br_stp_rcv()
178 if (!ether_addr_equal(eth_hdr(skb)->h_dest, br->group_addr)) in br_stp_rcv()
181 if (p->flags & BR_BPDU_GUARD) { in br_stp_rcv()
182 br_notice(br, "BPDU received on blocked port %u(%s)\n", in br_stp_rcv()
183 (unsigned int) p->port_no, p->dev->name); in br_stp_rcv()
196 buf = skb->data; in br_stp_rcv()
197 bpdu.topology_change = (buf[1] & 0x01) ? 1 : 0; in br_stp_rcv()
198 bpdu.topology_change_ack = (buf[1] & 0x80) ? 1 : 0; in br_stp_rcv()
201 bpdu.root.prio[1] = buf[3]; in br_stp_rcv()
203 bpdu.root.addr[1] = buf[5]; in br_stp_rcv()
209 (buf[10] << 24) | in br_stp_rcv()
214 bpdu.bridge_id.prio[1] = buf[15]; in br_stp_rcv()
216 bpdu.bridge_id.addr[1] = buf[17]; in br_stp_rcv()
230 br_notice(p->br, in br_stp_rcv()
233 p->port_no, in br_stp_rcv()
234 eth_hdr(skb)->h_source, in br_stp_rcv()
244 spin_unlock(&br->lock); in br_stp_rcv()