From: Ben Hutchings <bhutchings@solarflare.com>
To: Oliver Neukum <oneukum@suse.de>
Cc: Francois Romieu <romieu@fr.zoreil.com>,
davem@davemloft.net, netdev@vger.kernel.org, machen@novell.com
Subject: Re: [PATCH] r8169: support control of advertising
Date: Tue, 04 Jan 2011 17:20:21 +0000 [thread overview]
Message-ID: <1294161621.3636.17.camel@bwh-desktop> (raw)
In-Reply-To: <201101041715.09622.oneukum@suse.de>
On Tue, 2011-01-04 at 17:15 +0100, Oliver Neukum wrote:
> From 91e84e6b6ca416e8200f04b60383c398f9b93bd2 Mon Sep 17 00:00:00 2001
> From: Oliver Neukum <oliver@neukum.org>
> Date: Tue, 4 Jan 2011 17:11:29 +0100
> Subject: [PATCH] r8169: support control of advertising
>
> This allows "ethtool advertise" to control the speed and duplex
> features the device offers the switch.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.de>
> ---
> drivers/net/r8169.c | 41 +++++++++++++++++++++++++++++++----------
> 1 files changed, 31 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index e165d96..f2c8583 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c
[...]
> @@ -912,8 +912,20 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
> int auto_nego;
>
> auto_nego = mdio_read(ioaddr, MII_ADVERTISE);
> - auto_nego |= (ADVERTISE_10HALF | ADVERTISE_10FULL |
> - ADVERTISE_100HALF | ADVERTISE_100FULL);
> + auto_nego &= ~(ADVERTISED_10baseT_Half |
Should be ADVERTISE_10HALF.
> + ADVERTISE_10FULL |
> + ADVERTISE_100HALF |
> + ADVERTISE_100FULL);
> +
> + if (adv & ADVERTISED_10baseT_Half)
> + auto_nego |= ADVERTISE_10HALF;
> + if (adv & ADVERTISED_10baseT_Full)
> + auto_nego |= ADVERTISE_10FULL;
> + if (adv & ADVERTISED_100baseT_Half)
> + auto_nego |= ADVERTISE_100HALF;
> + if (adv & ADVERTISED_100baseT_Full)
> + auto_nego |= ADVERTISE_100FULL;
> +
> auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
[...]
Pause advertising should also be controllable through ethtool, if flow
control can be altered in the MAC. (It's not clear whether it can.)
This should also check for unsupported advertising flags (e.g.
ADVERTISED_1000baseT_Full when the MAC doesn't support 1000M) and return
-EINVAL if they're set.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2011-01-04 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 16:15 [PATCH] r8169: support control of advertising Oliver Neukum
2011-01-04 17:20 ` Ben Hutchings [this message]
2011-01-04 22:38 ` Francois Romieu
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=1294161621.3636.17.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=machen@novell.com \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=romieu@fr.zoreil.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