From owner-freebsd-arch@FreeBSD.ORG Wed Jan 11 19:37:40 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD569106564A for ; Wed, 11 Jan 2012 19:37:40 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 416F58FC0C for ; Wed, 11 Jan 2012 19:37:39 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q0BJbcvb049329; Wed, 11 Jan 2012 20:37:38 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q0BJbcmW049328; Wed, 11 Jan 2012 20:37:38 +0100 (CET) (envelope-from marius) Date: Wed, 11 Jan 2012 20:37:38 +0100 From: Marius Strobl To: Stefan Bethke Message-ID: <20120111193738.GB44286@alchemy.franken.de> References: <8D025847-4BE4-4B2C-87D7-97E72CC9D325@lassitu.de> <20120104215930.GM90831@alchemy.franken.de> <47ABA638-7E08-4350-A03C-3D4A23BF2D7E@lassitu.de> <1763C3FF-1EA0-4DC0-891D-63816EBF4A04@lassitu.de> <20120106182756.GA88161@alchemy.franken.de> <95372FB3-406F-46C2-8684-4FDB672D9FCF@lassitu.de> <20120106214741.GB88161@alchemy.franken.de> <20120108130039.GG88161@alchemy.franken.de> <23477898-8D85-498C-8E30-192810BD68A8@lassitu.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23477898-8D85-498C-8E30-192810BD68A8@lassitu.de> User-Agent: Mutt/1.4.2.3i Cc: freebsd-arch@freebsd.org Subject: Re: Extending sys/dev/mii X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 19:37:40 -0000 On Sun, Jan 08, 2012 at 11:27:25PM +0100, Stefan Bethke wrote: > Am 08.01.2012 um 14:00 schrieb Marius Strobl: > > > Okay, this is the kind of information I was looking for as coupling > > devices with newbus that have no close relation in the hierarchy is > > tedious. However, when not using newbus the question arises how do > > you intend to associate the device_t of say arge0 with the mdiobus0 > > hanging off somewhere beneath iicbus0? > > In my experimental tree, I've hacked together a small function that parses a string for a devclass name and unit number, and looks that up. > > I'm also trying a number of other approaches; mainly I'm trying to understand how newbus works, and what kind of driver I want at the various points, ideally auto-attached, or configured by hints, instead of by custom code. I think I'll need another couple of days to get a good enough understanding of drivers, devclasses and their tree, and the device tree. > Okay, I suggest to postpone this discussion until then. For the scenario when mdiobus is the parent of miibus I see no technical need to change miibus to support what you want to do, just implement the miibus_if in mdiobus and redirect it to the device_t of the MAC there. Moreover, that way the hack to sidestep newbus is contained in the layer that actually needs it and not scattered over multiple frameworks. Marius