lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 04 Jan 2011 17:20:21 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Oliver Neukum <oneukum@...e.de>
Cc:	Francois Romieu <romieu@...zoreil.com>, davem@...emloft.net,
	netdev@...r.kernel.org, machen@...ell.com
Subject: Re: [PATCH] r8169: support control of advertising

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@...kum.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@...e.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.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ