netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Dawe <rich@phekda.gotadsl.co.uk>
To: Ben Greear <greearb@candelatech.com>
Cc: Francois Romieu <romieu@fr.zoreil.com>,
	Linux netdev <netdev@oss.sgi.com>
Subject: Re: [PATCH] r8169: support restricting speed+duplex in autonegotiation
Date: Sat, 28 May 2005 14:28:25 +0100	[thread overview]
Message-ID: <429871F9.6040305@phekda.gotadsl.co.uk> (raw)
In-Reply-To: <4297B479.1080404@candelatech.com>

Hello.

Ben Greear wrote:
> Richard Dawe wrote:
> 
>> Hello.
>>
>> Attached is a patch for drivers/net/r8169.c against Linux 2.6.11 that 
>> allows adjustment of the speed and duplex advertised via 
>> autonegotiation. Example usage:
>>
>>   ethtool -s eth0 autoneg on speed 10 duplex half
[snip]
>> r8169: Allow adjustment of speed and duplex advertised via 
>> autonegotiation
>>
>> Signed-off-by: Richard Dawe <rich@phekda.gotadsl.co.uk>
>>
>>
>> ------------------------------------------------------------------------
>>
>> --- r8169.c.orig    2005-05-27 21:12:21.000000000 +0100
>> +++ r8169.c    2005-05-27 22:14:59.000000000 +0100
[snip]
>> @@ -579,6 +583,23 @@ static void rtl8169_link_option(int idx,
>>      *autoneg = p->autoneg;
>>      *speed = p->speed;
>>      *duplex = p->duplex;
>> +
>> +    if (p->media == _10_Half)
>> +        *advertising = ADVERTISED_10baseT_Half;
>> +    if (p->media == _10_Full)
>> +        *advertising = ADVERTISED_10baseT_Full;
>> +    if (p->media == _100_Half)
>> +        *advertising = ADVERTISED_100baseT_Half;
>> +    if (p->media == _100_Full)
>> +        *advertising = ADVERTISED_100baseT_Full;
>> +    if (p->media == _1000_Full)
>> +        *advertising = ADVERTISED_1000baseT_Full;
>> +    if (p->media == 0xff)
>> +        *advertising = ADVERTISED_10baseT_Half |
>> +                   ADVERTISED_10baseT_Full |
>> +                   ADVERTISED_100baseT_Half |
>> +                   ADVERTISED_100baseT_Full |
>> +                   ADVERTISED_1000baseT_Full;
>>  }
> 
> 
> So, is there no way to advert just 100Mbps-half and -full ?
> 
> Seems like you should be able to set each flag by itself and
> create a bit-mask of the particular flags that you want...

This particular code is to support the "media" option for the r8169 
module. The "media" option is marked as deprecated in favour of ethtool.

It looks like you could control what is advertised by using the ethool 
ioctls, since you can pass a bitmask to that. I can't see a way to do 
that with the ethtool command, since you can only specify one pair of 
"speed" and "duplex" arguments.

One thing I forgot to mention in my mail is that there is no way of 
disabling autonegotiation with the r8169 driver. I started working on 
this, but I don't know how to force the PHY to a particular speed+duplex 
combination with autonegotation switched off. I'm guessing that 
autonegotiation enabled with one advertised speed+duplex != fixed 
speed+duplex.

Bye, Rich =]

-- 
Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ]

"You can't evaluate a man by logic alone."
   -- McCoy, "I, Mudd", Star Trek

  reply	other threads:[~2005-05-28 13:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-27 22:36 [PATCH] r8169: support restricting speed+duplex in autonegotiation Richard Dawe
2005-05-27 23:59 ` Ben Greear
2005-05-28 13:28   ` Richard Dawe [this message]
2005-05-28 14:42     ` Francois Romieu
2005-05-28 20:39       ` Richard Dawe
2005-05-29 22:54         ` 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=429871F9.6040305@phekda.gotadsl.co.uk \
    --to=rich@phekda.gotadsl.co.uk \
    --cc=greearb@candelatech.com \
    --cc=netdev@oss.sgi.com \
    --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;
as well as URLs for NNTP newsgroup(s).