aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c57
1 files changed, 43 insertions, 14 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 2002ea88ca2a..76380a2b35aa 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2010 Intel Corporation. 4 Copyright(c) 1999 - 2011 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -152,20 +152,35 @@ static int ixgbe_get_settings(struct net_device *netdev,
152 ecmd->supported |= (SUPPORTED_1000baseT_Full | 152 ecmd->supported |= (SUPPORTED_1000baseT_Full |
153 SUPPORTED_Autoneg); 153 SUPPORTED_Autoneg);
154 154
155 switch (hw->mac.type) {
156 case ixgbe_mac_X540:
157 ecmd->supported |= SUPPORTED_100baseT_Full;
158 break;
159 default:
160 break;
161 }
162
155 ecmd->advertising = ADVERTISED_Autoneg; 163 ecmd->advertising = ADVERTISED_Autoneg;
156 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) 164 if (hw->phy.autoneg_advertised) {
157 ecmd->advertising |= ADVERTISED_10000baseT_Full; 165 if (hw->phy.autoneg_advertised &
158 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) 166 IXGBE_LINK_SPEED_100_FULL)
159 ecmd->advertising |= ADVERTISED_1000baseT_Full; 167 ecmd->advertising |= ADVERTISED_100baseT_Full;
160 /* 168 if (hw->phy.autoneg_advertised &
161 * It's possible that phy.autoneg_advertised may not be 169 IXGBE_LINK_SPEED_10GB_FULL)
162 * set yet. If so display what the default would be - 170 ecmd->advertising |= ADVERTISED_10000baseT_Full;
163 * both 1G and 10G supported. 171 if (hw->phy.autoneg_advertised &
164 */ 172 IXGBE_LINK_SPEED_1GB_FULL)
165 if (!(ecmd->advertising & (ADVERTISED_1000baseT_Full | 173 ecmd->advertising |= ADVERTISED_1000baseT_Full;
166 ADVERTISED_10000baseT_Full))) 174 } else {
175 /*
176 * Default advertised modes in case
177 * phy.autoneg_advertised isn't set.
178 */
167 ecmd->advertising |= (ADVERTISED_10000baseT_Full | 179 ecmd->advertising |= (ADVERTISED_10000baseT_Full |
168 ADVERTISED_1000baseT_Full); 180 ADVERTISED_1000baseT_Full);
181 if (hw->mac.type == ixgbe_mac_X540)
182 ecmd->advertising |= ADVERTISED_100baseT_Full;
183 }
169 184
170 if (hw->phy.media_type == ixgbe_media_type_copper) { 185 if (hw->phy.media_type == ixgbe_media_type_copper) {
171 ecmd->supported |= SUPPORTED_TP; 186 ecmd->supported |= SUPPORTED_TP;
@@ -271,8 +286,19 @@ static int ixgbe_get_settings(struct net_device *netdev,
271 286
272 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); 287 hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
273 if (link_up) { 288 if (link_up) {
274 ecmd->speed = (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? 289 switch (link_speed) {
275 SPEED_10000 : SPEED_1000; 290 case IXGBE_LINK_SPEED_10GB_FULL:
291 ecmd->speed = SPEED_10000;
292 break;
293 case IXGBE_LINK_SPEED_1GB_FULL:
294 ecmd->speed = SPEED_1000;
295 break;
296 case IXGBE_LINK_SPEED_100_FULL:
297 ecmd->speed = SPEED_100;
298 break;
299 default:
300 break;
301 }
276 ecmd->duplex = DUPLEX_FULL; 302 ecmd->duplex = DUPLEX_FULL;
277 } else { 303 } else {
278 ecmd->speed = -1; 304 ecmd->speed = -1;
@@ -306,6 +332,9 @@ static int ixgbe_set_settings(struct net_device *netdev,
306 if (ecmd->advertising & ADVERTISED_1000baseT_Full) 332 if (ecmd->advertising & ADVERTISED_1000baseT_Full)
307 advertised |= IXGBE_LINK_SPEED_1GB_FULL; 333 advertised |= IXGBE_LINK_SPEED_1GB_FULL;
308 334
335 if (ecmd->advertising & ADVERTISED_100baseT_Full)
336 advertised |= IXGBE_LINK_SPEED_100_FULL;
337
309 if (old == advertised) 338 if (old == advertised)
310 return err; 339 return err;
311 /* this sets the link speed and restarts auto-neg */ 340 /* this sets the link speed and restarts auto-neg */