diff options
author | Malli Chilakala <mallikarjuna.chilakala@intel.com> | 2005-06-17 20:43:06 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-27 00:34:25 -0400 |
commit | 012609a877bbb7508e273d642b245d7633bc45a4 (patch) | |
tree | d0081421fc522a1aad37bb3a4c69518fffeb2266 /drivers/net/e1000 | |
parent | 4564327b46a8c6400cd10d6dd041f6b984539f88 (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>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 21 |
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) | |||
141 | SUPPORTED_FIBRE | | 141 | SUPPORTED_FIBRE | |
142 | SUPPORTED_Autoneg); | 142 | SUPPORTED_Autoneg); |
143 | 143 | ||
144 | ecmd->advertising = (SUPPORTED_1000baseT_Full | | 144 | ecmd->advertising = (ADVERTISED_1000baseT_Full | |
145 | SUPPORTED_FIBRE | | 145 | ADVERTISED_FIBRE | |
146 | SUPPORTED_Autoneg); | 146 | ADVERTISED_Autoneg); |
147 | 147 | ||
148 | ecmd->port = PORT_FIBRE; | 148 | ecmd->port = PORT_FIBRE; |
149 | 149 | ||
@@ -184,8 +184,19 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
184 | 184 | ||
185 | if(ecmd->autoneg == AUTONEG_ENABLE) { | 185 | if(ecmd->autoneg == AUTONEG_ENABLE) { |
186 | hw->autoneg = 1; | 186 | hw->autoneg = 1; |
187 | hw->autoneg_advertised = 0x002F; | 187 | if(hw->media_type == e1000_media_type_fiber) |
188 | ecmd->advertising = 0x002F; | 188 | hw->autoneg_advertised = ADVERTISED_1000baseT_Full | |
189 | ADVERTISED_FIBRE | | ||
190 | ADVERTISED_Autoneg; | ||
191 | else | ||
192 | hw->autoneg_advertised = ADVERTISED_10baseT_Half | | ||
193 | ADVERTISED_10baseT_Full | | ||
194 | ADVERTISED_100baseT_Half | | ||
195 | ADVERTISED_100baseT_Full | | ||
196 | ADVERTISED_1000baseT_Full| | ||
197 | ADVERTISED_Autoneg | | ||
198 | ADVERTISED_TP; | ||
199 | ecmd->advertising = hw->autoneg_advertised; | ||
189 | } else | 200 | } else |
190 | if(e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) | 201 | if(e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) |
191 | return -EINVAL; | 202 | return -EINVAL; |