src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_stop_hw(struct txgbe_hw *hw)
{
	u32 reg_val;
	u16 i;

	DEBUGFUNC("txgbe_stop_hw");

	/*
	 * Set the adapter_stopped flag so other driver functions stop touching
	 * the hardware
	 */
	hw->adapter_stopped = true;

	/* Disable the receive unit */
	txgbe_disable_rx(hw);

	/* Clear interrupt mask to stop interrupts from being generated */
	wr32(hw, TXGBE_IENMISC, 0);
	wr32(hw, TXGBE_IMS(0), TXGBE_IMS_MASK);
	wr32(hw, TXGBE_IMS(1), TXGBE_IMS_MASK);

	/* Clear any pending interrupts, flush previous writes */
	wr32(hw, TXGBE_ICRMISC, TXGBE_ICRMISC_MASK);
	wr32(hw, TXGBE_ICR(0), TXGBE_ICR_MASK);
	wr32(hw, TXGBE_ICR(1), TXGBE_ICR_MASK);

	/* Disable the transmit unit.  Each queue must be disabled. */
	for (i = 0; i < hw->mac.max_tx_queues; i++)
		wr32(hw, TXGBE_TXCFG(i), TXGBE_TXCFG_FLUSH);

	/* Disable the receive unit by stopping each queue */
	for (i = 0; i < hw->mac.max_rx_queues; i++) {
		reg_val = rd32(hw, TXGBE_RXCFG(i));
		reg_val &= ~TXGBE_RXCFG_ENA;
		wr32(hw, TXGBE_RXCFG(i), reg_val);
	}

	/* flush all queues disables */
	txgbe_flush(hw);
	msec_delay(2);

	return 0;
}
/**
 *  txgbe_stop_hw - Generic stop Tx/Rx units
 *  @hw: pointer to hardware structure
 *
 *  Sets the adapter_stopped flag within txgbe_hw struct. Clears interrupts,
 *  disables transmit and receive units. The adapter_stopped flag is used by
 *  the shared code and drivers to determine if the adapter is in a stopped
 *  state and should not touch the hardware.
 **/
Generic stop Tx/Rx units
@hw: pointer to hardware structure

Sets the adapter_stopped flag within txgbe_hw struct. Clears interrupts,
disables transmit and receive units. The adapter_stopped flag is used by
the shared code and drivers to determine if the adapter is in a stopped
state and should not touch the hardware.
Generic stop Tx / Rx units @hw : pointer to hardware structure Sets the adapter_stopped flag within txgbe_hw struct . Clears interrupts disables transmit and receive units . The adapter_stopped flag is used by the shared code and drivers to determine if the adapter is in a stopped state and should not touch the hardware .
s32 txgbe_stop_hw(struct txgbe_hw *hw)
{
	u32 reg_val;
	u16 i;
	DEBUGFUNC("txgbe_stop_hw");
	hw->adapter_stopped = true;
	txgbe_disable_rx(hw);
	wr32(hw, TXGBE_IENMISC, 0);
	wr32(hw, TXGBE_IMS(0), TXGBE_IMS_MASK);
	wr32(hw, TXGBE_IMS(1), TXGBE_IMS_MASK);
	wr32(hw, TXGBE_ICRMISC, TXGBE_ICRMISC_MASK);
	wr32(hw, TXGBE_ICR(0), TXGBE_ICR_MASK);
	wr32(hw, TXGBE_ICR(1), TXGBE_ICR_MASK);
	for (i = 0; i < hw->mac.max_tx_queues; i++)
		wr32(hw, TXGBE_TXCFG(i), TXGBE_TXCFG_FLUSH);
	for (i = 0; i < hw->mac.max_rx_queues; i++) {
		reg_val = rd32(hw, TXGBE_RXCFG(i));
		reg_val &= ~TXGBE_RXCFG_ENA;
		wr32(hw, TXGBE_RXCFG(i), reg_val);
	}
	txgbe_flush(hw);
	msec_delay(2);
	return 0;
}
s32 txgbe_stop_hw ( struct txgbe_hw * hw ) { u32 reg_val ; u16 i ; DEBUGFUNC ( " " ) ; hw -> adapter_stopped = true ; txgbe_disable_rx ( hw ) ; wr32 ( hw , TXGBE_IENMISC , 0 ) ; wr32 ( hw , TXGBE_IMS ( 0 ) , TXGBE_IMS_MASK ) ; wr32 ( hw , TXGBE_IMS ( 1 ) , TXGBE_IMS_MASK ) ; wr32 ( hw , TXGBE_ICRMISC , TXGBE_ICRMISC_MASK ) ; wr32 ( hw , TXGBE_ICR ( 0 ) , TXGBE_ICR_MASK ) ; wr32 ( hw , TXGBE_ICR ( 1 ) , TXGBE_ICR_MASK ) ; for ( i = 0 ; i < hw -> mac . max_tx_queues ; i ++ ) wr32 ( hw , TXGBE_TXCFG ( i ) , TXGBE_TXCFG_FLUSH ) ; for ( i = 0 ; i < hw -> mac . max_rx_queues ; i ++ ) { reg_val = rd32 ( hw , TXGBE_RXCFG ( i ) ) ; reg_val &= ~ TXGBE_RXCFG_ENA ; wr32 ( hw , TXGBE_RXCFG ( i ) , reg_val ) ; } txgbe_flush ( hw ) ; msec_delay ( 2 ) ; return 0 ; }
txgbe_stop_hw - Generic stop Tx/Rx units
  @hw: pointer to hardware structure
txgbe_stop_hw - Generic stop Tx / Rx units @hw : pointer to hardware structure
/*
	 * Set the adapter_stopped flag so other driver functions stop touching
	 * the hardware
	 */ /* Disable the receive unit */ /* Clear interrupt mask to stop interrupts from being generated */ /* Clear any pending interrupts, flush previous writes */ /* Disable the transmit unit.  Each queue must be disabled. */ /* Disable the receive unit by stopping each queue */ /* flush all queues disables */