Skip to content

Commit 41fcfbe

Browse files
aabodunrinJeff Kirsher
authored andcommitted
igb: Implementation to report advertised/supported link on i354 devices
This patch changes the way we report supported/advertised link for i354 devices, especially for 2.5 GB. Instead of reporting 2.5 GB for all i354 devices erroneously, check first, if it is 2.5 GB capable. Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent f6878e3 commit 41fcfbe

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

drivers/net/ethernet/intel/igb/igb_ethtool.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,7 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
172172
SUPPORTED_Autoneg |
173173
SUPPORTED_Pause);
174174
ecmd->advertising = ADVERTISED_FIBRE;
175-
if (hw->mac.type == e1000_i354) {
176-
ecmd->supported |= SUPPORTED_2500baseX_Full;
177-
ecmd->advertising |= ADVERTISED_2500baseX_Full;
178-
}
175+
179176
if ((eth_flags->e1000_base_lx) || (eth_flags->e1000_base_sx)) {
180177
ecmd->supported |= SUPPORTED_1000baseT_Full;
181178
ecmd->advertising |= ADVERTISED_1000baseT_Full;
@@ -209,16 +206,23 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
209206
status = rd32(E1000_STATUS);
210207

211208
if (status & E1000_STATUS_LU) {
212-
if ((hw->mac.type == e1000_i354) &&
213-
(status & E1000_STATUS_2P5_SKU) &&
214-
!(status & E1000_STATUS_2P5_SKU_OVER))
215-
ecmd->speed = SPEED_2500;
216-
else if (status & E1000_STATUS_SPEED_1000)
209+
if (hw->mac.type == e1000_i354) {
210+
if ((status & E1000_STATUS_2P5_SKU) &&
211+
!(status & E1000_STATUS_2P5_SKU_OVER)) {
212+
ecmd->supported = SUPPORTED_2500baseX_Full;
213+
ecmd->advertising = ADVERTISED_2500baseX_Full;
214+
ecmd->speed = SPEED_2500;
215+
} else {
216+
ecmd->supported = SUPPORTED_1000baseT_Full;
217+
ecmd->advertising = ADVERTISED_1000baseT_Full;
218+
}
219+
} else if (status & E1000_STATUS_SPEED_1000) {
217220
ecmd->speed = SPEED_1000;
218-
else if (status & E1000_STATUS_SPEED_100)
221+
} else if (status & E1000_STATUS_SPEED_100) {
219222
ecmd->speed = SPEED_100;
220-
else
223+
} else {
221224
ecmd->speed = SPEED_10;
225+
}
222226
if ((status & E1000_STATUS_FD) ||
223227
hw->phy.media_type != e1000_media_type_copper)
224228
ecmd->duplex = DUPLEX_FULL;

0 commit comments

Comments
 (0)