diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-01-20 09:27:12 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-12 15:31:48 -0500 |
commit | 4effc6fda7ab2fc10f640601359a63b04ad8f382 (patch) | |
tree | 053e45aed80ca64a774448742200455ef4a10bb8 /drivers/net/wireless | |
parent | 841577c3d33b8a2bff66d1b506d8198b25900bde (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')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 2 |
4 files changed, 24 insertions, 23 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index b5ac32cfbeb8..7fde8ecb6ea1 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -442,7 +442,8 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, | |||
442 | void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif); | 442 | void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif); |
443 | void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); | 443 | void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); |
444 | void ath9k_set_beacon(struct ath_softc *sc); | 444 | void ath9k_set_beacon(struct ath_softc *sc); |
445 | bool ath9k_csa_is_finished(struct ath_softc *sc); | 445 | bool ath9k_csa_is_finished(struct ath_softc *sc, struct ieee80211_vif *vif); |
446 | void ath9k_csa_update(struct ath_softc *sc); | ||
446 | 447 | ||
447 | /*******************/ | 448 | /*******************/ |
448 | /* Link Monitoring */ | 449 | /* Link Monitoring */ |
@@ -774,7 +775,6 @@ struct ath_softc { | |||
774 | #endif | 775 | #endif |
775 | 776 | ||
776 | struct ath_descdma txsdma; | 777 | struct ath_descdma txsdma; |
777 | struct ieee80211_vif *csa_vif; | ||
778 | 778 | ||
779 | struct ath_ant_comb ant_comb; | 779 | struct ath_ant_comb ant_comb; |
780 | u8 ant_tx, ant_rx; | 780 | u8 ant_tx, ant_rx; |
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 | ||
295 | bool ath9k_csa_is_finished(struct ath_softc *sc) | 295 | bool 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 | ||
307 | static 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 | |||
313 | void 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 | |||
312 | void ath9k_beacon_tasklet(unsigned long data) | 321 | void 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 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 5924f72dd493..317fcb99cfba 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1178,9 +1178,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1178 | if (ath9k_uses_beacons(vif->type)) | 1178 | if (ath9k_uses_beacons(vif->type)) |
1179 | ath9k_beacon_remove_slot(sc, vif); | 1179 | ath9k_beacon_remove_slot(sc, vif); |
1180 | 1180 | ||
1181 | if (sc->csa_vif == vif) | ||
1182 | sc->csa_vif = NULL; | ||
1183 | |||
1184 | ath9k_ps_wakeup(sc); | 1181 | ath9k_ps_wakeup(sc); |
1185 | ath9k_calculate_summary_state(hw, NULL); | 1182 | ath9k_calculate_summary_state(hw, NULL); |
1186 | ath9k_ps_restore(sc); | 1183 | ath9k_ps_restore(sc); |
@@ -2086,13 +2083,8 @@ static void ath9k_channel_switch_beacon(struct ieee80211_hw *hw, | |||
2086 | struct ieee80211_vif *vif, | 2083 | struct ieee80211_vif *vif, |
2087 | struct cfg80211_chan_def *chandef) | 2084 | struct cfg80211_chan_def *chandef) |
2088 | { | 2085 | { |
2089 | struct ath_softc *sc = hw->priv; | 2086 | /* depend on vif->csa_active only */ |
2090 | 2087 | return; | |
2091 | /* mac80211 does not support CSA in multi-if cases (yet) */ | ||
2092 | if (WARN_ON(sc->csa_vif)) | ||
2093 | return; | ||
2094 | |||
2095 | sc->csa_vif = vif; | ||
2096 | } | 2088 | } |
2097 | 2089 | ||
2098 | struct ieee80211_ops ath9k_ops = { | 2090 | struct ieee80211_ops ath9k_ops = { |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 0a75e2f68c9d..a6507046dfe8 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -2566,7 +2566,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc) | |||
2566 | sc->beacon.tx_processed = true; | 2566 | sc->beacon.tx_processed = true; |
2567 | sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); | 2567 | sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); |
2568 | 2568 | ||
2569 | ath9k_csa_is_finished(sc); | 2569 | ath9k_csa_update(sc); |
2570 | continue; | 2570 | continue; |
2571 | } | 2571 | } |
2572 | 2572 | ||