FreeBSD/sys/dev/etherswitch/ip17x/ip175c.c
/*
 * Set the switch VLAN mode.
 */
Set the switch VLAN mode.
Set the switch VLAN mode .
static int
ip175c_set_vlan_mode(struct ip17x_softc *sc, uint32_t mode)
{
	switch (mode) {
	case ETHERSWITCH_VLAN_DOT1Q:
		ip17x_updatephy(sc->sc_dev, 30, 9, 0x80, 0x80);
		sc->vlan_mode = mode;
		break;
	case ETHERSWITCH_VLAN_PORT:
	default:
		ip17x_updatephy(sc->sc_dev, 30, 9, 0x80, 0);
		sc->vlan_mode = ETHERSWITCH_VLAN_PORT;
		break;
	}
	ip17x_reset_vlans(sc, sc->vlan_mode);
	ip175c_hw_setup(sc);
	return (0);
}
static int ip175c_set_vlan_mode ( struct ip17x_softc * sc , uint32_t mode ) { switch ( mode ) { case ETHERSWITCH_VLAN_DOT1Q : ip17x_updatephy ( sc -> sc_dev , 30 , 9 , 0x80 , 0x80 ) ; sc -> vlan_mode = mode ; break ; case ETHERSWITCH_VLAN_PORT : default : ip17x_updatephy ( sc -> sc_dev , 30 , 9 , 0x80 , 0 ) ; sc -> vlan_mode = ETHERSWITCH_VLAN_PORT ; break ; } ip17x_reset_vlans ( sc , sc -> vlan_mode ) ; ip175c_hw_setup ( sc ) ; return ( 0 ) ; }
Set the switch VLAN mode.
Set the switch VLAN mode .
/* Enable VLAN tag processing. */ /* Disable VLAN tag processing. */ /* Reset vlans. */ /* Update switch configuration. */