Re: Detecting state of iBook gmac ethernet
Benjamin Herrenschmidt wrote:
Michel Lanners wrote:
> mods by BenH to make the GMAC driver compatible with ethtool
> and/or miitool.
Not gmac, but sungem, which will replace gmac soon.
However, there is a problem with using such tools. For power
management reasons, I shut down the chip when the interface is
closed (gmac) or a couple of seconds after it is closed (sungem).
So you can't use ethtool to get the link state.
If "closing the interface" means doing something equivalent to
"ifconfig eth0 down", then it should not be a problem at all. I have
given this a little thought, and the argument runs as follows:
If there is mains power, then it is no trouble to keep the ethernet
link powered up (in the sense of ifconfig eth0 up). If there is
no mains power, then you would want to power it down anyway, so
autodetection is not going to be possible without first turning
everything back on anyway, and this is only a minor inconvenience
requiring a small script which runs every so often, at the cost
of using only a little precious energy, if this behaviour is
desired. Moreover, usually, the important detection times would
be in some reasonable period of time after the power source or
sleep state changes anyway.
Of course, if my assumption is wrong, I will need to do a little
rethinking, and in extreme cases, some hacking.
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp