* [PATCH] smsc911x: Enable flow control advertisement
@ 2011-10-19 9:21 Kazunori Kobayashi
2011-10-19 12:26 ` Ben Hutchings
0 siblings, 1 reply; 3+ messages in thread
From: Kazunori Kobayashi @ 2011-10-19 9:21 UTC (permalink / raw)
To: netdev; +Cc: steve.glendinning, dhobsong, Kazunori Kobayashi
Enable the advertisement of both symmetric pause and asymmetric pause
flow control capability.
Signed-off-by: Kazunori Kobayashi <kkobayas@igel.co.jp>
---
drivers/net/smsc911x.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index b9016a3..60c3bc2 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -800,8 +800,13 @@ static void smsc911x_phy_update_flowcontrol(struct smsc911x_data *pdata)
struct phy_device *phy_dev = pdata->phy_dev;
u32 afc = smsc911x_reg_read(pdata, AFC_CFG);
u32 flow;
+ u16 miiadv = smsc911x_mii_read(phy_dev->bus, phy_dev->addr,
+ MII_ADVERTISE);
unsigned long flags;
+ miiadv |= (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
+ smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_ADVERTISE, miiadv);
+
if (phy_dev->duplex == DUPLEX_FULL) {
u16 lcladv = phy_read(phy_dev, MII_ADVERTISE);
u16 rmtadv = phy_read(phy_dev, MII_LPA);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] smsc911x: Enable flow control advertisement
2011-10-19 9:21 [PATCH] smsc911x: Enable flow control advertisement Kazunori Kobayashi
@ 2011-10-19 12:26 ` Ben Hutchings
2011-10-25 8:20 ` Kazunori Kobayashi
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2011-10-19 12:26 UTC (permalink / raw)
To: Kazunori Kobayashi; +Cc: netdev, steve.glendinning, dhobsong
On Wed, 2011-10-19 at 18:21 +0900, Kazunori Kobayashi wrote:
> Enable the advertisement of both symmetric pause and asymmetric pause
> flow control capability.
>
> Signed-off-by: Kazunori Kobayashi <kkobayas@igel.co.jp>
> ---
> drivers/net/smsc911x.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
> index b9016a3..60c3bc2 100644
> --- a/drivers/net/smsc911x.c
> +++ b/drivers/net/smsc911x.c
This file has been moved.
> @@ -800,8 +800,13 @@ static void smsc911x_phy_update_flowcontrol(struct smsc911x_data *pdata)
> struct phy_device *phy_dev = pdata->phy_dev;
> u32 afc = smsc911x_reg_read(pdata, AFC_CFG);
> u32 flow;
> + u16 miiadv = smsc911x_mii_read(phy_dev->bus, phy_dev->addr,
> + MII_ADVERTISE);
> unsigned long flags;
>
> + miiadv |= (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
> + smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_ADVERTISE, miiadv);
This should be controllable through ethtool; I assume phy_ethtool_sset()
already covers that.
Further, it's far too late to change advertising when you're just about
to resolve what was negotiated. It has to be done before (re)starting
autoneg.
Ben.
> if (phy_dev->duplex == DUPLEX_FULL) {
> u16 lcladv = phy_read(phy_dev, MII_ADVERTISE);
> u16 rmtadv = phy_read(phy_dev, MII_LPA);
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] smsc911x: Enable flow control advertisement
2011-10-19 12:26 ` Ben Hutchings
@ 2011-10-25 8:20 ` Kazunori Kobayashi
0 siblings, 0 replies; 3+ messages in thread
From: Kazunori Kobayashi @ 2011-10-25 8:20 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, steve.glendinning, dhobsong
> This should be controllable through ethtool; I assume phy_ethtool_sset()
> already covers that.
I found that the flow control could be enabled by changing the
kernel configuration.
I just set CONFIG_SMSC_PHY in "PHY Device support and infrastructure".
Please ignore this patch.
(2011/10/19 21:26), Ben Hutchings wrote:
> On Wed, 2011-10-19 at 18:21 +0900, Kazunori Kobayashi wrote:
>> Enable the advertisement of both symmetric pause and asymmetric pause
>> flow control capability.
>>
>> Signed-off-by: Kazunori Kobayashi <kkobayas@igel.co.jp>
>> ---
>> drivers/net/smsc911x.c | 5 +++++
>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
>> index b9016a3..60c3bc2 100644
>> --- a/drivers/net/smsc911x.c
>> +++ b/drivers/net/smsc911x.c
>
> This file has been moved.
>
>> @@ -800,8 +800,13 @@ static void smsc911x_phy_update_flowcontrol(struct smsc911x_data *pdata)
>> struct phy_device *phy_dev = pdata->phy_dev;
>> u32 afc = smsc911x_reg_read(pdata, AFC_CFG);
>> u32 flow;
>> + u16 miiadv = smsc911x_mii_read(phy_dev->bus, phy_dev->addr,
>> + MII_ADVERTISE);
>> unsigned long flags;
>>
>> + miiadv |= (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
>> + smsc911x_mii_write(phy_dev->bus, phy_dev->addr, MII_ADVERTISE, miiadv);
>
> This should be controllable through ethtool; I assume phy_ethtool_sset()
> already covers that.
>
> Further, it's far too late to change advertising when you're just about
> to resolve what was negotiated. It has to be done before (re)starting
> autoneg.
>
> Ben.
>
>> if (phy_dev->duplex == DUPLEX_FULL) {
>> u16 lcladv = phy_read(phy_dev, MII_ADVERTISE);
>> u16 rmtadv = phy_read(phy_dev, MII_LPA);
>
--
---------------------------------
IGEL Co.,Ltd. Kazunori Kobayashi
kkobayas@igel.co.jp
http://www.igel.co.jp/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-25 8:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 9:21 [PATCH] smsc911x: Enable flow control advertisement Kazunori Kobayashi
2011-10-19 12:26 ` Ben Hutchings
2011-10-25 8:20 ` Kazunori Kobayashi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox