Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 2012 13:57:06 +0100
From:      Stefan Bethke <stb@lassitu.de>
To:        Marius Strobl <marius@alchemy.franken.de>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Extending sys/dev/mii
Message-ID:  <1763C3FF-1EA0-4DC0-891D-63816EBF4A04@lassitu.de>
In-Reply-To: <47ABA638-7E08-4350-A03C-3D4A23BF2D7E@lassitu.de>
References:  <8D025847-4BE4-4B2C-87D7-97E72CC9D325@lassitu.de> <20120104215930.GM90831@alchemy.franken.de> <47ABA638-7E08-4350-A03C-3D4A23BF2D7E@lassitu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 05.01.2012 um 21:52 schrieb Stefan Bethke:

> The problem with this is that the miibus instance might not be a =
(transitive) child of the ethernet driver that has the MII that needs to =
be adjusted to the new PHY settings.  And since the method does not =
provide any parameters about which phy or miibus did issue the method, =
or which ifp it applies to, bubbling it up won't work (that the scenario =
where the PHY for arge0 is connected to the switch's MDIO, which is =
attached to arge1's MDIO).
>=20
>>> Since the parent will now be the mdiobus, miibus needs effectively =
two attachments, one to the provider of the MDIO access, the other for =
the ethernet interface.  I propose to associate the ethernet interface =
by a modified mii_attach() function that takes a device_t (of the =
ethernet driver) instead of the two callback function pointers.
>>=20
>> Please elaborate on why these changes are technically necessary
>> to implement what you are trying do. Otherwise I prefer to avoid
>> them given the rototilling they'd cause.
>=20
> Necessary is a strong word.  Right now, I'm trying to understand how a =
sensible change would even look like, and which combination of glue code =
and miibus changes make the most sense.
>=20
> Let me see if I can come up with a prototype patch the next couple of =
days, so we don't have to theorize about the changes that might or might =
not be necessary.

Here's a patch that causes zero rototilling, if I'm not mistaken.

The patch implements the split between the MDIO access and notifications =
posted to the ethernet interface device that has the MII that needs to =
be adjusted in accordance with the PHY autonegotiation results.  I've =
added a field to the ivars struct and not the softc, because the softc =
is included by many network drivers, while the ivars are private to =
mii.c  For this reason, I believe this change is API and ABI compatible, =
and likely can be MFCed.  (I believe MFCing is not high on the priority =
list because many other parts in sys/mips would need to be MFCed first =
for all the Atheros platforms to become fully usable, but Adrian can =
correct me.)

A second patch will implement a separate MDIO bus driver, but I haven't =
finished that yet.  It s completely independent of the above change.


Stefan

--=20
Stefan Bethke <stb@lassitu.de>   Fon +49 151 14070811




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1763C3FF-1EA0-4DC0-891D-63816EBF4A04>