igb: remove media type fiber as it is misleading
authorAlexander Duyck <alexander.h.duyck@intel.com>
Thu, 23 Jul 2009 18:07:20 +0000 (18:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Jul 2009 16:46:41 +0000 (09:46 -0700)
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>
drivers/net/igb/e1000_82575.c
drivers/net/igb/e1000_hw.h
drivers/net/igb/e1000_mac.c
drivers/net/igb/igb_ethtool.c
drivers/net/igb/igb_main.c

index ac28dd5a4fd137f7cd522bbcf20fb3338ecffc38..bd3efdb95c6471765b65adfd90c967426a501b5e 100644 (file)
@@ -867,8 +867,7 @@ void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw)
        u32 reg;
 
        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;
 
        /* if the management interface is not enabled, then power down */
index 68aac20c31cac92164acd0f787cc312672deab64..f096ddd842933d961fc156c3ea786361d355f56e 100644 (file)
@@ -61,8 +61,7 @@ enum e1000_mac_type {
 enum e1000_media_type {
        e1000_media_type_unknown = 0,
        e1000_media_type_copper = 1,
-       e1000_media_type_fiber = 2,
-       e1000_media_type_internal_serdes = 3,
+       e1000_media_type_internal_serdes = 2,
        e1000_num_media_types
 };
 
index 472f3f12484036479a13d37ed0e34be39c4582f6..37706d9981e8bf660f582b0dc13de540c00d7809 100644 (file)
@@ -713,8 +713,7 @@ s32 igb_config_fc_after_link_up(struct e1000_hw *hw)
         * configuration of the MAC to match the "fc" parameter.
         */
        if (mac->autoneg_failed) {
-               if (hw->phy.media_type == e1000_media_type_fiber ||
-                   hw->phy.media_type == e1000_media_type_internal_serdes)
+               if (hw->phy.media_type == e1000_media_type_internal_serdes)
                        ret_val = igb_force_mac_fc(hw);
        } else {
                if (hw->phy.media_type == e1000_media_type_copper)
@@ -1161,22 +1160,16 @@ s32 igb_blink_led(struct e1000_hw *hw)
        u32 ledctl_blink = 0;
        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)
-                * in ledctl_mode2
-                */
-               ledctl_blink = hw->mac.ledctl_mode2;
-               for (i = 0; i < 4; i++)
-                       if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
-                           E1000_LEDCTL_MODE_LED_ON)
-                               ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
-                                                (i * 8));
-       }
+       /*
+        * set the blink bit for each LED that's "on" (0x0E)
+        * in ledctl_mode2
+        */
+       ledctl_blink = hw->mac.ledctl_mode2;
+       for (i = 0; i < 4; i++)
+               if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
+                   E1000_LEDCTL_MODE_LED_ON)
+                       ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
+                                        (i * 8));
 
        wr32(E1000_LEDCTL, ledctl_blink);
 
@@ -1191,15 +1184,7 @@ s32 igb_blink_led(struct e1000_hw *hw)
  **/
 s32 igb_led_off(struct e1000_hw *hw)
 {
-       u32 ctrl;
-
        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:
                wr32(E1000_LEDCTL, hw->mac.ledctl_mode1);
                break;
index 9598ac09f4b87942da669029352e502e263aa968..a9c37cb1bd7ab4aede5a9551831939173014e801 100644 (file)
@@ -168,8 +168,7 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
                ecmd->duplex = -1;
        }
 
-       ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) ||
-                        hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE;
+       ecmd->autoneg = hw->mac.autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE;
        return 0;
 }
 
@@ -191,23 +190,18 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 
        if (ecmd->autoneg == AUTONEG_ENABLE) {
                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 |
-                                                    ADVERTISED_TP |
-                                                    ADVERTISED_Autoneg;
+               hw->phy.autoneg_advertised = ecmd->advertising |
+                                            ADVERTISED_TP |
+                                            ADVERTISED_Autoneg;
                ecmd->advertising = hw->phy.autoneg_advertised;
-       } else
+       } else {
                if (igb_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
                        clear_bit(__IGB_RESETTING, &adapter->state);
                        return -EINVAL;
                }
+       }
 
        /* reset the link */
-
        if (netif_running(adapter->netdev)) {
                igb_down(adapter);
                igb_up(adapter);
@@ -267,8 +261,8 @@ static int igb_set_pauseparam(struct net_device *netdev,
                } else
                        igb_reset(adapter);
        } else
-               retval = ((hw->phy.media_type == e1000_media_type_fiber) ?
-                         igb_setup_link(hw) : igb_force_mac_fc(hw));
+               retval = ((hw->phy.media_type == e1000_media_type_copper) ?
+                         igb_force_mac_fc(hw) : igb_setup_link(hw));
 
        clear_bit(__IGB_RESETTING, &adapter->state);
        return retval;
@@ -1483,8 +1477,7 @@ static int igb_setup_loopback_test(struct igb_adapter *adapter)
        struct e1000_hw *hw = &adapter->hw;
        u32 reg;
 
-       if (hw->phy.media_type == e1000_media_type_fiber ||
-           hw->phy.media_type == e1000_media_type_internal_serdes) {
+       if (hw->phy.media_type == e1000_media_type_internal_serdes) {
                reg = rd32(E1000_RCTL);
                reg |= E1000_RCTL_LBM_TCVR;
                wr32(E1000_RCTL, reg);
index adb09d32625df3c2b4a565324f17927ed2db033d..39b3b6aa650b2179131ed10d30bcb188e8e60b7f 100644 (file)
@@ -2618,10 +2618,6 @@ static bool igb_has_link(struct igb_adapter *adapter)
                        link_active = true;
                }
                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:
                ret_val = hw->mac.ops.check_for_link(hw);
                link_active = hw->mac.serdes_has_link;
@@ -5136,14 +5132,6 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
 
        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) {
        case SPEED_10 + DUPLEX_HALF:
                mac->forced_speed_duplex = ADVERTISE_10_HALF;