Skip to contentSkip to conversation

tg3: Show flowctrl settings through get_settings()

PATCH In review Matt Carlson 1 participant 1 message Jun 13, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/8 tg3: Show flowctrl settings through get_settings()

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

---
 drivers/net/tg3.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/net/tg3.c +12 -0
index 7ce50e5..a7bea86 100644
@@ -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;
Signature · 1 line
1.7.3.4