src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_commit_fc_settings_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	u32 txcw;

	DEBUGFUNC("igc_commit_fc_settings_generic");

	/* Check for a software override of the flow control settings, and
	 * setup the device accordingly.  If auto-negotiation is enabled, then
	 * software will have to set the "PAUSE" bits to the correct value in
	 * the Transmit Config Word Register (TXCW) and re-start auto-
	 * negotiation.  However, if auto-negotiation is disabled, then
	 * software will have to manually configure the two flow control enable
	 * bits in the CTRL register.
	 *
	 * The possible values of the "fc" parameter are:
	 *      0:  Flow control is completely disabled
	 *      1:  Rx flow control is enabled (we can receive pause frames,
	 *          but not send pause frames).
	 *      2:  Tx flow control is enabled (we can send pause frames but we
	 *          do not support receiving pause frames).
	 *      3:  Both Rx and Tx flow control (symmetric) are enabled.
	 */
	switch (hw->fc.current_mode) {
	case igc_fc_none:
		/* Flow control completely disabled by a software over-ride. */
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD);
		break;
	case igc_fc_rx_pause:
		/* Rx Flow control is enabled and Tx Flow control is disabled
		 * by a software over-ride. Since there really isn't a way to
		 * advertise that we are capable of Rx Pause ONLY, we will
		 * advertise that we support both symmetric and asymmetric Rx
		 * PAUSE.  Later, we will disable the adapter's ability to send
		 * PAUSE frames.
		 */
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_PAUSE_MASK);
		break;
	case igc_fc_tx_pause:
		/* Tx Flow control is enabled, and Rx Flow control is disabled,
		 * by a software over-ride.
		 */
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_ASM_DIR);
		break;
	case igc_fc_full:
		/* Flow control (both Rx and Tx) is enabled by a software
		 * over-ride.
		 */
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_PAUSE_MASK);
		break;
	default:
		DEBUGOUT("Flow control param set incorrectly\n");
		return -IGC_ERR_CONFIG;
	}

	IGC_WRITE_REG(hw, IGC_TXCW, txcw);
	mac->txcw = txcw;

	return IGC_SUCCESS;
}
/**
 *  igc_commit_fc_settings_generic - Configure flow control
 *  @hw: pointer to the HW structure
 *
 *  Write the flow control settings to the Transmit Config Word Register (TXCW)
 *  base on the flow control settings in igc_mac_info.
 **/
Configure flow control
@hw: pointer to the HW structure

Write the flow control settings to the Transmit Config Word Register (TXCW)
base on the flow control settings in igc_mac_info.
Configure flow control @hw : pointer to the HW structure Write the flow control settings to the Transmit Config Word Register ( TXCW ) base on the flow control settings in igc_mac_info .
s32 igc_commit_fc_settings_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	u32 txcw;
	DEBUGFUNC("igc_commit_fc_settings_generic");
	switch (hw->fc.current_mode) {
	case igc_fc_none:
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD);
		break;
	case igc_fc_rx_pause:
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_PAUSE_MASK);
		break;
	case igc_fc_tx_pause:
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_ASM_DIR);
		break;
	case igc_fc_full:
		txcw = (IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_PAUSE_MASK);
		break;
	default:
		DEBUGOUT("Flow control param set incorrectly\n");
		return -IGC_ERR_CONFIG;
	}
	IGC_WRITE_REG(hw, IGC_TXCW, txcw);
	mac->txcw = txcw;
	return IGC_SUCCESS;
}
s32 igc_commit_fc_settings_generic ( struct igc_hw * hw ) { struct igc_mac_info * mac = & hw -> mac ; u32 txcw ; DEBUGFUNC ( " " ) ; switch ( hw -> fc . current_mode ) { case igc_fc_none : txcw = ( IGC_TXCW_ANE | IGC_TXCW_FD ) ; break ; case igc_fc_rx_pause : txcw = ( IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_PAUSE_MASK ) ; break ; case igc_fc_tx_pause : txcw = ( IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_ASM_DIR ) ; break ; case igc_fc_full : txcw = ( IGC_TXCW_ANE | IGC_TXCW_FD | IGC_TXCW_PAUSE_MASK ) ; break ; default : DEBUGOUT ( " \n " ) ; return - IGC_ERR_CONFIG ; } IGC_WRITE_REG ( hw , IGC_TXCW , txcw ) ; mac -> txcw = txcw ; return IGC_SUCCESS ; }
igc_commit_fc_settings_generic - Configure flow control
  @hw: pointer to the HW structure
igc_commit_fc_settings_generic - Configure flow control @hw : pointer to the HW structure
/* Check for a software override of the flow control settings, and
	 * setup the device accordingly.  If auto-negotiation is enabled, then
	 * software will have to set the "PAUSE" bits to the correct value in
	 * the Transmit Config Word Register (TXCW) and re-start auto-
	 * negotiation.  However, if auto-negotiation is disabled, then
	 * software will have to manually configure the two flow control enable
	 * bits in the CTRL register.
	 *
	 * The possible values of the "fc" parameter are:
	 *      0:  Flow control is completely disabled
	 *      1:  Rx flow control is enabled (we can receive pause frames,
	 *          but not send pause frames).
	 *      2:  Tx flow control is enabled (we can send pause frames but we
	 *          do not support receiving pause frames).
	 *      3:  Both Rx and Tx flow control (symmetric) are enabled.
	 */ /* Flow control completely disabled by a software over-ride. */ /* Rx Flow control is enabled and Tx Flow control is disabled
		 * by a software over-ride. Since there really isn't a way to
		 * advertise that we are capable of Rx Pause ONLY, we will
		 * advertise that we support both symmetric and asymmetric Rx
		 * PAUSE.  Later, we will disable the adapter's ability to send
		 * PAUSE frames.
		 */ /* Tx Flow control is enabled, and Rx Flow control is disabled,
		 * by a software over-ride.
		 */ /* Flow control (both Rx and Tx) is enabled by a software
		 * over-ride.
		 */