Browse Source

net: qcom/emac: enable flow control if requested

If the PHY has been configured to allow pause frames, then the MAC
should be configured to generate and/or accept those frames.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Timur Tabi 8 years ago
parent
commit
df63022e18
1 changed files with 5 additions and 4 deletions
  1. 5 4
      drivers/net/ethernet/qualcomm/emac/emac-mac.c

+ 5 - 4
drivers/net/ethernet/qualcomm/emac/emac-mac.c

@@ -575,10 +575,11 @@ void emac_mac_start(struct emac_adapter *adpt)
 
 
 	mac |= TXEN | RXEN;     /* enable RX/TX */
 	mac |= TXEN | RXEN;     /* enable RX/TX */
 
 
-	/* We don't have ethtool support yet, so force flow-control mode
-	 * to 'full' always.
-	 */
-	mac |= TXFC | RXFC;
+	/* Configure MAC flow control to match the PHY's settings. */
+	if (phydev->pause)
+		mac |= RXFC;
+	if (phydev->pause != phydev->asym_pause)
+		mac |= TXFC;
 
 
 	/* setup link speed */
 	/* setup link speed */
 	mac &= ~SPEED_MASK;
 	mac &= ~SPEED_MASK;