FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_shutdown_adapter - shut down adapter, host & wire
 *	@adapter: the adapter
 *
 *	Perform an emergency shutdown of the adapter and stop it from
 *	continuing any further communication on the ports or DMA to the
 *	host.  This is typically used when the adapter and/or firmware
 *	have crashed and we want to prevent any further accidental
 *	communication with the rest of the world.  This will also force
 *	the port Link Status to go down -- if register writes work --
 *	which should help our peers figure out that we're down.
 */


Perform an emergency shutdown of the adapter and stop it from
continuing any further communication on the ports or DMA to the
host.  This is typically used when the adapter and/or firmware
have crashed and we want to prevent any further accidental
communication with the rest of the world.  This will also force
the port Link Status to go down -- if register writes work
which should help our peers figure out that we're down.
Perform an emergency shutdown of the adapter and stop it from continuing any further communication on the ports or DMA to the host . This is typically used when the adapter and / or firmware have crashed and we want to prevent any further accidental communication with the rest of the world . This will also force the port Link Status to go down -- if register writes work which should help our peers figure out that we ' re down .
int t4_shutdown_adapter(struct adapter *adapter)
{
	int port;
	t4_intr_disable(adapter);
	t4_write_reg(adapter, A_DBG_GPIO_EN, 0);
	for_each_port(adapter, port) {
		u32 a_port_cfg = PORT_REG(port,
					  is_t4(adapter)
					  ? A_XGMAC_PORT_CFG
					  : A_MAC_PORT_CFG);
		t4_write_reg(adapter, a_port_cfg,
			     t4_read_reg(adapter, a_port_cfg)
			     & ~V_SIGNAL_DET(1));
	}
	t4_set_reg_field(adapter, A_SGE_CONTROL, F_GLOBALENABLE, 0);
	return 0;
}
int t4_shutdown_adapter ( struct adapter * adapter ) { int port ; t4_intr_disable ( adapter ) ; t4_write_reg ( adapter , A_DBG_GPIO_EN , 0 ) ; for_each_port ( adapter , port ) { u32 a_port_cfg = PORT_REG ( port , is_t4 ( adapter ) ? A_XGMAC_PORT_CFG : A_MAC_PORT_CFG ) ; t4_write_reg ( adapter , a_port_cfg , t4_read_reg ( adapter , a_port_cfg ) & ~ V_SIGNAL_DET ( 1 ) ) ; } t4_set_reg_field ( adapter , A_SGE_CONTROL , F_GLOBALENABLE , 0 ) ; return 0 ; }
t4_shutdown_adapter - shut down adapter, host & wire
      @adapter: the adapter
t4_shutdown_adapter - shut down adapter host & wire @adapter : the adapter