cxgb4vf: display pause settings
authorGanesh Goudar <ganeshgr@chelsio.com>
Tue, 17 Apr 2018 09:47:11 +0000 (15:17 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Apr 2018 17:54:00 +0000 (13:54 -0400)
Add support to display pause settings

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

index 9a81b52307a9ce1785138b96e601b43163b03341..71f13bd2b5e49b525052abc7db133fe41155df5d 100644 (file)
@@ -1419,6 +1419,22 @@ static int cxgb4vf_get_link_ksettings(struct net_device *dev,
                base->duplex = DUPLEX_UNKNOWN;
        }
 
+       if (pi->link_cfg.fc & PAUSE_RX) {
+               if (pi->link_cfg.fc & PAUSE_TX) {
+                       ethtool_link_ksettings_add_link_mode(link_ksettings,
+                                                            advertising,
+                                                            Pause);
+               } else {
+                       ethtool_link_ksettings_add_link_mode(link_ksettings,
+                                                            advertising,
+                                                            Asym_Pause);
+               }
+       } else if (pi->link_cfg.fc & PAUSE_TX) {
+               ethtool_link_ksettings_add_link_mode(link_ksettings,
+                                                    advertising,
+                                                    Asym_Pause);
+       }
+
        base->autoneg = pi->link_cfg.autoneg;
        if (pi->link_cfg.pcaps & FW_PORT_CAP32_ANEG)
                ethtool_link_ksettings_add_link_mode(link_ksettings,