aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-02-07 00:46:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-07 00:46:54 -0500
commit0ecc061d1967e9f2694502079e00d9d6e1e39072 (patch)
tree40a06f43717f97d6dade8fbb55bad15740033799 /drivers/net/ixgbe/ixgbe_ethtool.c
parent394827913e371b058849349c6fc9d52c59c31a3d (diff)
ixgbe: Update flow control state machine in link setup
The flow control handling is overly complicated and difficult to maintain. This patch cleans up the flow control handling and makes it much more explicit. It also adds 1G flow control autonegotiation, for 1G copper links, 1G KX links, and 1G fiber links. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@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.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 54d96cb05b48..cec2f4e8c61e 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -224,13 +224,13 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
224 struct ixgbe_adapter *adapter = netdev_priv(netdev); 224 struct ixgbe_adapter *adapter = netdev_priv(netdev);
225 struct ixgbe_hw *hw = &adapter->hw; 225 struct ixgbe_hw *hw = &adapter->hw;
226 226
227 pause->autoneg = (hw->fc.type == ixgbe_fc_full ? 1 : 0); 227 pause->autoneg = (hw->fc.current_mode == ixgbe_fc_full ? 1 : 0);
228 228
229 if (hw->fc.type == ixgbe_fc_rx_pause) { 229 if (hw->fc.current_mode == ixgbe_fc_rx_pause) {
230 pause->rx_pause = 1; 230 pause->rx_pause = 1;
231 } else if (hw->fc.type == ixgbe_fc_tx_pause) { 231 } else if (hw->fc.current_mode == ixgbe_fc_tx_pause) {
232 pause->tx_pause = 1; 232 pause->tx_pause = 1;
233 } else if (hw->fc.type == ixgbe_fc_full) { 233 } else if (hw->fc.current_mode == ixgbe_fc_full) {
234 pause->rx_pause = 1; 234 pause->rx_pause = 1;
235 pause->tx_pause = 1; 235 pause->tx_pause = 1;
236 } 236 }
@@ -244,22 +244,17 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
244 244
245 if ((pause->autoneg == AUTONEG_ENABLE) || 245 if ((pause->autoneg == AUTONEG_ENABLE) ||
246 (pause->rx_pause && pause->tx_pause)) 246 (pause->rx_pause && pause->tx_pause))
247 hw->fc.type = ixgbe_fc_full; 247 hw->fc.requested_mode = ixgbe_fc_full;
248 else if (pause->rx_pause && !pause->tx_pause) 248 else if (pause->rx_pause && !pause->tx_pause)
249 hw->fc.type = ixgbe_fc_rx_pause; 249 hw->fc.requested_mode = ixgbe_fc_rx_pause;
250 else if (!pause->rx_pause && pause->tx_pause) 250 else if (!pause->rx_pause && pause->tx_pause)
251 hw->fc.type = ixgbe_fc_tx_pause; 251 hw->fc.requested_mode = ixgbe_fc_tx_pause;
252 else if (!pause->rx_pause && !pause->tx_pause) 252 else if (!pause->rx_pause && !pause->tx_pause)
253 hw->fc.type = ixgbe_fc_none; 253 hw->fc.requested_mode = ixgbe_fc_none;
254 else 254 else
255 return -EINVAL; 255 return -EINVAL;
256 256
257 hw->fc.original_type = hw->fc.type; 257 hw->mac.ops.setup_fc(hw, 0);
258
259 if (netif_running(netdev))
260 ixgbe_reinit_locked(adapter);
261 else
262 ixgbe_reset(adapter);
263 258
264 return 0; 259 return 0;
265} 260}