aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-03-04 04:06:10 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-07 21:10:22 -0500
commit2b642ca5e93fa1c977e8c90480a2900149f262be (patch)
tree488baa822fca95311eae09111c84327073c7d6e9 /drivers/net/ixgbe/ixgbe_ethtool.c
parentda74cd4a2f64b01c14c4bf7df355a982f1e2ab18 (diff)
ixgbe: fix setting and reporting of advertised speeds
Add the ability to set 100/F on x540. Fix reporting of advertised modes by adding check for phy.autoneg_advertised Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 83511c022926..76380a2b35aa 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -161,29 +161,25 @@ static int ixgbe_get_settings(struct net_device *netdev,
161 } 161 }
162 162
163 ecmd->advertising = ADVERTISED_Autoneg; 163 ecmd->advertising = ADVERTISED_Autoneg;
164 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL) 164 if (hw->phy.autoneg_advertised) {
165 ecmd->advertising |= ADVERTISED_100baseT_Full; 165 if (hw->phy.autoneg_advertised &
166 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) 166 IXGBE_LINK_SPEED_100_FULL)
167 ecmd->advertising |= ADVERTISED_10000baseT_Full; 167 ecmd->advertising |= ADVERTISED_100baseT_Full;
168 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) 168 if (hw->phy.autoneg_advertised &
169 ecmd->advertising |= ADVERTISED_1000baseT_Full; 169 IXGBE_LINK_SPEED_10GB_FULL)
170 /* 170 ecmd->advertising |= ADVERTISED_10000baseT_Full;
171 * It's possible that phy.autoneg_advertised may not be 171 if (hw->phy.autoneg_advertised &
172 * set yet. If so display what the default would be - 172 IXGBE_LINK_SPEED_1GB_FULL)
173 * both 1G and 10G supported. 173 ecmd->advertising |= ADVERTISED_1000baseT_Full;
174 */ 174 } else {
175 if (!(ecmd->advertising & (ADVERTISED_1000baseT_Full | 175 /*
176 ADVERTISED_10000baseT_Full))) 176 * Default advertised modes in case
177 * phy.autoneg_advertised isn't set.
178 */
177 ecmd->advertising |= (ADVERTISED_10000baseT_Full | 179 ecmd->advertising |= (ADVERTISED_10000baseT_Full |
178 ADVERTISED_1000baseT_Full); 180 ADVERTISED_1000baseT_Full);
179 181 if (hw->mac.type == ixgbe_mac_X540)
180 switch (hw->mac.type) { 182 ecmd->advertising |= ADVERTISED_100baseT_Full;
181 case ixgbe_mac_X540:
182 if (!(ecmd->advertising & ADVERTISED_100baseT_Full))
183 ecmd->advertising |= (ADVERTISED_100baseT_Full);
184 break;
185 default:
186 break;
187 } 183 }
188 184
189 if (hw->phy.media_type == ixgbe_media_type_copper) { 185 if (hw->phy.media_type == ixgbe_media_type_copper) {
@@ -336,6 +332,9 @@ static int ixgbe_set_settings(struct net_device *netdev,
336 if (ecmd->advertising & ADVERTISED_1000baseT_Full) 332 if (ecmd->advertising & ADVERTISED_1000baseT_Full)
337 advertised |= IXGBE_LINK_SPEED_1GB_FULL; 333 advertised |= IXGBE_LINK_SPEED_1GB_FULL;
338 334
335 if (ecmd->advertising & ADVERTISED_100baseT_Full)
336 advertised |= IXGBE_LINK_SPEED_100_FULL;
337
339 if (old == advertised) 338 if (old == advertised)
340 return err; 339 return err;
341 /* this sets the link speed and restarts auto-neg */ 340 /* this sets the link speed and restarts auto-neg */