diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2022-12-04 09:25:04 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2022-12-04 09:25:04 +0000 |
| commit | 20eabd579c3dffc2ec36598ab6076d40ea7eebc0 (patch) | |
| tree | e2296a50a368b65672c123c859ed1e4030a6aae0 /sys/dev/ic | |
| parent | b9366bee9289bb4063c296700341acad94a1e30f (diff) | |
Make power save mode configurable by ifconfig, now defaults to non-powersave
like other interfaces.
Remove cargo-culted check for manual roaming.
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/bwfm.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index f84fdd62167..e496e54f2ce 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $NetBSD: bwfm.c,v 1.33 2022/12/03 16:06:20 mlelstv Exp $ */ +/* $NetBSD: bwfm.c,v 1.34 2022/12/04 09:25:04 mlelstv Exp $ */ /* $OpenBSD: bwfm.c,v 1.5 2017/10/16 22:27:16 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation @@ -379,6 +379,7 @@ bwfm_attach(struct bwfm_softc *sc) IEEE80211_C_TKIP | IEEE80211_C_AES | IEEE80211_C_AES_CCM | + IEEE80211_C_PMGT | #if notyet IEEE80211_C_MONITOR | /* monitor mode supported */ IEEE80211_C_IBSS | @@ -635,11 +636,16 @@ bwfm_init(struct ifnet *ifp) * Use CAM (constantly awake) when we are running as AP * otherwise use fast power saving. */ - sc->sc_pm = BWFM_PM_FAST_PS; + + if (ic->ic_flags & IEEE80211_F_PMGTON) { + sc->sc_pm = BWFM_PM_FAST_PS; #ifndef IEEE80211_STA_ONLY - if (ic->ic_opmode == IEEE80211_M_HOSTAP) - sc->sc_pm = BWFM_PM_CAM; + if (ic->ic_opmode == IEEE80211_M_HOSTAP) + sc->sc_pm = BWFM_PM_CAM; #endif + } else { + sc->sc_pm = BWFM_PM_CAM; + } sc->sc_setpm = true; bwfm_fwvar_var_set_int(sc, "txbf", 1); @@ -694,8 +700,8 @@ bwfm_stop(struct ifnet *ifp, int disable) memset(&join, 0, sizeof(join)); bwfm_fwvar_cmd_set_data(sc, BWFM_C_SET_SSID, &join, sizeof(join)); - bwfm_fwvar_cmd_set_int(sc, BWFM_C_DOWN, 1); bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_PM, 0); + bwfm_fwvar_cmd_set_int(sc, BWFM_C_DOWN, 1); bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_AP, 0); bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_INFRA, 0); bwfm_fwvar_cmd_set_int(sc, BWFM_C_UP, 1); @@ -777,8 +783,7 @@ bwfm_ioctl(struct ifnet *ifp, u_long cmd, void *data) if (error == ENETRESET) { if ((ifp->if_flags & IFF_UP) != 0 && - (ifp->if_flags & IFF_RUNNING) != 0 && - ic->ic_roaming != IEEE80211_ROAMING_MANUAL) { + (ifp->if_flags & IFF_RUNNING) != 0) { bwfm_init(ifp); } error = 0; |
