All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] smsc95xx: Configure pause time to 0xffff when tx flow control enabled
@ 2017-09-07  6:51 Nisar.Sayed
  2017-09-07 13:56 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Nisar.Sayed @ 2017-09-07  6:51 UTC (permalink / raw)
  To: davem; +Cc: UNGLinuxDriver, netdev, steve.glendinning

From: Nisar Sayed <Nisar.Sayed@microchip.com>

Configure pause time to 0xffff when tx flow control enabled

Signed-off-by: Nisar Sayed <Nisar.Sayed@microchip.com>
---
 drivers/net/usb/smsc95xx.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 340c134..309b88a 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -526,7 +526,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
 static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
 					   u16 lcladv, u16 rmtadv)
 {
-	u32 flow, afc_cfg = 0;
+	u32 flow = 0, afc_cfg;
 
 	int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg);
 	if (ret < 0)
@@ -537,20 +537,19 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
 
 		if (cap & FLOW_CTRL_RX)
 			flow = 0xFFFF0002;
-		else
-			flow = 0;
 
-		if (cap & FLOW_CTRL_TX)
+		if (cap & FLOW_CTRL_TX) {
 			afc_cfg |= 0xF;
-		else
+			flow |= 0xFFFF0000;
+		} else {
 			afc_cfg &= ~0xF;
+		}
 
 		netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n",
 				   cap & FLOW_CTRL_RX ? "enabled" : "disabled",
 				   cap & FLOW_CTRL_TX ? "enabled" : "disabled");
 	} else {
 		netif_dbg(dev, link, dev->net, "half duplex\n");
-		flow = 0;
 		afc_cfg |= 0xF;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] smsc95xx: Configure pause time to 0xffff when tx flow control enabled
  2017-09-07  6:51 [PATCH net] smsc95xx: Configure pause time to 0xffff when tx flow control enabled Nisar.Sayed
@ 2017-09-07 13:56 ` Andrew Lunn
  2017-09-08  9:11   ` Nisar.Sayed
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2017-09-07 13:56 UTC (permalink / raw)
  To: Nisar.Sayed; +Cc: davem, UNGLinuxDriver, netdev, steve.glendinning

On Thu, Sep 07, 2017 at 06:51:37AM +0000, Nisar.Sayed@microchip.com wrote:
> From: Nisar Sayed <Nisar.Sayed@microchip.com>
> 
> Configure pause time to 0xffff when tx flow control enabled

Hi Nisar

You should explain the 'Why' in the commit message. Why do we want a
pause time of 0xffff?

      Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net] smsc95xx: Configure pause time to 0xffff when tx flow control enabled
  2017-09-07 13:56 ` Andrew Lunn
@ 2017-09-08  9:11   ` Nisar.Sayed
  0 siblings, 0 replies; 3+ messages in thread
From: Nisar.Sayed @ 2017-09-08  9:11 UTC (permalink / raw)
  To: andrew; +Cc: davem, UNGLinuxDriver, netdev, steve.glendinning

> On Thu, Sep 07, 2017 at 06:51:37AM +0000, Nisar.Sayed@microchip.com
> wrote:
> > From: Nisar Sayed <Nisar.Sayed@microchip.com>
> >
> > Configure pause time to 0xffff when tx flow control enabled
> 
> Hi Nisar
> 
> You should explain the 'Why' in the commit message. Why do we want a
> pause time of 0xffff?
> 
>       Andrew

Thanks Andrew,

I shall update the description and submit next version.

- Nisar

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-08  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07  6:51 [PATCH net] smsc95xx: Configure pause time to 0xffff when tx flow control enabled Nisar.Sayed
2017-09-07 13:56 ` Andrew Lunn
2017-09-08  9:11   ` Nisar.Sayed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.