net/axgbe: add configure flow control while link adjustment
authorRavi Kumar <ravi1.kumar@amd.com>
Fri, 6 Apr 2018 12:36:46 +0000 (08:36 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Apr 2018 22:41:44 +0000 (00:41 +0200)
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
drivers/net/axgbe/axgbe_mdio.c

index 914f34f..2296de7 100644 (file)
@@ -674,6 +674,19 @@ static void axgbe_an_init(struct axgbe_port *pdata)
 static void axgbe_phy_adjust_link(struct axgbe_port *pdata)
 {
        if (pdata->phy.link) {
+               /* Flow control support */
+               pdata->pause_autoneg = pdata->phy.pause_autoneg;
+
+               if (pdata->tx_pause != (unsigned int)pdata->phy.tx_pause) {
+                       pdata->hw_if.config_tx_flow_control(pdata);
+                       pdata->tx_pause = pdata->phy.tx_pause;
+               }
+
+               if (pdata->rx_pause != (unsigned int)pdata->phy.rx_pause) {
+                       pdata->hw_if.config_rx_flow_control(pdata);
+                       pdata->rx_pause = pdata->phy.rx_pause;
+               }
+
                /* Speed support */
                if (pdata->phy_speed != pdata->phy.speed)
                        pdata->phy_speed = pdata->phy.speed;