Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21cc5b4f authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher
Browse files

ixgbe: set media type for 82599 T3 LOM



The media type was not being set for the 82599 T3 LAN on motherboard.  This
change corrects that.

Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarStephen Ko <stephen.s.ko@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 894ff7cf
Loading
Loading
Loading
Loading
+40 −10
Original line number Original line Diff line number Diff line
@@ -329,11 +329,14 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
	enum ixgbe_media_type media_type;
	enum ixgbe_media_type media_type;


	/* Detect if there is a copper PHY attached. */
	/* Detect if there is a copper PHY attached. */
	if (hw->phy.type == ixgbe_phy_cu_unknown ||
	switch (hw->phy.type) {
	    hw->phy.type == ixgbe_phy_tn ||
	case ixgbe_phy_cu_unknown:
	    hw->phy.type == ixgbe_phy_aq) {
	case ixgbe_phy_tn:
	case ixgbe_phy_aq:
		media_type = ixgbe_media_type_copper;
		media_type = ixgbe_media_type_copper;
		goto out;
		goto out;
	default:
		break;
	}
	}


	switch (hw->device_id) {
	switch (hw->device_id) {
@@ -354,6 +357,9 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
	case IXGBE_DEV_ID_82599_CX4:
	case IXGBE_DEV_ID_82599_CX4:
		media_type = ixgbe_media_type_cx4;
		media_type = ixgbe_media_type_cx4;
		break;
		break;
	case IXGBE_DEV_ID_82599_T3_LOM:
		media_type = ixgbe_media_type_copper;
		break;
	default:
	default:
		media_type = ixgbe_media_type_unknown;
		media_type = ixgbe_media_type_unknown;
		break;
		break;
@@ -1733,13 +1739,34 @@ static s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
 *  @hw: pointer to hardware structure
 *  @hw: pointer to hardware structure
 *
 *
 *  Determines the physical layer module found on the current adapter.
 *  Determines the physical layer module found on the current adapter.
 *  If PHY already detected, maintains current PHY type in hw struct,
 *  otherwise executes the PHY detection routine.
 **/
 **/
static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
{
{
	s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
	s32 status = IXGBE_ERR_PHY_ADDR_INVALID;

	/* Detect PHY if not unknown - returns success if already detected. */
	status = ixgbe_identify_phy_generic(hw);
	status = ixgbe_identify_phy_generic(hw);
	if (status != 0)
	if (status != 0) {
		/* 82599 10GBASE-T requires an external PHY */
		if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper)
			goto out;
		else
			status = ixgbe_identify_sfp_module_generic(hw);
			status = ixgbe_identify_sfp_module_generic(hw);
	}

	/* Set PHY type none if no PHY detected */
	if (hw->phy.type == ixgbe_phy_unknown) {
		hw->phy.type = ixgbe_phy_none;
		status = 0;
	}

	/* Return error if SFP module has been detected but is not supported */
	if (hw->phy.type == ixgbe_phy_sfp_unsupported)
		status = IXGBE_ERR_SFP_NOT_SUPPORTED;

out:
	return status;
	return status;
}
}


@@ -1763,9 +1790,10 @@ static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)


	hw->phy.ops.identify(hw);
	hw->phy.ops.identify(hw);


	if (hw->phy.type == ixgbe_phy_tn ||
	switch (hw->phy.type) {
	    hw->phy.type == ixgbe_phy_aq ||
	case ixgbe_phy_tn:
	    hw->phy.type == ixgbe_phy_cu_unknown) {
	case ixgbe_phy_aq:
	case ixgbe_phy_cu_unknown:
		hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE, MDIO_MMD_PMAPMD,
		hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE, MDIO_MMD_PMAPMD,
							 &ext_ability);
							 &ext_ability);
		if (ext_ability & MDIO_PMA_EXTABLE_10GBT)
		if (ext_ability & MDIO_PMA_EXTABLE_10GBT)
@@ -1775,6 +1803,8 @@ static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
		if (ext_ability & MDIO_PMA_EXTABLE_100BTX)
		if (ext_ability & MDIO_PMA_EXTABLE_100BTX)
			physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
			physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
		goto out;
		goto out;
	default:
		break;
	}
	}


	switch (autoc & IXGBE_AUTOC_LMS_MASK) {
	switch (autoc & IXGBE_AUTOC_LMS_MASK) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -3889,7 +3889,7 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
	 * If we're not hot-pluggable SFP+, we just need to configure link
	 * If we're not hot-pluggable SFP+, we just need to configure link
	 * and bring it up.
	 * and bring it up.
	 */
	 */
	if (hw->phy.type == ixgbe_phy_unknown)
	if (hw->phy.type == ixgbe_phy_none)
		schedule_work(&adapter->sfp_config_module_task);
		schedule_work(&adapter->sfp_config_module_task);


	/* enable transmits */
	/* enable transmits */
+1 −0
Original line number Original line Diff line number Diff line
@@ -2242,6 +2242,7 @@ enum ixgbe_mac_type {


enum ixgbe_phy_type {
enum ixgbe_phy_type {
	ixgbe_phy_unknown = 0,
	ixgbe_phy_unknown = 0,
	ixgbe_phy_none,
	ixgbe_phy_tn,
	ixgbe_phy_tn,
	ixgbe_phy_aq,
	ixgbe_phy_aq,
	ixgbe_phy_cu_unknown,
	ixgbe_phy_cu_unknown,