On Aug 25, 2005, at 15:04, David Hollis wrote:
Question for you, I'm trying to setup my mdio_bus driver and I don't
know how I can get it registered at the appropriate time. I can't
read
the PHY IDs until after I've diddled some bits on the device which
happens in my USB probe function. If I register the mdio_bus on
module
load, the loop that tries to read the valid PHYs is not going to work.
Do you think it might be possible to have an alternate
mdio_bus_register() that doesn't try to detect the phys that are
present? Maybe there would be either a function I could call later to
do the auto-detect or to manually add a phy address to the bus?
This is definitely one of the more difficult issues of MDIO bus
initialization, since they tend to be so closely coupled with the
ethernet controller. Some possible recommendations:
1) Twiddle those bits in the mdio bus initialization function. This
makes sense if those bits can be considered a logical part of the
mdio bus.
2) Call your mdio bus initialization function from your USB probe
function.
3) The loop that searches for all the PHYs only registers devices
when it finds them. If there is no device found, the entry at that
address will be left blank. It would be fairly simple to, at a later
time, call get_phy_device() for that address, and then insert it into
the mdio bus structure at the appropriate address, and register it.
At that time, it would bind to any available drivers. I'd hope this
would be a last resort, since it's fairly ugly, and if it's a common
solution, then the PHY Layer's mdio bus code probably needs to be
rewritten.
4) Call mdio_bus_register at some other time, perhaps from your USB
probe code. This solution breaks abstraction layers, though perhaps
more preferable than #3, since it's much simpler.
5) write your own version of mdio_bus_register that is specific to
your driver, and make sure it does everything mdio_bus_register does
already, plus whatever else you need done. I hope this isn't
necessary, since it's a lot like #3, in that it means that the
current mdio bus code probably needs serious work.
HTH,
Andy Fleming
--
David Hollis <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html