]> git.baikalelectronics.ru Git - kernel.git/commitdiff
igb: Fix SGMII SFP module discovery for 100FX/LX.
authorManfred Rudigier <manfred.rudigier@omicronenergy.com>
Wed, 4 Dec 2019 10:40:26 +0000 (11:40 +0100)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 9 Jan 2020 17:21:40 +0000 (09:21 -0800)
Changing the link mode should also be done for 100BaseFX SGMII modules,
otherwise they just don't work when the default link mode in CTRL_EXT
coming from the EEPROM is SERDES.

Additionally 100Base-LX SGMII SFP modules are also supported now, which
was not the case before.

Tested with an i210 using Flexoptix S.1303.2M.G 100FX and
S.1303.10.G 100LX SGMII SFP modules.

Signed-off-by: Manfred Rudigier <manfred.rudigier@omicronenergy.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/e1000_82575.c
drivers/net/ethernet/intel/igb/igb_ethtool.c

index 8a6ef351412921c729db50e686201b51ff4795ec..438b42ce2cd9aa84931c9e699dd14c2158bdb35f 100644 (file)
@@ -530,7 +530,7 @@ static s32 igb_set_sfp_media_type_82575(struct e1000_hw *hw)
                dev_spec->module_plugged = true;
                if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) {
                        hw->phy.media_type = e1000_media_type_internal_serdes;
-               } else if (eth_flags->e100_base_fx) {
+               } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) {
                        dev_spec->sgmii_active = true;
                        hw->phy.media_type = e1000_media_type_internal_serdes;
                } else if (eth_flags->e1000_base_t) {
@@ -657,14 +657,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
                        break;
                }
 
-               /* do not change link mode for 100BaseFX */
-               if (dev_spec->eth_flags.e100_base_fx)
-                       break;
-
                /* change current link mode setting */
                ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK;
 
-               if (hw->phy.media_type == e1000_media_type_copper)
+               if (dev_spec->sgmii_active)
                        ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII;
                else
                        ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES;
index 4690d6c87f39a52ce839e35b8983a157b373e436..445fbdce3e2592eed5fb2c2bf951dcacd714b85d 100644 (file)
@@ -181,7 +181,7 @@ static int igb_get_link_ksettings(struct net_device *netdev,
                                advertising &= ~ADVERTISED_1000baseKX_Full;
                        }
                }
-               if (eth_flags->e100_base_fx) {
+               if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) {
                        supported |= SUPPORTED_100baseT_Full;
                        advertising |= ADVERTISED_100baseT_Full;
                }