1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

Use suspend/resume methods provided by net80211. This ensures that the

appropriate state handling takes place, not doing so results in the
device doing nothing until manual intervention.

Reviewed by:	iwasaki
Tested by:	iwasaki (iwi)
MFC after:	4 weeks
This commit is contained in:
Bernhard Schmidt 2012-03-23 19:32:30 +00:00
parent 4b25863e5c
commit ada977b103
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233387
4 changed files with 16 additions and 35 deletions

View File

@ -835,9 +835,9 @@ static int
ipw_suspend(device_t dev) ipw_suspend(device_t dev)
{ {
struct ipw_softc *sc = device_get_softc(dev); struct ipw_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = sc->sc_ifp->if_l2com;
ipw_stop(sc); ieee80211_suspend_all(ic);
return 0; return 0;
} }
@ -845,13 +845,11 @@ static int
ipw_resume(device_t dev) ipw_resume(device_t dev)
{ {
struct ipw_softc *sc = device_get_softc(dev); struct ipw_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = sc->sc_ifp->if_l2com;
pci_write_config(dev, 0x41, 0, 1); pci_write_config(dev, 0x41, 0, 1);
if (ifp->if_flags & IFF_UP) ieee80211_resume_all(ic);
ipw_init(sc);
return 0; return 0;
} }

View File

@ -863,9 +863,9 @@ static int
iwi_suspend(device_t dev) iwi_suspend(device_t dev)
{ {
struct iwi_softc *sc = device_get_softc(dev); struct iwi_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = sc->sc_ifp->if_l2com;
iwi_stop(sc); ieee80211_suspend_all(ic);
return 0; return 0;
} }
@ -873,13 +873,11 @@ static int
iwi_resume(device_t dev) iwi_resume(device_t dev)
{ {
struct iwi_softc *sc = device_get_softc(dev); struct iwi_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = sc->sc_ifp->if_l2com;
pci_write_config(dev, 0x41, 0, 1); pci_write_config(dev, 0x41, 0, 1);
if (ifp->if_flags & IFF_UP) ieee80211_resume_all(ic);
iwi_init(sc);
return 0; return 0;
} }

View File

@ -945,13 +945,9 @@ static int
iwn_suspend(device_t dev) iwn_suspend(device_t dev)
{ {
struct iwn_softc *sc = device_get_softc(dev); struct iwn_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = sc->sc_ifp->if_l2com;
struct ieee80211com *ic = ifp->if_l2com;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
iwn_stop(sc); ieee80211_suspend_all(ic);
if (vap != NULL)
ieee80211_stop(vap);
return 0; return 0;
} }
@ -959,20 +955,12 @@ static int
iwn_resume(device_t dev) iwn_resume(device_t dev)
{ {
struct iwn_softc *sc = device_get_softc(dev); struct iwn_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = sc->sc_ifp->if_l2com;
struct ieee80211com *ic = ifp->if_l2com;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
/* Clear device-specific "PCI retry timeout" register (41h). */ /* Clear device-specific "PCI retry timeout" register (41h). */
pci_write_config(dev, 0x41, 0, 1); pci_write_config(dev, 0x41, 0, 1);
if (ifp->if_flags & IFF_UP) { ieee80211_resume_all(ic);
iwn_init(sc);
if (vap != NULL)
ieee80211_init(vap);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
iwn_start(ifp);
}
return 0; return 0;
} }

View File

@ -1218,8 +1218,9 @@ static int
wpi_suspend(device_t dev) wpi_suspend(device_t dev)
{ {
struct wpi_softc *sc = device_get_softc(dev); struct wpi_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = sc->sc_ifp->if_l2com;
wpi_stop(sc); ieee80211_suspend_all(ic);
return 0; return 0;
} }
@ -1227,15 +1228,11 @@ static int
wpi_resume(device_t dev) wpi_resume(device_t dev)
{ {
struct wpi_softc *sc = device_get_softc(dev); struct wpi_softc *sc = device_get_softc(dev);
struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = sc->sc_ifp->if_l2com;
pci_write_config(dev, 0x41, 0, 1); pci_write_config(dev, 0x41, 0, 1);
if (ifp->if_flags & IFF_UP) { ieee80211_resume_all(ic);
wpi_init(ifp->if_softc);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
wpi_start(ifp);
}
return 0; return 0;
} }