git: 29d7f1ff5795 - main - igc: remove unnecessary PHY ID checks

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Mon, 10 Oct 2022 08:52:07 UTC
The branch main has been updated by kbowling (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=29d7f1ff579579711dd5a3325480728b8ed45f8c

commit 29d7f1ff579579711dd5a3325480728b8ed45f8c
Author:     Mah Yock Gen <yock.gen.mah@intel.com>
AuthorDate: 2022-09-02 00:18:28 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2022-10-10 08:50:46 +0000

    igc: remove unnecessary PHY ID checks
    
    I225 devices have only one PHY vendor. There is unnecessary to check
    _I_PHY_ID during the link establishment and auto-negotiation process,
    the checking also caused devices like i225-IT failed. This patch is to
    remove the mentioned unnecessary checking.
    
    Cc: stable@dpdk.org
    
    Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
    Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
    Acked-by: Qi Zhang <qi.z.zhang@intel.com>
    
    Approved by:    grehan
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D36923
---
 sys/dev/igc/igc_i225.c | 11 +----------
 sys/dev/igc/igc_phy.c  |  6 ++----
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/sys/dev/igc/igc_i225.c b/sys/dev/igc/igc_i225.c
index 95d7d1536184..91d221cee06b 100644
--- a/sys/dev/igc/igc_i225.c
+++ b/sys/dev/igc/igc_i225.c
@@ -169,16 +169,7 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
 		goto out;
 
 	ret_val = igc_get_phy_id(hw);
-	/* Verify phy id and set remaining function pointers */
-	switch (phy->id) {
-	case I225_I_PHY_ID:
-	default:
-		phy->type		= igc_phy_i225;
-		phy->ops.set_d0_lplu_state = igc_set_d0_lplu_state_i225;
-		phy->ops.set_d3_lplu_state = igc_set_d3_lplu_state_i225;
-		/* TODO - complete with GPY PHY information */
-		break;
-	}
+	phy->type = igc_phy_i225;
 
 out:
 	return ret_val;
diff --git a/sys/dev/igc/igc_phy.c b/sys/dev/igc/igc_phy.c
index 97cb11d1cd01..3911e1ff6fa2 100644
--- a/sys/dev/igc/igc_phy.c
+++ b/sys/dev/igc/igc_phy.c
@@ -310,8 +310,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw)
 			return ret_val;
 	}
 
-	if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
-	    hw->phy.id == I225_I_PHY_ID) {
+	if (phy->autoneg_mask & ADVERTISE_2500_FULL) {
 		/* Read the MULTI GBT AN Control Register - reg 7.32 */
 		ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
 					    MMD_DEVADDR_SHIFT) |
@@ -451,8 +450,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw)
 		ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL,
 					     mii_1000t_ctrl_reg);
 
-	if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
-	    hw->phy.id == I225_I_PHY_ID)
+	if (phy->autoneg_mask & ADVERTISE_2500_FULL)
 		ret_val = phy->ops.write_reg(hw,
 					     (STANDARD_AN_REG_MASK <<
 					     MMD_DEVADDR_SHIFT) |