From owner-svn-src-all@FreeBSD.ORG Thu Aug 23 14:27:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C5BD1065670; Thu, 23 Aug 2012 14:27:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBAC8FC18; Thu, 23 Aug 2012 14:27:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 73FFDB91E; Thu, 23 Aug 2012 10:27:49 -0400 (EDT) From: John Baldwin To: Marius Strobl , Bjoern Zeeb Date: Thu, 23 Aug 2012 10:12:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201111182239.pAIMdkCr003347@svn.freebsd.org> In-Reply-To: <201111182239.pAIMdkCr003347@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208231012.52720.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 23 Aug 2012 10:27:49 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227687 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 14:27:50 -0000 On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > Author: marius > Date: Fri Nov 18 22:39:46 2011 > New Revision: 227687 > URL: http://svn.freebsd.org/changeset/base/227687 > > Log: > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > addresses from being probed and attaching something including ukphy(4) > to it. This is mainly necessarily for PHY switches that create duplicate > or fake PHYs on the bus that can corrupt the PHY state when accessed or > simply cause problems when ukphy(4) isolates the additional instances. > - Change miibus(4) to be a hinted bus, allowing to add child devices via > hints and to set their attach arguments (including for automatically > probed PHYs). This is mainly needed for PHY switches that violate IEEE > 802.3 and don't even implement the basic register set so we can't probe > them automatically. However, the ability to alter the attach arguments > for automatically probed PHYs is also useful as for example it allows > to test (or tell a user to test) new variant of a PHY with a specific > driver by letting an existing driver attach to it via manipulating the > IDs without the need to touch the source code or to limit a Gigabit > Ethernet PHY to only announce up to Fast Ethernet in order to save > energy by limiting the capability mask. Generally, a driver has to > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > (which already is sufficient to add phydrvX at miibusY at PHY address > Z). Then optionally the following attach arguments additionally can > be configured: > hint.phydrv.X.id1 > hint.phydrv.X.id2 > hint.phydrv.X.capmask > - Some minor cleanup. I was looking at this today with bz to try to figure out how to use this. It strikes me that in a case of a bus with devices that have IDs it can be useful to not hardcode the driver name and unit number, but to be able to create a device and let the normal driver probe mechanics work. The existing miibus_hinted_child() routine already largely enforces that by ensuring that any new child has a unique phyno address. Two approaches I can think of are: 1) Never hardcode the name and unit number. 2) Don't hardcode the name and unit number if the name is "phy". This would let you do something like: hint.phy.0.at="miibus0" hint.phy.0.phyno="1" hint.phy.0.id1="xxx" hint.phy.0.id2="yyy" And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though perhaps in the case of hinted children you want to always force the phy driver? -- John Baldwin