FreeBSD/sys/dev/etherswitch/arswitch/arswitch_8316.c
/*
 * Initialise other global values, for the AR8316.
 */
Initialise other global values, for the AR8316.
Initialise other global values for the AR8316 .
static int
ar8316_hw_global_setup(struct arswitch_softc *sc)
{
	arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC);
	arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT,
	    AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS);
	arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50);
	arswitch_modifyreg(sc->sc_dev, AR8X16_REG_AT_CTRL, 0,
	    AR8X16_AT_CTRL_ARP_EN);
	arswitch_writereg(sc->sc_dev, AR8X16_REG_FLOOD_MASK,
	    AR8X16_FLOOD_MASK_BCAST_TO_CPU | 0x003f003f);
	arswitch_modifyreg(sc->sc_dev, AR8X16_REG_GLOBAL_CTRL,
	    AR8316_GLOBAL_CTRL_MTU_MASK, 9018 + 8 + 2);
	arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG,
	    AR8X16_SERVICE_TAG_MASK, 0);
	return (0);
}
static int ar8316_hw_global_setup ( struct arswitch_softc * sc ) { arswitch_writereg ( sc -> sc_dev , 0x38 , AR8X16_MAGIC ) ; arswitch_writereg ( sc -> sc_dev , AR8X16_REG_CPU_PORT , AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS ) ; arswitch_writereg ( sc -> sc_dev , AR8X16_REG_TAG_PRIO , 0xfa50 ) ; arswitch_modifyreg ( sc -> sc_dev , AR8X16_REG_AT_CTRL , 0 , AR8X16_AT_CTRL_ARP_EN ) ; arswitch_writereg ( sc -> sc_dev , AR8X16_REG_FLOOD_MASK , AR8X16_FLOOD_MASK_BCAST_TO_CPU | 0x003f003f ) ; arswitch_modifyreg ( sc -> sc_dev , AR8X16_REG_GLOBAL_CTRL , AR8316_GLOBAL_CTRL_MTU_MASK , 9018 + 8 + 2 ) ; arswitch_modifyreg ( sc -> sc_dev , AR8X16_REG_SERVICE_TAG , AR8X16_SERVICE_TAG_MASK , 0 ) ; return ( 0 ) ; }
Initialise other global values, for the AR8316.
Initialise other global values for the AR8316 .
/* Enable CPU port and disable mirror port. */ /* Setup TAG priority mapping. */ /* Enable ARP frame acknowledge. */ /*
	 * Flood address table misses to all ports, and enable forwarding of
	 * broadcasts to the cpu port.
	 */ /* Enable jumbo frames. */ /* Setup service TAG. */