Example #1
0
/* called under bridge lock */
static void br_make_forwarding(struct net_bridge_port *p)
{
	if (p->state == BR_STATE_BLOCKING) {
		if (p->br->stp_enabled) {
			printk(KERN_INFO "%s: port %i(%s) entering %s state\n",
			       p->br->dev.name, p->port_no, p->dev->name,
			       "listening");
			p->state = BR_STATE_LISTENING;

#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,2);
		if(0==retval)
			printk("RTL865x Port %d state=LISTENING\n", vlanPort);
		else
			printk("RTL865x port %d set state error=%d", vlanPort, retval);
	}
	
#endif

		} else {
			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;

#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,3);
		if(0==retval)
			printk("RTL865x Port %d state=LEARNING\n", vlanPort);
		else
			printk("RTL865x port %d set state error=%d", vlanPort, retval);
	}
	
#endif
		}
		br_timer_set(&p->forward_delay_timer, jiffies);
	}
}
Example #2
0
/* 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);
}
Example #3
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);
	}
}