1 From 7c496de538eebd8212dc2a3c9a468386b264d0d4 Mon Sep 17 00:00:00 2001
2 From: Sasha Neftin <sasha.neftin@intel.com>
3 Date: Wed, 7 Jul 2021 08:14:40 +0300
4 Subject: igc: Remove _I_PHY_ID checking
6 i225 devices have only one PHY vendor. There is no point checking
7 _I_PHY_ID during the link establishment and auto-negotiation process.
8 This patch comes to clean up these pointless checkings.
10 Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
11 Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
12 Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
14 drivers/net/ethernet/intel/igc/igc_base.c | 10 +---------
15 drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
16 drivers/net/ethernet/intel/igc/igc_phy.c | 6 ++----
17 3 files changed, 4 insertions(+), 15 deletions(-)
19 (limited to 'drivers/net/ethernet/intel/igc')
21 --- a/drivers/net/ethernet/intel/igc/igc_base.c
22 +++ b/drivers/net/ethernet/intel/igc/igc_base.c
23 @@ -187,15 +187,7 @@ static s32 igc_init_phy_params_base(stru
25 igc_check_for_copper_link(hw);
27 - /* Verify phy id and set remaining function pointers */
30 - phy->type = igc_phy_i225;
33 - ret_val = -IGC_ERR_PHY;
36 + phy->type = igc_phy_i225;
40 --- a/drivers/net/ethernet/intel/igc/igc_main.c
41 +++ b/drivers/net/ethernet/intel/igc/igc_main.c
42 @@ -4189,8 +4189,7 @@ bool igc_has_link(struct igc_adapter *ad
46 - if (hw->mac.type == igc_i225 &&
47 - hw->phy.id == I225_I_PHY_ID) {
48 + if (hw->mac.type == igc_i225) {
49 if (!netif_carrier_ok(adapter->netdev)) {
50 adapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE;
51 } else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) {
52 --- a/drivers/net/ethernet/intel/igc/igc_phy.c
53 +++ b/drivers/net/ethernet/intel/igc/igc_phy.c
54 @@ -249,8 +249,7 @@ static s32 igc_phy_setup_autoneg(struct
58 - if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
59 - hw->phy.id == I225_I_PHY_ID) {
60 + if (phy->autoneg_mask & ADVERTISE_2500_FULL) {
61 /* Read the MULTI GBT AN Control Register - reg 7.32 */
62 ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
64 @@ -390,8 +389,7 @@ static s32 igc_phy_setup_autoneg(struct
65 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL,
68 - if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
69 - hw->phy.id == I225_I_PHY_ID)
70 + if (phy->autoneg_mask & ADVERTISE_2500_FULL)
71 ret_val = phy->ops.write_reg(hw,
72 (STANDARD_AN_REG_MASK <<