summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi/if_wi_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/wi/if_wi_pci.c')
-rw-r--r--sys/dev/wi/if_wi_pci.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/wi/if_wi_pci.c b/sys/dev/wi/if_wi_pci.c
index 198c599..b218c24 100644
--- a/sys/dev/wi/if_wi_pci.c
+++ b/sys/dev/wi/if_wi_pci.c
@@ -238,7 +238,9 @@ wi_pci_suspend(device_t dev)
{
struct wi_softc *sc = device_get_softc(dev);
+ WI_LOCK(sc);
wi_stop(sc, 1);
+ WI_UNLOCK(sc);
return (0);
}
@@ -247,16 +249,15 @@ static int
wi_pci_resume(device_t dev)
{
struct wi_softc *sc = device_get_softc(dev);
- struct ifnet *ifp = sc->sc_ifp;
+ struct ieee80211com *ic = &sc->sc_ic;
- if (sc->wi_bus_type != WI_BUS_PCI_NATIVE)
+ WI_LOCK(sc);
+ if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) {
return (0);
-
- if (ifp->if_flags & IFF_UP) {
- ifp->if_init(ifp->if_softc);
- if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- ifp->if_start(ifp);
+ WI_UNLOCK(sc);
}
-
+ if (ic->ic_nrunning > 0)
+ wi_init(sc);
+ WI_UNLOCK(sc);
return (0);
}
OpenPOWER on IntegriCloud