netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 6/8] tg3: Show flowctrl settings through get_settings()
@ 2011-06-13 23:39 Matt Carlson
  0 siblings, 0 replies; only message in thread
From: Matt Carlson @ 2011-06-13 23:39 UTC (permalink / raw)
  To: davem; +Cc: netdev, mcarlson

This patch adds code to present the flow control advertisements through
the ethtool get_settings callback.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
 drivers/net/tg3.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 7ce50e5..a7bea86 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9934,6 +9934,18 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 	}
 
 	cmd->advertising = tp->link_config.advertising;
+	if (tg3_flag(tp, PAUSE_AUTONEG)) {
+		if (tp->link_config.flowctrl & FLOW_CTRL_RX) {
+			if (tp->link_config.flowctrl & FLOW_CTRL_TX) {
+				cmd->advertising |= ADVERTISED_Pause;
+			} else {
+				cmd->advertising |= ADVERTISED_Pause |
+						    ADVERTISED_Asym_Pause;
+			}
+		} else if (tp->link_config.flowctrl & FLOW_CTRL_TX) {
+			cmd->advertising |= ADVERTISED_Asym_Pause;
+		}
+	}
 	if (netif_running(dev)) {
 		ethtool_cmd_speed_set(cmd, tp->link_config.active_speed);
 		cmd->duplex = tp->link_config.active_duplex;
-- 
1.7.3.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-13 23:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 23:39 [PATCH net-next 6/8] tg3: Show flowctrl settings through get_settings() Matt Carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).