src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw)
{
	u32 setup[FW_PHY_ACT_DATA_COUNT] = { 0 };
	s32 rc;
	u16 i;

	if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
		return 0;

	if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
		ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED,
			      "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
		return IXGBE_ERR_INVALID_LINK_SETTINGS;
	}

	switch (hw->fc.requested_mode) {
	case ixgbe_fc_full:
		setup[0] |= FW_PHY_ACT_SETUP_LINK_PAUSE_RXTX <<
			    FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT;
		break;
	case ixgbe_fc_rx_pause:
		setup[0] |= FW_PHY_ACT_SETUP_LINK_PAUSE_RX <<
			    FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT;
		break;
	case ixgbe_fc_tx_pause:
		setup[0] |= FW_PHY_ACT_SETUP_LINK_PAUSE_TX <<
			    FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT;
		break;
	default:
		break;
	}

	for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) {
		if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed)
			setup[0] |= (u32)(ixgbe_fw_map[i].fw_speed);
	}
	setup[0] |= FW_PHY_ACT_SETUP_LINK_HP | FW_PHY_ACT_SETUP_LINK_AN;

	if (hw->phy.eee_speeds_advertised)
		setup[0] |= FW_PHY_ACT_SETUP_LINK_EEE;

	rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup);
	if (rc)
		return rc;
	if (setup[0] == FW_PHY_ACT_SETUP_LINK_RSP_DOWN)
		return IXGBE_ERR_OVERTEMP;
	return IXGBE_SUCCESS;
}
/**
 * ixgbe_setup_fw_link - Setup firmware-controlled PHYs
 * @hw: pointer to hardware structure
 */
Setup firmware-controlled PHYs
@hw: pointer to hardware structure
Setup firmware - controlled PHYs @hw : pointer to hardware structure
static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw)
{
	u32 setup[FW_PHY_ACT_DATA_COUNT] = { 0 };
	s32 rc;
	u16 i;
	if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
		return 0;
	if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
		ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED,
			      "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
		return IXGBE_ERR_INVALID_LINK_SETTINGS;
	}
	switch (hw->fc.requested_mode) {
	case ixgbe_fc_full:
		setup[0] |= FW_PHY_ACT_SETUP_LINK_PAUSE_RXTX <<
			    FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT;
		break;
	case ixgbe_fc_rx_pause:
		setup[0] |= FW_PHY_ACT_SETUP_LINK_PAUSE_RX <<
			    FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT;
		break;
	case ixgbe_fc_tx_pause:
		setup[0] |= FW_PHY_ACT_SETUP_LINK_PAUSE_TX <<
			    FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT;
		break;
	default:
		break;
	}
	for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) {
		if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed)
			setup[0] |= (u32)(ixgbe_fw_map[i].fw_speed);
	}
	setup[0] |= FW_PHY_ACT_SETUP_LINK_HP | FW_PHY_ACT_SETUP_LINK_AN;
	if (hw->phy.eee_speeds_advertised)
		setup[0] |= FW_PHY_ACT_SETUP_LINK_EEE;
	rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup);
	if (rc)
		return rc;
	if (setup[0] == FW_PHY_ACT_SETUP_LINK_RSP_DOWN)
		return IXGBE_ERR_OVERTEMP;
	return IXGBE_SUCCESS;
}
static s32 ixgbe_setup_fw_link ( struct ixgbe_hw * hw ) { u32 setup [ FW_PHY_ACT_DATA_COUNT ] = { 0 } ; s32 rc ; u16 i ; if ( hw -> phy . reset_disable || ixgbe_check_reset_blocked ( hw ) ) return 0 ; if ( hw -> fc . strict_ieee && hw -> fc . requested_mode == ixgbe_fc_rx_pause ) { ERROR_REPORT1 ( IXGBE_ERROR_UNSUPPORTED , " \n " ) ; return IXGBE_ERR_INVALID_LINK_SETTINGS ; } switch ( hw -> fc . requested_mode ) { case ixgbe_fc_full : setup [ 0 ] |= FW_PHY_ACT_SETUP_LINK_PAUSE_RXTX << FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT ; break ; case ixgbe_fc_rx_pause : setup [ 0 ] |= FW_PHY_ACT_SETUP_LINK_PAUSE_RX << FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT ; break ; case ixgbe_fc_tx_pause : setup [ 0 ] |= FW_PHY_ACT_SETUP_LINK_PAUSE_TX << FW_PHY_ACT_SETUP_LINK_PAUSE_SHIFT ; break ; default : break ; } for ( i = 0 ; i < sizeof ( ixgbe_fw_map ) / sizeof ( ixgbe_fw_map [ 0 ] ) ; ++ i ) { if ( hw -> phy . autoneg_advertised & ixgbe_fw_map [ i ] . phy_speed ) setup [ 0 ] |= ( u32 ) ( ixgbe_fw_map [ i ] . fw_speed ) ; } setup [ 0 ] |= FW_PHY_ACT_SETUP_LINK_HP | FW_PHY_ACT_SETUP_LINK_AN ; if ( hw -> phy . eee_speeds_advertised ) setup [ 0 ] |= FW_PHY_ACT_SETUP_LINK_EEE ; rc = ixgbe_fw_phy_activity ( hw , FW_PHY_ACT_SETUP_LINK , & setup ) ; if ( rc ) return rc ; if ( setup [ 0 ] == FW_PHY_ACT_SETUP_LINK_RSP_DOWN ) return IXGBE_ERR_OVERTEMP ; return IXGBE_SUCCESS ; }
ixgbe_setup_fw_link - Setup firmware-controlled PHYs
 @hw: pointer to hardware structure
ixgbe_setup_fw_link - Setup firmware - controlled PHYs @hw : pointer to hardware structure