add a powerhook to disable DMA on suspend. okay jason@
add a powerhook to disable DMA on suspend. okay jason@

adapted from NetBSD Thu Oct 28 19:21:51 1999 UTC by sommerfeld:

Fix suspend/resume-related problems observed on fxp0 on Sony Z505S:

Symptoms: system would crash with "data modified on free list" pool
panic from the mbuf cluster pool shortly after a resume.  The cluster
in question contained a valid 82557 receive descriptor and an IP
packet.  Happened sporadically in normal use.  Easiest way for me to
reproduce it was to run tcpdump and a flood ping and do a
suspend/resume cycle or two.

Changes:
 - in interrupt handler, if the interface isn't in IFF_RUNNING state,
just ack interrupts and return; don't try to receive packets, queue
new descriptors, etc., etc.,
 - add power control hook to take interface down on suspend,
and restart it (if it was up) on resume.
 - tweaks to fxp_stop and fxp_shutdown to avoid recursive panics due
to the (now fixed) bug.

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars