Skip to content

Commit

Permalink
ixgbe: Fix pause code for ethtool
Browse files Browse the repository at this point in the history
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Ayyappan Veeraiyan authored and Jeff Garzik committed Feb 5, 2008
1 parent 735441f commit 9c83b07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;

pause->autoneg = AUTONEG_DISABLE;
pause->autoneg = (hw->fc.type == ixgbe_fc_full ? 1 : 0);

if (hw->fc.type == ixgbe_fc_rx_pause) {
pause->rx_pause = 1;
Expand All @@ -185,17 +185,17 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;

if (pause->autoneg == AUTONEG_ENABLE)
return -EINVAL;

if (pause->rx_pause && pause->tx_pause)
if ((pause->autoneg == AUTONEG_ENABLE) ||
(pause->rx_pause && pause->tx_pause))
hw->fc.type = ixgbe_fc_full;
else if (pause->rx_pause && !pause->tx_pause)
hw->fc.type = ixgbe_fc_rx_pause;
else if (!pause->rx_pause && pause->tx_pause)
hw->fc.type = ixgbe_fc_tx_pause;
else if (!pause->rx_pause && !pause->tx_pause)
hw->fc.type = ixgbe_fc_none;
else
return -EINVAL;

hw->fc.original_type = hw->fc.type;

Expand Down

0 comments on commit 9c83b07

Please sign in to comment.