Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755581AbbBGOgC (ORCPT ); Sat, 7 Feb 2015 09:36:02 -0500 Received: from hygieia.santi-shop.eu ([78.46.175.2]:34595 "EHLO hygieia.santi-shop.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754631AbbBGOgA (ORCPT ); Sat, 7 Feb 2015 09:36:00 -0500 Date: Sat, 7 Feb 2015 15:35:45 +0100 From: Bruno =?UTF-8?B?UHLDqW1vbnQ=?= To: Pavel Machek Cc: linux-kernel@vger.kernel.org, Florian Fainelli , netdev@vger.kernel.org Subject: Re: Ethernet: how to disable gigabit support Message-ID: <20150207153545.6530fce6@neptune.home> In-Reply-To: <20150206135706.GB25683@amd> References: <20150205202527.GA7917@amd> <54D3F267.3000908@gmail.com> <20150206135706.GB25683@amd> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1793 Lines: 49 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/