Skip to content

Commit f6878e3

Browse files
aabodunrinJeff Kirsher
authored andcommitted
igb: Get speed and duplex for 1G non_copper devices
This patch changes how we get speed/duplex for non_copper devices; it now uses pcs register to get current speed and duplex instead of using generic status register that we use to detect speed/duplex for copper devices. 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 f1b4d62 commit f6878e3

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,31 @@ static s32 igb_get_cfg_done_82575(struct e1000_hw *hw)
11401140
return ret_val;
11411141
}
11421142

1143+
/**
1144+
* igb_get_link_up_info_82575 - Get link speed/duplex info
1145+
* @hw: pointer to the HW structure
1146+
* @speed: stores the current speed
1147+
* @duplex: stores the current duplex
1148+
*
1149+
* This is a wrapper function, if using the serial gigabit media independent
1150+
* interface, use PCS to retrieve the link speed and duplex information.
1151+
* Otherwise, use the generic function to get the link speed and duplex info.
1152+
**/
1153+
static s32 igb_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
1154+
u16 *duplex)
1155+
{
1156+
s32 ret_val;
1157+
1158+
if (hw->phy.media_type != e1000_media_type_copper)
1159+
ret_val = igb_get_pcs_speed_and_duplex_82575(hw, speed,
1160+
duplex);
1161+
else
1162+
ret_val = igb_get_speed_and_duplex_copper(hw, speed,
1163+
duplex);
1164+
1165+
return ret_val;
1166+
}
1167+
11431168
/**
11441169
* igb_check_for_link_82575 - Check for link
11451170
* @hw: pointer to the HW structure
@@ -2723,7 +2748,7 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = {
27232748
.check_for_link = igb_check_for_link_82575,
27242749
.rar_set = igb_rar_set,
27252750
.read_mac_addr = igb_read_mac_addr_82575,
2726-
.get_speed_and_duplex = igb_get_speed_and_duplex_copper,
2751+
.get_speed_and_duplex = igb_get_link_up_info_82575,
27272752
#ifdef CONFIG_IGB_HWMON
27282753
.get_thermal_sensor_data = igb_get_thermal_sensor_data_generic,
27292754
.init_thermal_sensor_thresh = igb_init_thermal_sensor_thresh_generic,

0 commit comments

Comments
 (0)