14 #include <linux/kernel.h>
17 #include <linux/rtnetlink.h>
33 #define BR_MAX_PORT_PRIORITY ((u16)~0 >> BR_PORT_BITS)
50 spin_lock_bh(&br->
lock);
57 if ((p->
dev->flags &
IFF_UP) && netif_carrier_ok(p->
dev))
61 spin_unlock_bh(&br->
lock);
69 spin_lock_bh(&br->
lock);
78 spin_unlock_bh(&br->
lock);
101 wasroot = br_is_root_bridge(br);
121 if (br_is_root_bridge(br) && !wasroot)
125 static void br_stp_start(
struct net_bridge *br)
129 char *envp[] = {
NULL };
134 br_debug(br,
"userspace STP started\n");
140 spin_lock_bh(&br->
lock);
142 spin_unlock_bh(&br->
lock);
146 static void br_stp_stop(
struct net_bridge *br)
150 char *envp[] = {
NULL };
154 br_info(br,
"userspace STP stopped, return code %d\n", r);
157 spin_lock_bh(&br->
lock);
159 spin_unlock_bh(&br->
lock);
182 unsigned short oldaddr_aligned[
ETH_ALEN >> 1];
183 unsigned char *oldaddr = (
unsigned char *)oldaddr_aligned;
187 wasroot = br_is_root_bridge(br);
203 if (br_is_root_bridge(br) && !wasroot)
208 static const unsigned short br_mac_zero_aligned[
ETH_ALEN >> 1];
213 const unsigned char *br_mac_zero =
214 (
const unsigned char *)br_mac_zero_aligned;
215 const unsigned char *
addr = br_mac_zero;
223 if (addr == br_mac_zero ||
225 addr = p->
dev->dev_addr;
242 wasroot = br_is_root_bridge(br);
246 br_is_designated_port(p)) {
257 if (br_is_root_bridge(br) && !wasroot)
269 new_port_id = br_make_port_id(newprio, p->
port_no);
270 if (br_is_designated_port(p))
299 return sprintf(buf,
"%.2x%.2x.%.2x%.2x%.2x%.2x%.2x%.2x\n",