Commit dcc3ae9a authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: remove media type fiber as it is misleading

The current igb driver only supports copper and serdes.  The fiber media
type is a holdover from earlier NICs as the current nics supported by igb
all use serdes when communicating over a fiber connection.  As a result we
can remove media type fiber without losing any functionality.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74d15418
...@@ -867,8 +867,7 @@ void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw) ...@@ -867,8 +867,7 @@ void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw)
u32 reg; u32 reg;
if (hw->mac.type != e1000_82576 || if (hw->mac.type != e1000_82576 ||
(hw->phy.media_type != e1000_media_type_fiber && hw->phy.media_type != e1000_media_type_internal_serdes)
hw->phy.media_type != e1000_media_type_internal_serdes))
return; return;
/* if the management interface is not enabled, then power down */ /* if the management interface is not enabled, then power down */
......
...@@ -61,8 +61,7 @@ enum e1000_mac_type { ...@@ -61,8 +61,7 @@ enum e1000_mac_type {
enum e1000_media_type { enum e1000_media_type {
e1000_media_type_unknown = 0, e1000_media_type_unknown = 0,
e1000_media_type_copper = 1, e1000_media_type_copper = 1,
e1000_media_type_fiber = 2, e1000_media_type_internal_serdes = 2,
e1000_media_type_internal_serdes = 3,
e1000_num_media_types e1000_num_media_types
}; };
......
...@@ -713,8 +713,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -713,8 +713,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
* configuration of the MAC to match the "fc" parameter. * configuration of the MAC to match the "fc" parameter.
*/ */
if (mac->autoneg_failed) { if (mac->autoneg_failed) {
if (hw->phy.media_type == e1000_media_type_fiber || if (hw->phy.media_type == e1000_media_type_internal_serdes)
hw->phy.media_type == e1000_media_type_internal_serdes)
ret_val = igb_force_mac_fc(hw); ret_val = igb_force_mac_fc(hw);
} else { } else {
if (hw->phy.media_type == e1000_media_type_copper) if (hw->phy.media_type == e1000_media_type_copper)
...@@ -1161,11 +1160,6 @@ s32 igb_blink_led(struct e1000_hw *hw) ...@@ -1161,11 +1160,6 @@ s32 igb_blink_led(struct e1000_hw *hw)
u32 ledctl_blink = 0; u32 ledctl_blink = 0;
u32 i; u32 i;
if (hw->phy.media_type == e1000_media_type_fiber) {
/* always blink LED0 for PCI-E fiber */
ledctl_blink = E1000_LEDCTL_LED0_BLINK |
(E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT);
} else {
/* /*
* set the blink bit for each LED that's "on" (0x0E) * set the blink bit for each LED that's "on" (0x0E)
* in ledctl_mode2 * in ledctl_mode2
...@@ -1176,7 +1170,6 @@ s32 igb_blink_led(struct e1000_hw *hw) ...@@ -1176,7 +1170,6 @@ s32 igb_blink_led(struct e1000_hw *hw)
E1000_LEDCTL_MODE_LED_ON) E1000_LEDCTL_MODE_LED_ON)
ledctl_blink |= (E1000_LEDCTL_LED0_BLINK << ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
(i * 8)); (i * 8));
}
wr32(E1000_LEDCTL, ledctl_blink); wr32(E1000_LEDCTL, ledctl_blink);
...@@ -1191,15 +1184,7 @@ s32 igb_blink_led(struct e1000_hw *hw) ...@@ -1191,15 +1184,7 @@ s32 igb_blink_led(struct e1000_hw *hw)
**/ **/
s32 igb_led_off(struct e1000_hw *hw) s32 igb_led_off(struct e1000_hw *hw)
{ {
u32 ctrl;
switch (hw->phy.media_type) { switch (hw->phy.media_type) {
case e1000_media_type_fiber:
ctrl = rd32(E1000_CTRL);
ctrl |= E1000_CTRL_SWDPIN0;
ctrl |= E1000_CTRL_SWDPIO0;
wr32(E1000_CTRL, ctrl);
break;
case e1000_media_type_copper: case e1000_media_type_copper:
wr32(E1000_LEDCTL, hw->mac.ledctl_mode1); wr32(E1000_LEDCTL, hw->mac.ledctl_mode1);
break; break;
......
...@@ -168,8 +168,7 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -168,8 +168,7 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ecmd->duplex = -1; ecmd->duplex = -1;
} }
ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) || ecmd->autoneg = hw->mac.autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE;
hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE;
return 0; return 0;
} }
...@@ -191,23 +190,18 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -191,23 +190,18 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
if (ecmd->autoneg == AUTONEG_ENABLE) { if (ecmd->autoneg == AUTONEG_ENABLE) {
hw->mac.autoneg = 1; hw->mac.autoneg = 1;
if (hw->phy.media_type == e1000_media_type_fiber)
hw->phy.autoneg_advertised = ADVERTISED_1000baseT_Full |
ADVERTISED_FIBRE |
ADVERTISED_Autoneg;
else
hw->phy.autoneg_advertised = ecmd->advertising | hw->phy.autoneg_advertised = ecmd->advertising |
ADVERTISED_TP | ADVERTISED_TP |
ADVERTISED_Autoneg; ADVERTISED_Autoneg;
ecmd->advertising = hw->phy.autoneg_advertised; ecmd->advertising = hw->phy.autoneg_advertised;
} else } else {
if (igb_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) { if (igb_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
clear_bit(__IGB_RESETTING, &adapter->state); clear_bit(__IGB_RESETTING, &adapter->state);
return -EINVAL; return -EINVAL;
} }
}
/* reset the link */ /* reset the link */
if (netif_running(adapter->netdev)) { if (netif_running(adapter->netdev)) {
igb_down(adapter); igb_down(adapter);
igb_up(adapter); igb_up(adapter);
...@@ -267,8 +261,8 @@ static int igb_set_pauseparam(struct net_device *netdev, ...@@ -267,8 +261,8 @@ static int igb_set_pauseparam(struct net_device *netdev,
} else } else
igb_reset(adapter); igb_reset(adapter);
} else } else
retval = ((hw->phy.media_type == e1000_media_type_fiber) ? retval = ((hw->phy.media_type == e1000_media_type_copper) ?
igb_setup_link(hw) : igb_force_mac_fc(hw)); igb_force_mac_fc(hw) : igb_setup_link(hw));
clear_bit(__IGB_RESETTING, &adapter->state); clear_bit(__IGB_RESETTING, &adapter->state);
return retval; return retval;
...@@ -1483,8 +1477,7 @@ static int igb_setup_loopback_test(struct igb_adapter *adapter) ...@@ -1483,8 +1477,7 @@ static int igb_setup_loopback_test(struct igb_adapter *adapter)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 reg; u32 reg;
if (hw->phy.media_type == e1000_media_type_fiber || if (hw->phy.media_type == e1000_media_type_internal_serdes) {
hw->phy.media_type == e1000_media_type_internal_serdes) {
reg = rd32(E1000_RCTL); reg = rd32(E1000_RCTL);
reg |= E1000_RCTL_LBM_TCVR; reg |= E1000_RCTL_LBM_TCVR;
wr32(E1000_RCTL, reg); wr32(E1000_RCTL, reg);
......
...@@ -2618,10 +2618,6 @@ static bool igb_has_link(struct igb_adapter *adapter) ...@@ -2618,10 +2618,6 @@ static bool igb_has_link(struct igb_adapter *adapter)
link_active = true; link_active = true;
} }
break; break;
case e1000_media_type_fiber:
ret_val = hw->mac.ops.check_for_link(hw);
link_active = !!(rd32(E1000_STATUS) & E1000_STATUS_LU);
break;
case e1000_media_type_internal_serdes: case e1000_media_type_internal_serdes:
ret_val = hw->mac.ops.check_for_link(hw); ret_val = hw->mac.ops.check_for_link(hw);
link_active = hw->mac.serdes_has_link; link_active = hw->mac.serdes_has_link;
...@@ -5136,14 +5132,6 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx) ...@@ -5136,14 +5132,6 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
mac->autoneg = 0; mac->autoneg = 0;
/* Fiber NICs only allow 1000 gbps Full duplex */
if ((adapter->hw.phy.media_type == e1000_media_type_fiber) &&
spddplx != (SPEED_1000 + DUPLEX_FULL)) {
dev_err(&adapter->pdev->dev,
"Unsupported Speed/Duplex configuration\n");
return -EINVAL;
}
switch (spddplx) { switch (spddplx) {
case SPEED_10 + DUPLEX_HALF: case SPEED_10 + DUPLEX_HALF:
mac->forced_speed_duplex = ADVERTISE_10_HALF; mac->forced_speed_duplex = ADVERTISE_10_HALF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment