From: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
<bryan.whitehead@microchip.com>, <hkallweit1@gmail.com>,
<pabeni@redhat.com>, <edumazet@google.com>,
<linux@armlinux.org.uk>, <UNGLinuxDriver@microchip.com>,
<Ian.Saturley@microchip.com>
Subject: Re: [PATCH net-next 1/2] net: lan743x: Add support for get_pauseparam and set_pauseparam
Date: Mon, 24 Oct 2022 12:46:56 +0530 [thread overview]
Message-ID: <20221024071656.GA653394@raju-project-pc> (raw)
In-Reply-To: <Y1Kiocu3WUubYyVe@lunn.ch>
Hi Andrew,
Thank you for review comments.
The 10/21/2022 15:46, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> > +static int lan743x_set_pauseparam(struct net_device *dev,
> > + struct ethtool_pauseparam *pause)
> > +{
> > + struct lan743x_adapter *adapter = netdev_priv(dev);
> > + struct phy_device *phydev = dev->phydev;
> > + struct lan743x_phy *phy = &adapter->phy;
> > +
> > + if (!phydev)
> > + return -ENODEV;
> > +
> > + if (!phy_validate_pause(phydev, pause))
> > + return -EINVAL;
> > +
> > + phy->fc_request_control = 0;
> > + if (pause->rx_pause)
> > + phy->fc_request_control |= FLOW_CTRL_RX;
> > +
> > + if (pause->tx_pause)
> > + phy->fc_request_control |= FLOW_CTRL_TX;
> > +
> > + phy->fc_autoneg = pause->autoneg;
> > +
> > + phy_set_asym_pause(phydev, pause->rx_pause, pause->tx_pause);
> > +
> > + if (pause->autoneg == AUTONEG_DISABLE)
> > + lan743x_mac_flow_ctrl_set_enables(adapter, pause->tx_pause,
> > + pause->rx_pause);
>
> pause is not too well defined. But i think phy_set_asym_pause() should
> be in an else clause. If pause autoneg is off, you directly set it in
> the MAC and ignore what is negotiated. If it is enabled, you
> negotiate. As far as i understand, you don't modify your negotiation
> when pause autoneg is off.
O.K. I will change.
>
> Andrew
--------
Thanks,
Raju
next prev parent reply other threads:[~2022-10-24 7:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 5:56 [PATCH net-next 0/2] net: lan743x: PCI11010 / PCI11414 devices Enhancements Raju Lakkaraju
2022-10-21 5:56 ` [PATCH net-next 1/2] net: lan743x: Add support for get_pauseparam and set_pauseparam Raju Lakkaraju
2022-10-21 13:46 ` Andrew Lunn
2022-10-24 7:16 ` Raju Lakkaraju [this message]
2022-10-21 5:56 ` [PATCH net-next 2/2] net: phy: micrel: Add PHY Auto/MDI/MDI-X set driver for KSZ9131 Raju Lakkaraju
2022-10-21 7:27 ` Horatiu Vultur
2022-10-21 10:26 ` Raju Lakkaraju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221024071656.GA653394@raju-project-pc \
--to=raju.lakkaraju@microchip.com \
--cc=Ian.Saturley@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox