Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2022 03:36:54 GMT
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f2a0b610b840 - stable/13 - igc: remove unnecessary PHY ID checks
Message-ID:  <202210170336.29H3as12008922@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kbowling (ports committer):

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

commit f2a0b610b84011d9de1a7a655a3ca8532cd6b8a7
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-17 03:35:57 +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
    Differential Revision:  https://reviews.freebsd.org/D36923
    
    (cherry picked from commit 29d7f1ff579579711dd5a3325480728b8ed45f8c)
---
 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 a6823ddf7bac..d2ae7effbb41 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) |



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210170336.29H3as12008922>