]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: Show flowctrl settings through get_settings()
authorMatt Carlson <mcarlson@broadcom.com>
Mon, 13 Jun 2011 13:39:00 +0000 (13:39 +0000)
committerJoe Jin <joe.jin@oracle.com>
Tue, 15 May 2012 08:19:58 +0000 (16:19 +0800)
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>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
(cherry picked from commit 5bb09778e2196770d218e82904f15b558d9a1e50)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c

index 525e9346c58324698c34f8373e28b4ddb785bffc..12d3e678e7a8b3924abfbb7cfa099e840114e78b 100644 (file)
@@ -9902,6 +9902,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;