Commit 3d292265 authored by Josh Hay's avatar Josh Hay Committed by Jeff Kirsher
Browse files

ixgbe: rename autoneg variables



Renames some autoneg/speed variables to be more consistent with check_link,
get_link_capabilities, and setup_link function calls. Initializes instances
of autoneg.

Signed-off-by: default avatarJosh Hay <joshua.a.hay@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b4fafbe9
Loading
Loading
Loading
Loading
+12 −13
Original line number Original line Diff line number Diff line
@@ -234,13 +234,13 @@ static s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
 *  ixgbe_get_link_capabilities_82599 - Determines link capabilities
 *  ixgbe_get_link_capabilities_82599 - Determines link capabilities
 *  @hw: pointer to hardware structure
 *  @hw: pointer to hardware structure
 *  @speed: pointer to link speed
 *  @speed: pointer to link speed
 *  @negotiation: true when autoneg or autotry is enabled
 *  @autoneg: true when autoneg or autotry is enabled
 *
 *
 *  Determines the link capabilities by reading the AUTOC register.
 *  Determines the link capabilities by reading the AUTOC register.
 **/
 **/
static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
                                             ixgbe_link_speed *speed,
                                             ixgbe_link_speed *speed,
                                             bool *negotiation)
					     bool *autoneg)
{
{
	s32 status = 0;
	s32 status = 0;
	u32 autoc = 0;
	u32 autoc = 0;
@@ -251,7 +251,7 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) {
	    hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) {
		*speed = IXGBE_LINK_SPEED_1GB_FULL;
		*speed = IXGBE_LINK_SPEED_1GB_FULL;
		*negotiation = true;
		*autoneg = true;
		goto out;
		goto out;
	}
	}


@@ -268,22 +268,22 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
	switch (autoc & IXGBE_AUTOC_LMS_MASK) {
	switch (autoc & IXGBE_AUTOC_LMS_MASK) {
	case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
	case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
		*speed = IXGBE_LINK_SPEED_1GB_FULL;
		*speed = IXGBE_LINK_SPEED_1GB_FULL;
		*negotiation = false;
		*autoneg = false;
		break;
		break;


	case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
	case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
		*speed = IXGBE_LINK_SPEED_10GB_FULL;
		*speed = IXGBE_LINK_SPEED_10GB_FULL;
		*negotiation = false;
		*autoneg = false;
		break;
		break;


	case IXGBE_AUTOC_LMS_1G_AN:
	case IXGBE_AUTOC_LMS_1G_AN:
		*speed = IXGBE_LINK_SPEED_1GB_FULL;
		*speed = IXGBE_LINK_SPEED_1GB_FULL;
		*negotiation = true;
		*autoneg = true;
		break;
		break;


	case IXGBE_AUTOC_LMS_10G_SERIAL:
	case IXGBE_AUTOC_LMS_10G_SERIAL:
		*speed = IXGBE_LINK_SPEED_10GB_FULL;
		*speed = IXGBE_LINK_SPEED_10GB_FULL;
		*negotiation = false;
		*autoneg = false;
		break;
		break;


	case IXGBE_AUTOC_LMS_KX4_KX_KR:
	case IXGBE_AUTOC_LMS_KX4_KX_KR:
@@ -295,7 +295,7 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
			*speed |= IXGBE_LINK_SPEED_10GB_FULL;
			*speed |= IXGBE_LINK_SPEED_10GB_FULL;
		if (autoc & IXGBE_AUTOC_KX_SUPP)
		if (autoc & IXGBE_AUTOC_KX_SUPP)
			*speed |= IXGBE_LINK_SPEED_1GB_FULL;
			*speed |= IXGBE_LINK_SPEED_1GB_FULL;
		*negotiation = true;
		*autoneg = true;
		break;
		break;


	case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII:
	case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII:
@@ -306,12 +306,12 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
			*speed |= IXGBE_LINK_SPEED_10GB_FULL;
			*speed |= IXGBE_LINK_SPEED_10GB_FULL;
		if (autoc & IXGBE_AUTOC_KX_SUPP)
		if (autoc & IXGBE_AUTOC_KX_SUPP)
			*speed |= IXGBE_LINK_SPEED_1GB_FULL;
			*speed |= IXGBE_LINK_SPEED_1GB_FULL;
		*negotiation = true;
		*autoneg = true;
		break;
		break;


	case IXGBE_AUTOC_LMS_SGMII_1G_100M:
	case IXGBE_AUTOC_LMS_SGMII_1G_100M:
		*speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL;
		*speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL;
		*negotiation = false;
		*autoneg = false;
		break;
		break;


	default:
	default:
@@ -323,7 +323,7 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
	if (hw->phy.multispeed_fiber) {
	if (hw->phy.multispeed_fiber) {
		*speed |= IXGBE_LINK_SPEED_10GB_FULL |
		*speed |= IXGBE_LINK_SPEED_10GB_FULL |
		          IXGBE_LINK_SPEED_1GB_FULL;
		          IXGBE_LINK_SPEED_1GB_FULL;
		*negotiation = true;
		*autoneg = true;
	}
	}


out:
out:
@@ -527,11 +527,10 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
	u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
	u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
	u32 i = 0;
	u32 i = 0;
	bool link_up = false;
	bool link_up = false;
	bool negotiation;


	/* Mask off requested but non-supported speeds */
	/* Mask off requested but non-supported speeds */
	status = hw->mac.ops.get_link_capabilities(hw, &link_speed,
	status = hw->mac.ops.get_link_capabilities(hw, &link_speed,
						   &negotiation);
						   &autoneg);
	if (status != 0)
	if (status != 0)
		return status;
		return status;


+16 −16
Original line number Original line Diff line number Diff line
@@ -2178,10 +2178,10 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
			return;
			return;


		if (!(eicr & IXGBE_EICR_LSC) && hw->mac.ops.check_link) {
		if (!(eicr & IXGBE_EICR_LSC) && hw->mac.ops.check_link) {
			u32 autoneg;
			u32 speed;
			bool link_up = false;
			bool link_up = false;


			hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
			hw->mac.ops.check_link(hw, &speed, &link_up, false);


			if (link_up)
			if (link_up)
				return;
				return;
@@ -3994,25 +3994,25 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter)
 **/
 **/
static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
{
{
	u32 autoneg;
	u32 speed;
	bool negotiation, link_up = false;
	bool autoneg, link_up = false;
	u32 ret = IXGBE_ERR_LINK_SETUP;
	u32 ret = IXGBE_ERR_LINK_SETUP;


	if (hw->mac.ops.check_link)
	if (hw->mac.ops.check_link)
		ret = hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
		ret = hw->mac.ops.check_link(hw, &speed, &link_up, false);


	if (ret)
	if (ret)
		goto link_cfg_out;
		goto link_cfg_out;


	autoneg = hw->phy.autoneg_advertised;
	speed = hw->phy.autoneg_advertised;
	if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
	if ((!speed) && (hw->mac.ops.get_link_capabilities))
		ret = hw->mac.ops.get_link_capabilities(hw, &autoneg,
		ret = hw->mac.ops.get_link_capabilities(hw, &speed,
							&negotiation);
							&autoneg);
	if (ret)
	if (ret)
		goto link_cfg_out;
		goto link_cfg_out;


	if (hw->mac.ops.setup_link)
	if (hw->mac.ops.setup_link)
		ret = hw->mac.ops.setup_link(hw, autoneg, negotiation, link_up);
		ret = hw->mac.ops.setup_link(hw, speed, autoneg, link_up);
link_cfg_out:
link_cfg_out:
	return ret;
	return ret;
}
}
@@ -5739,8 +5739,8 @@ sfp_out:
static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
{
{
	struct ixgbe_hw *hw = &adapter->hw;
	struct ixgbe_hw *hw = &adapter->hw;
	u32 autoneg;
	u32 speed;
	bool negotiation;
	bool autoneg = false;


	if (!(adapter->flags & IXGBE_FLAG_NEED_LINK_CONFIG))
	if (!(adapter->flags & IXGBE_FLAG_NEED_LINK_CONFIG))
		return;
		return;
@@ -5751,11 +5751,11 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)


	adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;
	adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;


	autoneg = hw->phy.autoneg_advertised;
	speed = hw->phy.autoneg_advertised;
	if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
	if ((!speed) && (hw->mac.ops.get_link_capabilities))
		hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation);
		hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg);
	if (hw->mac.ops.setup_link)
	if (hw->mac.ops.setup_link)
		hw->mac.ops.setup_link(hw, autoneg, negotiation, true);
		hw->mac.ops.setup_link(hw, speed, autoneg, true);


	adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
	adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
	adapter->link_check_timeout = jiffies;
	adapter->link_check_timeout = jiffies;