aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalli Chilakala2005-06-17 17:43:06 -0700
committerJeff Garzik2005-06-27 00:34:25 -0400
commit012609a877bbb7508e273d642b245d7633bc45a4 (patch)
treed0081421fc522a1aad37bb3a4c69518fffeb2266
parent4564327b46a8c6400cd10d6dd041f6b984539f88 (diff)
[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: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com> Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com>
-rw-r--r--drivers/net/e1000/e1000_ethtool.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 658d9bb6daf3..a8a2a63a47a2 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -141,9 +141,9 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
SUPPORTED_FIBRE |
SUPPORTED_Autoneg);
- ecmd->advertising = (SUPPORTED_1000baseT_Full |
- SUPPORTED_FIBRE |
- SUPPORTED_Autoneg);
+ ecmd->advertising = (ADVERTISED_1000baseT_Full |
+ ADVERTISED_FIBRE |
+ ADVERTISED_Autoneg);
ecmd->port = PORT_FIBRE;
@@ -184,8 +184,19 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
if(ecmd->autoneg == AUTONEG_ENABLE) {
hw->autoneg = 1;
- hw->autoneg_advertised = 0x002F;
- ecmd->advertising = 0x002F;
+ if(hw->media_type == e1000_media_type_fiber)
+ 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
if(e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))
return -EINVAL;