bnxt_en: Fix ethtool -a reporting.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 28 Mar 2016 23:46:07 +0000 (19:46 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Mar 2016 23:01:33 +0000 (19:01 -0400)
To report flow control tx/rx settings accurately regardless of autoneg
setting, we should use link_info->req_flow_ctrl.  Before this patch,
the reported settings were only correct when autoneg was on.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 9ada1662b65149c81617181772f406a4716042c1..2e472f6dbf2d3df1ef3d1e084666ef713a187e65 100644 (file)
@@ -855,10 +855,8 @@ static void bnxt_get_pauseparam(struct net_device *dev,
        if (BNXT_VF(bp))
                return;
        epause->autoneg = !!(link_info->autoneg & BNXT_AUTONEG_FLOW_CTRL);
-       epause->rx_pause =
-               ((link_info->auto_pause_setting & BNXT_LINK_PAUSE_RX) != 0);
-       epause->tx_pause =
-               ((link_info->auto_pause_setting & BNXT_LINK_PAUSE_TX) != 0);
+       epause->rx_pause = !!(link_info->req_flow_ctrl & BNXT_LINK_PAUSE_RX);
+       epause->tx_pause = !!(link_info->req_flow_ctrl & BNXT_LINK_PAUSE_TX);
 }
 
 static int bnxt_set_pauseparam(struct net_device *dev,