Commit 9c082731 authored by Nisar Sayed's avatar Nisar Sayed Committed by David S. Miller

smsc95xx: Configure pause time to 0xffff when tx flow control enabled

Configure pause time to 0xffff when tx flow control enabled

Set pause time to 0xffff in the pause frame to indicate the
partner to stop sending the packets. When RX buffer frees up,
the device sends pause frame with pause time zero for partner to
resume transmission.

Fixes: 2f7ca802 ("Add SMSC LAN9500 USB2.0 10/100 ethernet adapter driver")
Signed-off-by: default avatarNisar Sayed <Nisar.Sayed@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 230cfd2d
...@@ -526,7 +526,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev) ...@@ -526,7 +526,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
u16 lcladv, u16 rmtadv) u16 lcladv, u16 rmtadv)
{ {
u32 flow, afc_cfg = 0; u32 flow = 0, afc_cfg;
int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg);
if (ret < 0) if (ret < 0)
...@@ -537,20 +537,19 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, ...@@ -537,20 +537,19 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
if (cap & FLOW_CTRL_RX) if (cap & FLOW_CTRL_RX)
flow = 0xFFFF0002; flow = 0xFFFF0002;
else
flow = 0;
if (cap & FLOW_CTRL_TX) if (cap & FLOW_CTRL_TX) {
afc_cfg |= 0xF; afc_cfg |= 0xF;
else flow |= 0xFFFF0000;
} else {
afc_cfg &= ~0xF; afc_cfg &= ~0xF;
}
netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n", netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n",
cap & FLOW_CTRL_RX ? "enabled" : "disabled", cap & FLOW_CTRL_RX ? "enabled" : "disabled",
cap & FLOW_CTRL_TX ? "enabled" : "disabled"); cap & FLOW_CTRL_TX ? "enabled" : "disabled");
} else { } else {
netif_dbg(dev, link, dev->net, "half duplex\n"); netif_dbg(dev, link, dev->net, "half duplex\n");
flow = 0;
afc_cfg |= 0xF; afc_cfg |= 0xF;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment