Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

e1000e: Enable Link Partner Advertised Support

This enables link partner advertised support to show link modes and
pause frame use.

Signed-off-by: Jamie Gloudon <jamie.gloudon@gmx.fr>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230103230653.1102544-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jamie Gloudon and committed by
Jakub Kicinski
cbdbb58b 12c1604a

+18 -1
+9 -1
drivers/net/ethernet/intel/e1000e/ethtool.c
··· 110 110 static int e1000_get_link_ksettings(struct net_device *netdev, 111 111 struct ethtool_link_ksettings *cmd) 112 112 { 113 + u32 speed, supported, advertising, lp_advertising, lpa_t; 113 114 struct e1000_adapter *adapter = netdev_priv(netdev); 114 115 struct e1000_hw *hw = &adapter->hw; 115 - u32 speed, supported, advertising; 116 116 117 117 if (hw->phy.media_type == e1000_media_type_copper) { 118 118 supported = (SUPPORTED_10baseT_Half | ··· 120 120 SUPPORTED_100baseT_Half | 121 121 SUPPORTED_100baseT_Full | 122 122 SUPPORTED_1000baseT_Full | 123 + SUPPORTED_Asym_Pause | 123 124 SUPPORTED_Autoneg | 125 + SUPPORTED_Pause | 124 126 SUPPORTED_TP); 125 127 if (hw->phy.type == e1000_phy_ife) 126 128 supported &= ~SUPPORTED_1000baseT_Full; ··· 194 192 if (hw->phy.media_type != e1000_media_type_copper) 195 193 cmd->base.eth_tp_mdix_ctrl = ETH_TP_MDI_INVALID; 196 194 195 + lpa_t = mii_stat1000_to_ethtool_lpa_t(adapter->phy_regs.stat1000); 196 + lp_advertising = lpa_t | 197 + mii_lpa_to_ethtool_lpa_t(adapter->phy_regs.lpa); 198 + 197 199 ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, 198 200 supported); 199 201 ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, 200 202 advertising); 203 + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.lp_advertising, 204 + lp_advertising); 201 205 202 206 return 0; 203 207 }
+9
drivers/net/ethernet/intel/e1000e/phy.c
··· 2 2 /* Copyright(c) 1999 - 2018 Intel Corporation. */ 3 3 4 4 #include "e1000.h" 5 + #include <linux/ethtool.h> 5 6 6 7 static s32 e1000_wait_autoneg(struct e1000_hw *hw); 7 8 static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, ··· 1012 1011 */ 1013 1012 mii_autoneg_adv_reg &= 1014 1013 ~(ADVERTISE_PAUSE_ASYM | ADVERTISE_PAUSE_CAP); 1014 + phy->autoneg_advertised &= 1015 + ~(ADVERTISED_Pause | ADVERTISED_Asym_Pause); 1015 1016 break; 1016 1017 case e1000_fc_rx_pause: 1017 1018 /* Rx Flow control is enabled, and Tx Flow control is ··· 1027 1024 */ 1028 1025 mii_autoneg_adv_reg |= 1029 1026 (ADVERTISE_PAUSE_ASYM | ADVERTISE_PAUSE_CAP); 1027 + phy->autoneg_advertised |= 1028 + (ADVERTISED_Pause | ADVERTISED_Asym_Pause); 1030 1029 break; 1031 1030 case e1000_fc_tx_pause: 1032 1031 /* Tx Flow control is enabled, and Rx Flow control is ··· 1036 1031 */ 1037 1032 mii_autoneg_adv_reg |= ADVERTISE_PAUSE_ASYM; 1038 1033 mii_autoneg_adv_reg &= ~ADVERTISE_PAUSE_CAP; 1034 + phy->autoneg_advertised |= ADVERTISED_Asym_Pause; 1035 + phy->autoneg_advertised &= ~ADVERTISED_Pause; 1039 1036 break; 1040 1037 case e1000_fc_full: 1041 1038 /* Flow control (both Rx and Tx) is enabled by a software ··· 1045 1038 */ 1046 1039 mii_autoneg_adv_reg |= 1047 1040 (ADVERTISE_PAUSE_ASYM | ADVERTISE_PAUSE_CAP); 1041 + phy->autoneg_advertised |= 1042 + (ADVERTISED_Pause | ADVERTISED_Asym_Pause); 1048 1043 break; 1049 1044 default: 1050 1045 e_dbg("Flow control param set incorrectly\n");