From 3d8e91f9ce6439dc98ccdb055135afee8fc5b984 Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Sat, 4 Apr 2015 08:41:02 +0000 Subject: [PATCH] urtwn: blink the LED when scanning. Previously, the driver was trying to blink the LED in the newstate function, but that only gets called once (unlike OpenBSD's net80211 stack). Move the LED blinking to set_channel(). While there, don't try to set the channel when we switch to the SCAN state. This is already accomplished by the set_channel() function. MFC after: 1 week --- sys/dev/usb/wlan/if_urtwn.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c index eca5998ecc0c..c4c88767e6ea 100644 --- a/sys/dev/usb/wlan/if_urtwn.c +++ b/sys/dev/usb/wlan/if_urtwn.c @@ -1568,14 +1568,9 @@ urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); } } - /* Make link LED blink during scan. */ - urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); - /* Pause AC Tx queues. */ urtwn_write_1(sc, R92C_TXPAUSE, urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); - - urtwn_set_chan(sc, ic->ic_curchan, NULL); break; case IEEE80211_S_AUTH: /* Set initial gain under link. */ @@ -3131,8 +3126,13 @@ static void urtwn_set_channel(struct ieee80211com *ic) { struct urtwn_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); URTWN_LOCK(sc); + if (vap->iv_state == IEEE80211_S_SCAN) { + /* Make link LED blink during scan. */ + urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); + } urtwn_set_chan(sc, ic->ic_curchan, NULL); URTWN_UNLOCK(sc); }