[eepro100] suspend problem with eepro100, intel 82557

Donald Becker becker@scyld.com
Tue, 3 Apr 2001 21:12:22 -0400 (EDT)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1463809279-1143379239-986346742=:1686
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Mon, 2 Apr 2001, Alain E. wrote:

> Here is the output of eepro100-diag -D -f -aa:
> Before Suspend/Resume:
> Index #1: Found a Intel i82557 (or i82558) EtherExpressPro100B adapter at 0xdcc0
> i82557 chip registers at 0xdcc0:
>   0c000050 04f050e4 00000000 00080002 18250000 00000600

> After Suspend/Resume:
> Index #1: Found a Intel i82557 (or i82558) EtherExpressPro100B adapter at 0xdcc0
> i82557 chip registers at 0xdcc0:
>   ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff

This is a suspend/resume issue.

The pci-scan module requires additional APM support to handle power
events for non-CardBus devices.  This support used to called pci-apm.c,
and is available from 
    ftp://www.scyld.com/pub/network/test/pci-apm.c
You have to compile this as its own module, and load it by hand.
Your kernel must be compiled with APM support for this to work.

It's trivial to add it to pci-scan.c, so I've put it in the attached
experimental version.  As with pci-apm, your kernel must be compiled
with APM support for this to work.

Please try the attached version and send a report.


Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
Annapolis MD 21403			410-990-9993

---1463809279-1143379239-986346742=:1686
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="pci-scan.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.10.10104032112220.1686@vaio.greennet>
Content-Description: 
Content-Disposition: attachment; filename="pci-scan.c"

LyogcGNpLXNjYW4uYzogTGludXggUENJIG5ldHdvcmsgYWRhcHRlciBzdXBw
b3J0IGNvZGUuICovDQovKg0KCU9yaWdpbmFsbHkgd3JpdHRlbiAxOTk5LTIw
MDEgYnkgRG9uYWxkIEJlY2tlci4NCg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