Subject: more MII problems
To: None <tech-net@netbsd.org>
From: Matthias Drochner <drochner@zel459.zel.kfa-juelich.de>
List: tech-net
Date: 04/16/1999 22:31:09
Trying to integrate MII support into the lance driver I found
it very annoying that the "struct ifmedia" is allocated
within the "struct mii_data".
Chips which have MII support dependant on the revision or on
wiring have to deal with "mii" specific data structures all the
time even if the actual interface is not MII based.
The mi lance driver eg does already have an "ifmedia" struct,
and adding mii support in the "le_pci" overlay would
duplicate this. (And adding mii to the generic part would be
a waste of memory for most m68k and other old-lance using ports.)
The "tulip" could benefit too: The '143 has an internal non-mii
PHY which can do autonegotiation as well - it would be good
if the code dealing with it wouldn't have to deal with
"mii" stuff -- after all, why should "mii" be special so
that it "owns" the "ifmedia" data?

To get this clean, the "ifmedia" struct should be located
within the device's "softc", and "mii" (or other subsystems
dealing with the physical layer) should only get a pointer to it.

Comments?

best regards
Matthias