summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>2003-07-26 20:54:57 +0000
committerjdp <jdp@FreeBSD.org>2003-07-26 20:54:57 +0000
commit6938f24e5b1643383d3261ccba0df03e6c0d5fbd (patch)
tree5320232f557cea5d1f330f4362968c334dde7417 /sys/dev/wi
parent8a39e4ec05f6b00ffbd6fce20d5db877202dd653 (diff)
downloadFreeBSD-src-6938f24e5b1643383d3261ccba0df03e6c0d5fbd.zip
FreeBSD-src-6938f24e5b1643383d3261ccba0df03e6c0d5fbd.tar.gz
Fix a couple of bugs in the resume handler. Don't call the if_init
function unless the device is configured up. Without this fix, the device ends up in the RUNNING state even though it is configured down. Also, check the RUNNING flag before calling the if_start function, in case the if_init function failed for one reason or another.
Diffstat (limited to 'sys/dev/wi')
-rw-r--r--sys/dev/wi/if_wi_pci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/wi/if_wi_pci.c b/sys/dev/wi/if_wi_pci.c
index 583f7de..429dfb7 100644
--- a/sys/dev/wi/if_wi_pci.c
+++ b/sys/dev/wi/if_wi_pci.c
@@ -265,9 +265,10 @@ wi_pci_resume(device_t dev)
if (sc->wi_bus_type != WI_BUS_PCI_NATIVE)
return (0);
- ifp->if_init(ifp->if_softc);
if (ifp->if_flags & IFF_UP) {
- ifp->if_start(ifp);
+ ifp->if_init(ifp->if_softc);
+ if (ifp->if_flags & IFF_RUNNING)
+ ifp->if_start(ifp);
}
return (0);
OpenPOWER on IntegriCloud