FreeBSD/sys/arm/cavium/cns11xx/if_ece.c
/*
 * Turn off interrupts, and stop the nic.  Can be called with sc->ifp
 * NULL so be careful.
 */
Turn off interrupts, and stop the nic.  Can be called with sc->ifp
NULL so be careful.
Turn off interrupts and stop the nic . Can be called with sc - > ifp NULL so be careful .
static void
ecestop(struct ece_softc *sc)
{
	struct ifnet *ifp = sc->ifp;
	uint32_t mac_port_config;
	write_4(sc, TS_DMA_CONTROL, 0);
	write_4(sc, FS_DMA_CONTROL, 0);
	if (ifp)
		ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
	callout_stop(&sc->tick_ch);
	mac_port_config = read_4(sc, MAC_PORT_0_CONFIG);
	mac_port_config |= (PORT_DISABLE);
	write_4(sc, MAC_PORT_0_CONFIG, mac_port_config);
	mac_port_config = read_4(sc, MAC_PORT_1_CONFIG);
	mac_port_config |= (PORT_DISABLE);
	write_4(sc, MAC_PORT_1_CONFIG, mac_port_config);
	write_4(sc, INTERRUPT_MASK, 0x00001FFF);
	write_4(sc, INTERRUPT_STATUS, 0x00001FFF);
	write_4(sc, SWITCH_CONFIG, initial_switch_config);
	write_4(sc, CPU_PORT_CONFIG, initial_cpu_config);
	write_4(sc, MAC_PORT_0_CONFIG, initial_port0_config);
	write_4(sc, MAC_PORT_1_CONFIG, initial_port1_config);
	clear_mac_entries(sc, 1);
}
static void ecestop ( struct ece_softc * sc ) { struct ifnet * ifp = sc -> ifp ; uint32_t mac_port_config ; write_4 ( sc , TS_DMA_CONTROL , 0 ) ; write_4 ( sc , FS_DMA_CONTROL , 0 ) ; if ( ifp ) ifp -> if_drv_flags &= ~ ( IFF_DRV_RUNNING | IFF_DRV_OACTIVE ) ; callout_stop ( & sc -> tick_ch ) ; mac_port_config = read_4 ( sc , MAC_PORT_0_CONFIG ) ; mac_port_config |= ( PORT_DISABLE ) ; write_4 ( sc , MAC_PORT_0_CONFIG , mac_port_config ) ; mac_port_config = read_4 ( sc , MAC_PORT_1_CONFIG ) ; mac_port_config |= ( PORT_DISABLE ) ; write_4 ( sc , MAC_PORT_1_CONFIG , mac_port_config ) ; write_4 ( sc , INTERRUPT_MASK , 0x00001FFF ) ; write_4 ( sc , INTERRUPT_STATUS , 0x00001FFF ) ; write_4 ( sc , SWITCH_CONFIG , initial_switch_config ) ; write_4 ( sc , CPU_PORT_CONFIG , initial_cpu_config ) ; write_4 ( sc , MAC_PORT_0_CONFIG , initial_port0_config ) ; write_4 ( sc , MAC_PORT_1_CONFIG , initial_port1_config ) ; clear_mac_entries ( sc , 1 ) ; }
Turn off interrupts, and stop the nic.
Turn off interrupts and stop the nic .
/*Disable Port 0 */ /*Disable Port 1 */ /* Disable all interrupt status sources. */ /* Clear previous interrupt sources. */