ixgbe: Adding 100MB FULL support in ethtool
authorAtita Shirwaikar <atita.shirwaikar@intel.com>
Wed, 5 Jan 2011 02:00:55 +0000 (02:00 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 11 Feb 2011 16:57:39 +0000 (08:57 -0800)
Current driver does not show 100MB support in ethtool.
Adding support for the same.

Signed-off-by: Atita Shirwaikar <atita.shirwaikar@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/ixgbe/ixgbe_main.c

index 2002ea88ca2af8377240eebd60a177a8abc641db..309272f8f10334122ade6561bfe2de17d151e594 100644 (file)
@@ -152,7 +152,17 @@ static int ixgbe_get_settings(struct net_device *netdev,
                ecmd->supported |= (SUPPORTED_1000baseT_Full |
                                    SUPPORTED_Autoneg);
 
+               switch (hw->mac.type) {
+               case ixgbe_mac_X540:
+                       ecmd->supported |= SUPPORTED_100baseT_Full;
+                       break;
+               default:
+                       break;
+               }
+
                ecmd->advertising = ADVERTISED_Autoneg;
+               if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
+                       ecmd->advertising |= ADVERTISED_100baseT_Full;
                if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
                        ecmd->advertising |= ADVERTISED_10000baseT_Full;
                if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
@@ -167,6 +177,15 @@ static int ixgbe_get_settings(struct net_device *netdev,
                        ecmd->advertising |= (ADVERTISED_10000baseT_Full |
                                              ADVERTISED_1000baseT_Full);
 
+               switch (hw->mac.type) {
+               case ixgbe_mac_X540:
+                       if (!(ecmd->advertising & ADVERTISED_100baseT_Full))
+                               ecmd->advertising |= (ADVERTISED_100baseT_Full);
+                       break;
+               default:
+                       break;
+               }
+
                if (hw->phy.media_type == ixgbe_media_type_copper) {
                        ecmd->supported |= SUPPORTED_TP;
                        ecmd->advertising |= ADVERTISED_TP;
@@ -271,8 +290,19 @@ static int ixgbe_get_settings(struct net_device *netdev,
 
        hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
        if (link_up) {
-               ecmd->speed = (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ?
-                              SPEED_10000 : SPEED_1000;
+               switch (link_speed) {
+               case IXGBE_LINK_SPEED_10GB_FULL:
+                       ecmd->speed = SPEED_10000;
+                       break;
+               case IXGBE_LINK_SPEED_1GB_FULL:
+                       ecmd->speed = SPEED_1000;
+                       break;
+               case IXGBE_LINK_SPEED_100_FULL:
+                       ecmd->speed = SPEED_100;
+                       break;
+               default:
+                       break;
+               }
                ecmd->duplex = DUPLEX_FULL;
        } else {
                ecmd->speed = -1;
index 4a6bcb66d2a8e20ed2de7dd8ed404b25b64248b2..4f81b5a007759f9e679190114cec0ac0d0e17899 100644 (file)
@@ -6102,7 +6102,10 @@ static void ixgbe_watchdog_task(struct work_struct *work)
                               (link_speed == IXGBE_LINK_SPEED_10GB_FULL ?
                               "10 Gbps" :
                               (link_speed == IXGBE_LINK_SPEED_1GB_FULL ?
-                              "1 Gbps" : "unknown speed")),
+                              "1 Gbps" :
+                              (link_speed == IXGBE_LINK_SPEED_100_FULL ?
+                              "100 Mbps" :
+                              "unknown speed"))),
                               ((flow_rx && flow_tx) ? "RX/TX" :
                               (flow_rx ? "RX" :
                               (flow_tx ? "TX" : "None"))));