/* called under bridge lock */ void br_init_port(struct net_bridge_port *p) { p->port_id = br_make_port_id(p); br_become_designated_port(p); p->state = BR_STATE_BLOCKING; #if defined( CONFIG_RTL865X)&&defined(CONFIG_RE865X) { int retval=0, vlanPort; char name[IFNAMSIZ]; strcpy(name, p->dev->name); vlanPort=name[strlen(name)-1]-'0'; retval=rtl8651_setSpanningTreeInstancePortState(0, vlanPort,1); if(0==retval) printk("RTL865x Port %d state=BLOCKING\n", vlanPort); else printk("RTL865x port %d set state error=%d", vlanPort, retval); } #endif p->topology_change_ack = 0; p->config_pending = 0; br_timer_clear(&p->message_age_timer); br_timer_clear(&p->forward_delay_timer); br_timer_clear(&p->hold_timer); }
/* called under bridge lock */ void br_init_port(struct net_bridge_port *p) { p->port_id = br_make_port_id(p); br_become_designated_port(p); p->state = BR_STATE_BLOCKING; p->topology_change_ack = 0; p->config_pending = 0; br_timer_clear(&p->message_age_timer); br_timer_clear(&p->forward_delay_timer); br_timer_clear(&p->hold_timer); }
/* called under bridge lock */ static void br_designated_port_selection(struct net_bridge *br) { struct net_bridge_port *p; p = br->port_list; while (p != NULL) { if (p->state != BR_STATE_DISABLED && br_should_become_designated_port(p)) br_become_designated_port(p); p = p->next; } }
/* called under bridge lock */ void br_stp_disable_port(struct net_bridge_port *p) { struct net_bridge *br; int wasroot; br = p->br; printk(KERN_INFO "%s: port %i(%s) entering %s state\n", br->dev.name, p->port_no, p->dev->name, "disabled"); wasroot = br_is_root_bridge(br); br_become_designated_port(p); p->state = BR_STATE_DISABLED; p->topology_change_ack = 0; p->config_pending = 0; br_timer_clear(&p->message_age_timer); br_timer_clear(&p->forward_delay_timer); br_timer_clear(&p->hold_timer); br_configuration_update(br); br_port_state_selection(br); if (br_is_root_bridge(br) && !wasroot) br_become_root_bridge(br); }
/* called under bridge lock */ static void br_message_age_timer_expired(struct net_bridge_port *p) { struct net_bridge *br; int was_root; br = p->br; printk(KERN_INFO "%s: ", br->dev.name); printk("neighbour "); dump_bridge_id(&p->designated_bridge); printk(" lost on port %i(%s)\n", p->port_no, p->dev->name); /* * According to the spec, the message age timer cannot be * running when we are the root bridge. So.. this was_root * check is redundant. I'm leaving it in for now, though. */ was_root = br_is_root_bridge(br); br_become_designated_port(p); br_configuration_update(br); br_port_state_selection(br); if (br_is_root_bridge(br) && !was_root) br_become_root_bridge(br); }