netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: linux-kernel@vger.kernel.org,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: Ethernet: how to disable gigabit support
Date: Sat, 7 Feb 2015 15:35:45 +0100	[thread overview]
Message-ID: <20150207153545.6530fce6@neptune.home> (raw)
In-Reply-To: <20150206135706.GB25683@amd>

On Fri, 06 February 2015 Pavel Machek wrote:
> On Thu 2015-02-05 14:44:55, Florian Fainelli wrote:
> > On 05/02/15 12:25, Pavel Machek wrote:
> > > This happened on more than one project: there's gigabit-capable chip,
> > > but the connector is not designed for gigabit speed.
> > > 
> > > I'd like to have speed autonegotiation, but not offer gigabit (as it
> > > will not work).
> > > 
> > > Is there way to do that without hacking the kernel? Should mii-tool do
> > > that?
> > 
> > Since you use the PHY library, you should be able to do something like
> > this in your PHY driver prior to starting the PHY state machine:
> > 
> > phydev->supported &= PHY_BASIC_FEATURES (effectively masking Gigabit
> > capability)
> 
> Thanks, that did the trick.
> 								Pavel
> (But still it would be nice to have a generic way of doing this,
> using something like mii-tool.)

You can use ethtool to do so:

  ethtool -s ethX advertise 0x0f

c.f. man ethtool:
  advertise N
    Sets the speed and duplex advertised by autonegotiation. The argument is
    a hexadecimal value using one or a combination of the following values:

      0x001     10 Half
      0x002     10 Full
      0x004     100 Half
      0x008     100 Full
      0x010     1000 Half        (not supported by IEEE standards)
      0x020     1000 Full
      0x8000    2500 Full        (not supported by IEEE standards)
      0x1000    10000 Full
      0x20000   20000MLD2 Full   (not supported by IEEE standards)
      0x40000   20000KR2 Full    (not supported by IEEE standards)

Bruno

  reply	other threads:[~2015-02-07 14:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 20:25 Ethernet: how to disable gigabit support Pavel Machek
2015-02-05 22:44 ` Florian Fainelli
2015-02-06 13:57   ` Pavel Machek
2015-02-07 14:35     ` Bruno Prémont [this message]
2015-02-12 14:12     ` Florian Fainelli
2015-02-06 11:01 ` Maciej W. Rozycki

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=20150207153545.6530fce6@neptune.home \
    --to=bonbons@linux-vserver.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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).