aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/beacon.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-01-20 09:27:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-12 15:31:48 -0500
commit4effc6fda7ab2fc10f640601359a63b04ad8f382 (patch)
tree053e45aed80ca64a774448742200455ef4a10bb8 /drivers/net/wireless/ath/ath9k/beacon.c
parent841577c3d33b8a2bff66d1b506d8198b25900bde (diff)
ath9k: prepare for multi-interface CSA support
Soon mac80211 will support multi-interface CSA so using sc->csa_vif is not an option. Instead just depend on vif->csa_active. Calling ieee80211_csa_finish() multiple number of times should not be an issue. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/beacon.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 2e8bba0eb361..32d00e8cfd0c 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -292,11 +292,8 @@ static void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif)
292 (unsigned long long)tsfadjust, avp->av_bslot); 292 (unsigned long long)tsfadjust, avp->av_bslot);
293} 293}
294 294
295bool ath9k_csa_is_finished(struct ath_softc *sc) 295bool ath9k_csa_is_finished(struct ath_softc *sc, struct ieee80211_vif *vif)
296{ 296{
297 struct ieee80211_vif *vif;
298
299 vif = sc->csa_vif;
300 if (!vif || !vif->csa_active) 297 if (!vif || !vif->csa_active)
301 return false; 298 return false;
302 299
@@ -304,11 +301,23 @@ bool ath9k_csa_is_finished(struct ath_softc *sc)
304 return false; 301 return false;
305 302
306 ieee80211_csa_finish(vif); 303 ieee80211_csa_finish(vif);
307
308 sc->csa_vif = NULL;
309 return true; 304 return true;
310} 305}
311 306
307static void ath9k_csa_update_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
308{
309 struct ath_softc *sc = data;
310 ath9k_csa_is_finished(sc, vif);
311}
312
313void ath9k_csa_update(struct ath_softc *sc)
314{
315 ieee80211_iterate_active_interfaces(sc->hw,
316 IEEE80211_IFACE_ITER_NORMAL,
317 ath9k_csa_update_vif,
318 sc);
319}
320
312void ath9k_beacon_tasklet(unsigned long data) 321void ath9k_beacon_tasklet(unsigned long data)
313{ 322{
314 struct ath_softc *sc = (struct ath_softc *)data; 323 struct ath_softc *sc = (struct ath_softc *)data;
@@ -362,13 +371,13 @@ void ath9k_beacon_tasklet(unsigned long data)
362 return; 371 return;
363 } 372 }
364 373
365 /* EDMA devices check that in the tx completion function. */
366 if (!edma && ath9k_csa_is_finished(sc))
367 return;
368
369 slot = ath9k_beacon_choose_slot(sc); 374 slot = ath9k_beacon_choose_slot(sc);
370 vif = sc->beacon.bslot[slot]; 375 vif = sc->beacon.bslot[slot];
371 376
377 /* EDMA devices check that in the tx completion function. */
378 if (!edma && ath9k_csa_is_finished(sc, vif))
379 return;
380
372 if (!vif || !vif->bss_conf.enable_beacon) 381 if (!vif || !vif->bss_conf.enable_beacon)
373 return; 382 return;
374 383