Exemplo n.º 1
0
/* called under bridge lock */
static void br_make_blocking(struct net_bridge_port *p)
{
	if (p->state != BR_STATE_DISABLED &&
	    p->state != BR_STATE_BLOCKING) {
		if (p->state == BR_STATE_FORWARDING ||
		    p->state == BR_STATE_LEARNING)
			br_topology_change_detection(p->br);

		printk(KERN_INFO "%s: port %i(%s) entering %s state\n",
		       p->br->dev.name, p->port_no, p->dev->name, "blocking");

		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
		br_timer_clear(&p->forward_delay_timer);
	}
}
Exemplo n.º 2
0
/* called under bridge lock */
void br_become_root_bridge(struct net_bridge *br)
{
	br->max_age = br->bridge_max_age;
	br->hello_time = br->bridge_hello_time;
	br->forward_delay = br->bridge_forward_delay;
	br_topology_change_detection(br);
	br_timer_clear(&br->tcn_timer);

	br_timer_set(&br->hello_timer, jiffies - br->hello_time);
}
Exemplo n.º 3
0
/* lock-safe */
void br_received_tcn_bpdu(struct net_bridge_port *p)
{
	read_lock(&p->br->lock);
	if (p->state != BR_STATE_DISABLED &&
	    br_is_designated_port(p)) {
//		printk(KERN_INFO "%s: received tcn bpdu on port %i(%s)\n",
//		       p->br->dev.name, p->port_no, p->dev->name);

		br_topology_change_detection(p->br);
		br_topology_change_acknowledge(p);
	}
	read_unlock(&p->br->lock);
}
Exemplo n.º 4
0
/* called under bridge lock */
static void br_make_blocking(struct net_bridge_port *p)
{
	if (p->state != BR_STATE_DISABLED &&
	    p->state != BR_STATE_BLOCKING) {
		if (p->state == BR_STATE_FORWARDING ||
		    p->state == BR_STATE_LEARNING)
			br_topology_change_detection(p->br);

//		printk(KERN_INFO "%s: port %i(%s) entering %s state\n",
//		       p->br->dev.name, p->port_no, p->dev->name, "blocking");

		p->state = BR_STATE_BLOCKING;
		br_timer_clear(&p->forward_delay_timer);
	}
}
Exemplo n.º 5
0
/* called under bridge lock */
static void br_forward_delay_timer_expired(struct net_bridge_port *p)
{
	if (p->state == BR_STATE_LISTENING) {
		printk(KERN_INFO "%s: port %i(%s) entering %s state\n",
		       p->br->dev.name, p->port_no, p->dev->name, "learning");

		p->state = BR_STATE_LEARNING;
		br_timer_set(&p->forward_delay_timer, jiffies);
	} else if (p->state == BR_STATE_LEARNING) {
		printk(KERN_INFO "%s: port %i(%s) entering %s state\n",
		       p->br->dev.name, p->port_no, p->dev->name, "forwarding");

		p->state = BR_STATE_FORWARDING;
		if (br_is_designated_for_some_port(p->br))
			br_topology_change_detection(p->br);
	}
}