New test version of eepro100.c

Donald Becker
Sat Jul 31 22:05:40 1999

On Sat, 31 Jul 1999, Linus Torvalds wrote:

OK, I'll enable media type selection by default, and delete the disabled
reset code completely.

I hesitate to remove the in_interrupt mutual exclusion.  It doesn't solve
the problem, but it warns about an "impossible" condition that 1) has
occured in the past and 2) took a long time to figure out what was happening.
(I have relatively few sanity checks in the drivers.  Those that exist are
there because of specific problems.)

> > The PCI power management also has its own spec, including turning off cards you are not
> > using
> I suspect we want to start taking a more aggressive stance on this - the
> BIOSes are broken enough (even the new ones) that we can probably start
> trying to get away from them. 

The BIOS has little to do with network card power control, beyond the issue of
what to do with the Wake-On-LAN signal while soft-off.

> just a simple "hlt". The ACPI "deep sleep" mode (C3) is actually just a
> single IO port read (plus probably some setup - I'll have to do some
> testing).

Note: most (all?) cards need to have all PCI configuration registers saved
and restored on a transition from D3 -> D0.  Besides that detail, there is
little difference between D3 power-down and hot swap PCI or CardBus for
restoring a card to operation.

(Well, there is a complication with CardBus: if the machine is suspended
with the interface active, we suspend operation.  If the card is ejected
while suspended, we are pretty much confused when we must detach rather
than resume-then-detach.)

The difficult decisions come with rational default behavior.  Do we put
network interfaces into D3 state when they are shut down?  That often turns
off link beat, which could be bad.  But on a laptop (e.g. the VAIO) that's
often the correct behavior.  Some chips have D1 and D2 states, which are
marginally useful because they keep link beat active.

I've pretty much concluded that I'll need an ioctl() to set the behavior.

> That means that we can reasonably do sub-jiffy deep sleeps for the CPU.
> I'm trying to get somebody who knows hardware (hey, I work at a hardware
> company, so how hard could it be? ;) to wire up a power meter to my laptop
> so that I can test the dang thing..

I did that on an old laptop with some insulating tape separating two wires
squeezed between the battery and contacts.  But that's pretty much
impossible on most machines.

> I'd like to get rid of the BIOS crap if I can. We should be able to do
> better without it - right now no sane distribution would ever enable APM
> support by default because it's just too much hit-and-run depending on the
> BIOS, and the kernel doesn't dare do anything really aggressive anyway.

You need it to find battery state and trigger suspend.

Donald Becker
USRA-CESDIS, Center of Excellence in Space Data and Information Sciences.
Code 930.5, Goddard Space Flight Center,  Greenbelt, MD.  20771