diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-07-23 14:07:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-26 12:46:41 -0400 |
commit | dcc3ae9a5252ea4ffe65b43cdc09ec2654b48000 (patch) | |
tree | 7c3c1c480e8ce395c2b3b5b78802f97e28b60b80 /drivers/net/igb | |
parent | 74d154189d597b91da4322996dbf4f5c3d1544ab (diff) |
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: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/e1000_82575.c | 3 | ||||
-rw-r--r-- | drivers/net/igb/e1000_hw.h | 3 | ||||
-rw-r--r-- | drivers/net/igb/e1000_mac.c | 37 | ||||
-rw-r--r-- | drivers/net/igb/igb_ethtool.c | 25 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 12 |
5 files changed, 22 insertions, 58 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index ac28dd5a4fd1..bd3efdb95c64 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -867,8 +867,7 @@ void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw) | |||
867 | u32 reg; | 867 | u32 reg; |
868 | 868 | ||
869 | if (hw->mac.type != e1000_82576 || | 869 | if (hw->mac.type != e1000_82576 || |
870 | (hw->phy.media_type != e1000_media_type_fiber && | 870 | hw->phy.media_type != e1000_media_type_internal_serdes) |
871 | hw->phy.media_type != e1000_media_type_internal_serdes)) | ||
872 | return; | 871 | return; |
873 | 872 | ||
874 | /* if the management interface is not enabled, then power down */ | 873 | /* if the management interface is not enabled, then power down */ |
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h index 68aac20c31ca..f096ddd84293 100644 --- a/drivers/net/igb/e1000_hw.h +++ b/drivers/net/igb/e1000_hw.h | |||
@@ -61,8 +61,7 @@ enum e1000_mac_type { | |||
61 | enum e1000_media_type { | 61 | enum e1000_media_type { |
62 | e1000_media_type_unknown = 0, | 62 | e1000_media_type_unknown = 0, |
63 | e1000_media_type_copper = 1, | 63 | e1000_media_type_copper = 1, |
64 | e1000_media_type_fiber = 2, | 64 | e1000_media_type_internal_serdes = 2, |
65 | e1000_media_type_internal_serdes = 3, | ||
66 | e1000_num_media_types | 65 | e1000_num_media_types |
67 | }; | 66 | }; |
68 | 67 | ||
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c index 472f3f124840..37706d9981e8 100644 --- a/drivers/net/igb/e1000_mac.c +++ b/drivers/net/igb/e1000_mac.c | |||
@@ -713,8 +713,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw) | |||
713 | * configuration of the MAC to match the "fc" parameter. | 713 | * configuration of the MAC to match the "fc" parameter. |
714 | */ | 714 | */ |
715 | if (mac->autoneg_failed) { | 715 | if (mac->autoneg_failed) { |
716 | if (hw->phy.media_type == e1000_media_type_fiber || | 716 | if (hw->phy.media_type == e1000_media_type_internal_serdes) |
717 | hw->phy.media_type == e1000_media_type_internal_serdes) | ||
718 | ret_val = igb_force_mac_fc(hw); | 717 | ret_val = igb_force_mac_fc(hw); |
719 | } else { | 718 | } else { |
720 | if (hw->phy.media_type == e1000_media_type_copper) | 719 | if (hw->phy.media_type == e1000_media_type_copper) |
@@ -1161,22 +1160,16 @@ s32 igb_blink_led(struct e1000_hw *hw) | |||
1161 | u32 ledctl_blink = 0; | 1160 | u32 ledctl_blink = 0; |
1162 | u32 i; | 1161 | u32 i; |
1163 | 1162 | ||
1164 | if (hw->phy.media_type == e1000_media_type_fiber) { | 1163 | /* |
1165 | /* always blink LED0 for PCI-E fiber */ | 1164 | * set the blink bit for each LED that's "on" (0x0E) |
1166 | ledctl_blink = E1000_LEDCTL_LED0_BLINK | | 1165 | * in ledctl_mode2 |
1167 | (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT); | 1166 | */ |
1168 | } else { | 1167 | ledctl_blink = hw->mac.ledctl_mode2; |
1169 | /* | 1168 | for (i = 0; i < 4; i++) |
1170 | * set the blink bit for each LED that's "on" (0x0E) | 1169 | if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) == |
1171 | * in ledctl_mode2 | 1170 | E1000_LEDCTL_MODE_LED_ON) |
1172 | */ | 1171 | ledctl_blink |= (E1000_LEDCTL_LED0_BLINK << |
1173 | ledctl_blink = hw->mac.ledctl_mode2; | 1172 | (i * 8)); |
1174 | for (i = 0; i < 4; i++) | ||
1175 | if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) == | ||
1176 | E1000_LEDCTL_MODE_LED_ON) | ||
1177 | ledctl_blink |= (E1000_LEDCTL_LED0_BLINK << | ||
1178 | (i * 8)); | ||
1179 | } | ||
1180 | 1173 | ||
1181 | wr32(E1000_LEDCTL, ledctl_blink); | 1174 | wr32(E1000_LEDCTL, ledctl_blink); |
1182 | 1175 | ||
@@ -1191,15 +1184,7 @@ s32 igb_blink_led(struct e1000_hw *hw) | |||
1191 | **/ | 1184 | **/ |
1192 | s32 igb_led_off(struct e1000_hw *hw) | 1185 | s32 igb_led_off(struct e1000_hw *hw) |
1193 | { | 1186 | { |
1194 | u32 ctrl; | ||
1195 | |||
1196 | switch (hw->phy.media_type) { | 1187 | switch (hw->phy.media_type) { |
1197 | case e1000_media_type_fiber: | ||
1198 | ctrl = rd32(E1000_CTRL); | ||
1199 | ctrl |= E1000_CTRL_SWDPIN0; | ||
1200 | ctrl |= E1000_CTRL_SWDPIO0; | ||
1201 | wr32(E1000_CTRL, ctrl); | ||
1202 | break; | ||
1203 | case e1000_media_type_copper: | 1188 | case e1000_media_type_copper: |
1204 | wr32(E1000_LEDCTL, hw->mac.ledctl_mode1); | 1189 | wr32(E1000_LEDCTL, hw->mac.ledctl_mode1); |
1205 | break; | 1190 | break; |
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 9598ac09f4b8..a9c37cb1bd7a 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
@@ -168,8 +168,7 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
168 | ecmd->duplex = -1; | 168 | ecmd->duplex = -1; |
169 | } | 169 | } |
170 | 170 | ||
171 | ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) || | 171 | ecmd->autoneg = hw->mac.autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE; |
172 | hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE; | ||
173 | return 0; | 172 | return 0; |
174 | } | 173 | } |
175 | 174 | ||
@@ -191,23 +190,18 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
191 | 190 | ||
192 | if (ecmd->autoneg == AUTONEG_ENABLE) { | 191 | if (ecmd->autoneg == AUTONEG_ENABLE) { |
193 | hw->mac.autoneg = 1; | 192 | hw->mac.autoneg = 1; |
194 | if (hw->phy.media_type == e1000_media_type_fiber) | 193 | hw->phy.autoneg_advertised = ecmd->advertising | |
195 | hw->phy.autoneg_advertised = ADVERTISED_1000baseT_Full | | 194 | ADVERTISED_TP | |
196 | ADVERTISED_FIBRE | | 195 | ADVERTISED_Autoneg; |
197 | ADVERTISED_Autoneg; | ||
198 | else | ||
199 | hw->phy.autoneg_advertised = ecmd->advertising | | ||
200 | ADVERTISED_TP | | ||
201 | ADVERTISED_Autoneg; | ||
202 | ecmd->advertising = hw->phy.autoneg_advertised; | 196 | ecmd->advertising = hw->phy.autoneg_advertised; |
203 | } else | 197 | } else { |
204 | if (igb_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) { | 198 | if (igb_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) { |
205 | clear_bit(__IGB_RESETTING, &adapter->state); | 199 | clear_bit(__IGB_RESETTING, &adapter->state); |
206 | return -EINVAL; | 200 | return -EINVAL; |
207 | } | 201 | } |
202 | } | ||
208 | 203 | ||
209 | /* reset the link */ | 204 | /* reset the link */ |
210 | |||
211 | if (netif_running(adapter->netdev)) { | 205 | if (netif_running(adapter->netdev)) { |
212 | igb_down(adapter); | 206 | igb_down(adapter); |
213 | igb_up(adapter); | 207 | igb_up(adapter); |
@@ -267,8 +261,8 @@ static int igb_set_pauseparam(struct net_device *netdev, | |||
267 | } else | 261 | } else |
268 | igb_reset(adapter); | 262 | igb_reset(adapter); |
269 | } else | 263 | } else |
270 | retval = ((hw->phy.media_type == e1000_media_type_fiber) ? | 264 | retval = ((hw->phy.media_type == e1000_media_type_copper) ? |
271 | igb_setup_link(hw) : igb_force_mac_fc(hw)); | 265 | igb_force_mac_fc(hw) : igb_setup_link(hw)); |
272 | 266 | ||
273 | clear_bit(__IGB_RESETTING, &adapter->state); | 267 | clear_bit(__IGB_RESETTING, &adapter->state); |
274 | return retval; | 268 | return retval; |
@@ -1483,8 +1477,7 @@ static int igb_setup_loopback_test(struct igb_adapter *adapter) | |||
1483 | struct e1000_hw *hw = &adapter->hw; | 1477 | struct e1000_hw *hw = &adapter->hw; |
1484 | u32 reg; | 1478 | u32 reg; |
1485 | 1479 | ||
1486 | if (hw->phy.media_type == e1000_media_type_fiber || | 1480 | if (hw->phy.media_type == e1000_media_type_internal_serdes) { |
1487 | hw->phy.media_type == e1000_media_type_internal_serdes) { | ||
1488 | reg = rd32(E1000_RCTL); | 1481 | reg = rd32(E1000_RCTL); |
1489 | reg |= E1000_RCTL_LBM_TCVR; | 1482 | reg |= E1000_RCTL_LBM_TCVR; |
1490 | wr32(E1000_RCTL, reg); | 1483 | wr32(E1000_RCTL, reg); |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index adb09d32625d..39b3b6aa650b 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2618,10 +2618,6 @@ static bool igb_has_link(struct igb_adapter *adapter) | |||
2618 | link_active = true; | 2618 | link_active = true; |
2619 | } | 2619 | } |
2620 | break; | 2620 | break; |
2621 | case e1000_media_type_fiber: | ||
2622 | ret_val = hw->mac.ops.check_for_link(hw); | ||
2623 | link_active = !!(rd32(E1000_STATUS) & E1000_STATUS_LU); | ||
2624 | break; | ||
2625 | case e1000_media_type_internal_serdes: | 2621 | case e1000_media_type_internal_serdes: |
2626 | ret_val = hw->mac.ops.check_for_link(hw); | 2622 | ret_val = hw->mac.ops.check_for_link(hw); |
2627 | link_active = hw->mac.serdes_has_link; | 2623 | link_active = hw->mac.serdes_has_link; |
@@ -5136,14 +5132,6 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx) | |||
5136 | 5132 | ||
5137 | mac->autoneg = 0; | 5133 | mac->autoneg = 0; |
5138 | 5134 | ||
5139 | /* Fiber NICs only allow 1000 gbps Full duplex */ | ||
5140 | if ((adapter->hw.phy.media_type == e1000_media_type_fiber) && | ||
5141 | spddplx != (SPEED_1000 + DUPLEX_FULL)) { | ||
5142 | dev_err(&adapter->pdev->dev, | ||
5143 | "Unsupported Speed/Duplex configuration\n"); | ||
5144 | return -EINVAL; | ||
5145 | } | ||
5146 | |||
5147 | switch (spddplx) { | 5135 | switch (spddplx) { |
5148 | case SPEED_10 + DUPLEX_HALF: | 5136 | case SPEED_10 + DUPLEX_HALF: |
5149 | mac->forced_speed_duplex = ADVERTISE_10_HALF; | 5137 | mac->forced_speed_duplex = ADVERTISE_10_HALF; |