From 9910a5676808ff2a0ab221ab7f36404a7ee5dd90 Mon Sep 17 00:00:00 2001 From: avos Date: Mon, 21 Mar 2016 21:33:30 +0000 Subject: [PATCH] rum: do not try to restore bssid/TSF synchronization when device is not associated. Tested with WUSB54GC, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5543 --- sys/dev/usb/wlan/if_rum.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 387b5b549712..1892662ead7e 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -2932,14 +2932,15 @@ rum_scan_end(struct ieee80211com *ic) { struct rum_softc *sc = ic->ic_softc; - RUM_LOCK(sc); - if (ic->ic_opmode != IEEE80211_M_AHDEMO) - rum_enable_tsf_sync(sc); - else - rum_enable_tsf(sc); - rum_set_bssid(sc, sc->sc_bssid); - RUM_UNLOCK(sc); - + if (ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) { + RUM_LOCK(sc); + if (ic->ic_opmode != IEEE80211_M_AHDEMO) + rum_enable_tsf_sync(sc); + else + rum_enable_tsf(sc); + rum_set_bssid(sc, sc->sc_bssid); + RUM_UNLOCK(sc); + } } static void