FreeBSD/sys/dev/e1000/if_lem.c
/*********************************************************************
 *
 *  This routine disables all traffic on the adapter by issuing a
 *  global reset on the MAC and deallocates TX/RX buffers.
 *
 *  This routine should always be called with BOTH the CORE
 *  and TX locks.
 **********************************************************************/
This routine disables all traffic on the adapter by issuing a
global reset on the MAC and deallocates TX/RX buffers.

This routine should always be called with BOTH the CORE
and TX locks.
This routine disables all traffic on the adapter by issuing a global reset on the MAC and deallocates TX / RX buffers . This routine should always be called with BOTH the CORE and TX locks .
static void
lem_stop(void *arg)
{
	struct adapter	*adapter = arg;
	if_t ifp = adapter->ifp;
	EM_CORE_LOCK_ASSERT(adapter);
	EM_TX_LOCK_ASSERT(adapter);
	INIT_DEBUGOUT("lem_stop: begin");
	lem_disable_intr(adapter);
	callout_stop(&adapter->timer);
	callout_stop(&adapter->tx_fifo_timer);
	if_setdrvflagbits(ifp, 0, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE));
	e1000_reset_hw(&adapter->hw);
	if (adapter->hw.mac.type >= e1000_82544)
		E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0);
	e1000_led_off(&adapter->hw);
	e1000_cleanup_led(&adapter->hw);
}
static void lem_stop ( void * arg ) { struct adapter * adapter = arg ; if_t ifp = adapter -> ifp ; EM_CORE_LOCK_ASSERT ( adapter ) ; EM_TX_LOCK_ASSERT ( adapter ) ; INIT_DEBUGOUT ( " " ) ; lem_disable_intr ( adapter ) ; callout_stop ( & adapter -> timer ) ; callout_stop ( & adapter -> tx_fifo_timer ) ; if_setdrvflagbits ( ifp , 0 , ( IFF_DRV_RUNNING | IFF_DRV_OACTIVE ) ) ; e1000_reset_hw ( & adapter -> hw ) ; if ( adapter -> hw . mac . type >= e1000_82544 ) E1000_WRITE_REG ( & adapter -> hw , E1000_WUC , 0 ) ; e1000_led_off ( & adapter -> hw ) ; e1000_cleanup_led ( & adapter -> hw ) ; }
This routine disables all traffic on the adapter by issuing a
  global reset on the MAC and deallocates TX/RX buffers.
This routine disables all traffic on the adapter by issuing a global reset on the MAC and deallocates TX / RX buffers .
/* Tell the stack that the interface is no longer active */