diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2009-03-31 17:35:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-02 04:02:32 -0400 |
commit | 71fd570b23ee74bca052beb9e88f8f57fb668ac7 (patch) | |
tree | 8b5bdc6a968da24553eed355e38faaaf0bc61c1e /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | a20a1199a8a7f2bc92bd2a01e212980328e42bc7 (diff) |
ixgbe: fix ethtool -A|a behavior
We were basicly ignoring ethtool users request for FC autoneg
and replying to queries with a "best guess". This patch
enables the driver to store if we want to enable/disable
autoneg FC and do the correct behavior.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 34b4a84d2e77..55970ec72de3 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -234,7 +234,16 @@ static void ixgbe_get_pauseparam(struct net_device *netdev, | |||
234 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 234 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
235 | struct ixgbe_hw *hw = &adapter->hw; | 235 | struct ixgbe_hw *hw = &adapter->hw; |
236 | 236 | ||
237 | pause->autoneg = (hw->fc.current_mode == ixgbe_fc_full ? 1 : 0); | 237 | /* |
238 | * Flow Control Autoneg isn't on if | ||
239 | * - we didn't ask for it OR | ||
240 | * - it failed, we know this by tx & rx being off | ||
241 | */ | ||
242 | if (hw->fc.disable_fc_autoneg || | ||
243 | (hw->fc.current_mode == ixgbe_fc_none)) | ||
244 | pause->autoneg = 0; | ||
245 | else | ||
246 | pause->autoneg = 1; | ||
238 | 247 | ||
239 | if (hw->fc.current_mode == ixgbe_fc_rx_pause) { | 248 | if (hw->fc.current_mode == ixgbe_fc_rx_pause) { |
240 | pause->rx_pause = 1; | 249 | pause->rx_pause = 1; |
@@ -252,8 +261,12 @@ static int ixgbe_set_pauseparam(struct net_device *netdev, | |||
252 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 261 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
253 | struct ixgbe_hw *hw = &adapter->hw; | 262 | struct ixgbe_hw *hw = &adapter->hw; |
254 | 263 | ||
255 | if ((pause->autoneg == AUTONEG_ENABLE) || | 264 | if (pause->autoneg != AUTONEG_ENABLE) |
256 | (pause->rx_pause && pause->tx_pause)) | 265 | hw->fc.disable_fc_autoneg = true; |
266 | else | ||
267 | hw->fc.disable_fc_autoneg = false; | ||
268 | |||
269 | if (pause->rx_pause && pause->tx_pause) | ||
257 | hw->fc.requested_mode = ixgbe_fc_full; | 270 | hw->fc.requested_mode = ixgbe_fc_full; |
258 | else if (pause->rx_pause && !pause->tx_pause) | 271 | else if (pause->rx_pause && !pause->tx_pause) |
259 | hw->fc.requested_mode = ixgbe_fc_rx_pause; | 272 | hw->fc.requested_mode = ixgbe_fc_rx_pause; |