Commit 012609a8 authored by Malli Chilakala's avatar Malli Chilakala Committed by Jeff Garzik

[PATCH] e1000: Ethtool cleanup patch from Stephen Hemminger

Ethtool cleanup patch from Stephen Hemminger
   * use ADVERTISED_xxx fields when setting advertised fields
   * don't hardcode constant for advertised field
Signed-off-by: default avatarMallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: default avatarGanesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
parent 4564327b
...@@ -141,9 +141,9 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -141,9 +141,9 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
SUPPORTED_FIBRE | SUPPORTED_FIBRE |
SUPPORTED_Autoneg); SUPPORTED_Autoneg);
ecmd->advertising = (SUPPORTED_1000baseT_Full | ecmd->advertising = (ADVERTISED_1000baseT_Full |
SUPPORTED_FIBRE | ADVERTISED_FIBRE |
SUPPORTED_Autoneg); ADVERTISED_Autoneg);
ecmd->port = PORT_FIBRE; ecmd->port = PORT_FIBRE;
...@@ -184,8 +184,19 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -184,8 +184,19 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
if(ecmd->autoneg == AUTONEG_ENABLE) { if(ecmd->autoneg == AUTONEG_ENABLE) {
hw->autoneg = 1; hw->autoneg = 1;
hw->autoneg_advertised = 0x002F; if(hw->media_type == e1000_media_type_fiber)
ecmd->advertising = 0x002F; hw->autoneg_advertised = ADVERTISED_1000baseT_Full |
ADVERTISED_FIBRE |
ADVERTISED_Autoneg;
else
hw->autoneg_advertised = ADVERTISED_10baseT_Half |
ADVERTISED_10baseT_Full |
ADVERTISED_100baseT_Half |
ADVERTISED_100baseT_Full |
ADVERTISED_1000baseT_Full|
ADVERTISED_Autoneg |
ADVERTISED_TP;
ecmd->advertising = hw->autoneg_advertised;
} else } else
if(e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) if(e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))
return -EINVAL; return -EINVAL;
......
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