From owner-freebsd-net@FreeBSD.ORG Fri Jan 20 23:35:19 2012 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09EEA106564A; Fri, 20 Jan 2012 23:35:19 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id C069C8FC0A; Fri, 20 Jan 2012 23:35:18 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id C780211D5BB; Fri, 20 Jan 2012 23:35:17 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Stefan Bethke In-Reply-To: <20120120221319.ca8b631f.ray@freebsd.org> Date: Sat, 21 Jan 2012 00:35:16 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20120120221319.ca8b631f.ray@freebsd.org> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1251.1) Cc: freebsd-net@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: Ethernet Switch Framework X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 23:35:19 -0000 Thank you for the update, that clears up a number of questions I had. Here's a couple of questions and comments. Which devices can this code be run on? For example, can the AR7240 = config run on an TL-WR3420? Would you mind giving an overview of how the various parts fit together, = how they are probed and attached? I think I understand from you = explanations on IRC, but not everbody had that chance. Am 20.01.2012 um 21:13 schrieb Aleksandr Rybalko: > get/set reg: > Generic access to registers. Have 2 address modifiers: > 0x00000000(no modifiers) - access to parent space (parent MDIO bus, if > switchX attaches to miibusX) > 0x40000000 - access to switch MDIO bus > 0x80000000 - access to switch registers. Wouldn't it be better to have a proper API to select the various busses = and device register files? > FloatPHY > pseudo driver which attach to miibus like normal PHY, but do find > master switchX device and ask his PHY reg's. Main problem with that > driver - is usage of newbus calls between independent device (not a > parent <-> child), since floatphyX query set/get methods of switchX. The general approach has a number of problems, as far as I understand = the miibus code. miibus assumes that only one of the PHYs on the MII is = active concurrently (since that's a requirement of the MII/GMII/... = bus). If I read your code correctly, you have one miibus that has all = the PHYs for all switch ports on them. Won't miibus just isolate all = but one PHY? In your current implementation, you've reimplented ukphy (in a limited = fashion). One of the advantages of reusing the mii framework is being = able to use all the PHYs, in case a switch chip would include a quirky = PHY. Extending floatphy to work as a full proxy for any phy driver = looks non-trivial to me due to the API constraints the mii framework = imposes. Stefan --=20 Stefan Bethke Fon +49 151 14070811