Skip to content

Commit

Permalink
igb: Supported and Advertised Pause Frame
Browse files Browse the repository at this point in the history
This patch add ethtool supports for Supported and Advertised Pause Frame,
based on Adapter Flow Control settings.

Signed-off-by: Akeem G. Abodunrin <[email protected]>
Tested-by: Jeff Pieper <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
  • Loading branch information
aabodunrin authored and Jeff Kirsher committed Sep 5, 2012
1 parent 9936a7b commit 42f3c43
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions drivers/net/ethernet/intel/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,31 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Full|
SUPPORTED_Autoneg |
SUPPORTED_TP);
ecmd->advertising = (ADVERTISED_TP |
ADVERTISED_Pause);
SUPPORTED_TP |
SUPPORTED_Pause);
ecmd->advertising = ADVERTISED_TP;

if (hw->mac.autoneg == 1) {
ecmd->advertising |= ADVERTISED_Autoneg;
/* the e1000 autoneg seems to match ethtool nicely */
ecmd->advertising |= hw->phy.autoneg_advertised;
}

if (hw->mac.autoneg != 1)
ecmd->advertising &= ~(ADVERTISED_Pause |
ADVERTISED_Asym_Pause);

if (hw->fc.requested_mode == e1000_fc_full)
ecmd->advertising |= ADVERTISED_Pause;
else if (hw->fc.requested_mode == e1000_fc_rx_pause)
ecmd->advertising |= (ADVERTISED_Pause |
ADVERTISED_Asym_Pause);
else if (hw->fc.requested_mode == e1000_fc_tx_pause)
ecmd->advertising |= ADVERTISED_Asym_Pause;
else
ecmd->advertising &= ~(ADVERTISED_Pause |
ADVERTISED_Asym_Pause);

ecmd->port = PORT_TP;
ecmd->phy_address = hw->phy.addr;
} else {
Expand Down

0 comments on commit 42f3c43

Please sign in to comment.