• Home
  • Raw
  • Download

Lines Matching full:sc

60 static bool ath9k_has_pending_frames(struct ath_softc *sc, struct ath_txq *txq,  in ath9k_has_pending_frames()  argument
78 acq = &sc->cur_chan->acq[txq->mac80211_qnum]; in ath9k_has_pending_frames()
87 static bool ath9k_setpower(struct ath_softc *sc, enum ath9k_power_mode mode) in ath9k_setpower() argument
92 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_setpower()
93 ret = ath9k_hw_setpower(sc->sc_ah, mode); in ath9k_setpower()
94 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_setpower()
101 struct ath_softc *sc = from_timer(sc, t, sleep_timer); in ath_ps_full_sleep() local
102 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_ps_full_sleep()
110 ath9k_hw_setrxabort(sc->sc_ah, 1); in ath_ps_full_sleep()
111 ath9k_hw_stopdmarecv(sc->sc_ah, &reset); in ath_ps_full_sleep()
113 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); in ath_ps_full_sleep()
116 void ath9k_ps_wakeup(struct ath_softc *sc) in ath9k_ps_wakeup() argument
118 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ps_wakeup()
122 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_ps_wakeup()
123 if (++sc->ps_usecount != 1) in ath9k_ps_wakeup()
126 del_timer_sync(&sc->sleep_timer); in ath9k_ps_wakeup()
127 power_mode = sc->sc_ah->power_mode; in ath9k_ps_wakeup()
128 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); in ath9k_ps_wakeup()
144 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_ps_wakeup()
147 void ath9k_ps_restore(struct ath_softc *sc) in ath9k_ps_restore() argument
149 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ps_restore()
153 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_ps_restore()
154 if (--sc->ps_usecount != 0) in ath9k_ps_restore()
157 if (sc->ps_idle) { in ath9k_ps_restore()
158 mod_timer(&sc->sleep_timer, jiffies + HZ / 10); in ath9k_ps_restore()
162 if (sc->ps_enabled && in ath9k_ps_restore()
163 !(sc->ps_flags & (PS_WAIT_FOR_BEACON | in ath9k_ps_restore()
169 if (ath9k_hw_btcoex_is_enabled(sc->sc_ah)) in ath9k_ps_restore()
170 ath9k_btcoex_stop_gen_timer(sc); in ath9k_ps_restore()
179 ath9k_hw_setpower(sc->sc_ah, mode); in ath9k_ps_restore()
182 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_ps_restore()
185 static void __ath_cancel_work(struct ath_softc *sc) in __ath_cancel_work() argument
187 cancel_work_sync(&sc->paprd_work); in __ath_cancel_work()
188 cancel_delayed_work_sync(&sc->hw_check_work); in __ath_cancel_work()
189 cancel_delayed_work_sync(&sc->hw_pll_work); in __ath_cancel_work()
192 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in __ath_cancel_work()
193 cancel_work_sync(&sc->mci_work); in __ath_cancel_work()
197 void ath_cancel_work(struct ath_softc *sc) in ath_cancel_work() argument
199 __ath_cancel_work(sc); in ath_cancel_work()
200 cancel_work_sync(&sc->hw_reset_work); in ath_cancel_work()
203 void ath_restart_work(struct ath_softc *sc) in ath_restart_work() argument
205 ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work, in ath_restart_work()
208 if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9330(sc->sc_ah)) in ath_restart_work()
209 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, in ath_restart_work()
212 ath_start_ani(sc); in ath_restart_work()
215 static bool ath_prepare_reset(struct ath_softc *sc) in ath_prepare_reset() argument
217 struct ath_hw *ah = sc->sc_ah; in ath_prepare_reset()
220 ieee80211_stop_queues(sc->hw); in ath_prepare_reset()
221 ath_stop_ani(sc); in ath_prepare_reset()
225 ret &= ath_stoprecv(sc); in ath_prepare_reset()
226 ret &= ath_drain_all_txq(sc); in ath_prepare_reset()
228 ret &= ath_drain_all_txq(sc); in ath_prepare_reset()
229 ret &= ath_stoprecv(sc); in ath_prepare_reset()
235 static bool ath_complete_reset(struct ath_softc *sc, bool start) in ath_complete_reset() argument
237 struct ath_hw *ah = sc->sc_ah; in ath_complete_reset()
241 ath9k_calculate_summary_state(sc, sc->cur_chan); in ath_complete_reset()
242 ath_startrecv(sc); in ath_complete_reset()
243 ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower, in ath_complete_reset()
244 sc->cur_chan->txpower, in ath_complete_reset()
245 &sc->cur_chan->cur_txpower); in ath_complete_reset()
248 if (!sc->cur_chan->offchannel && start) { in ath_complete_reset()
250 if (sc->cur_chan->tsf_val) { in ath_complete_reset()
253 offset = ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, in ath_complete_reset()
255 ath9k_hw_settsf64(ah, sc->cur_chan->tsf_val + offset); in ath_complete_reset()
264 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_complete_reset()
265 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; in ath_complete_reset()
266 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_complete_reset()
268 ath9k_set_beacon(sc); in ath_complete_reset()
271 ath_restart_work(sc); in ath_complete_reset()
272 ath_txq_schedule_all(sc); in ath_complete_reset()
275 sc->gtt_cnt = 0; in ath_complete_reset()
279 ieee80211_wake_queues(sc->hw); in ath_complete_reset()
280 ath9k_p2p_ps_timer(sc); in ath_complete_reset()
285 static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan) in ath_reset_internal() argument
287 struct ath_hw *ah = sc->sc_ah; in ath_reset_internal()
293 __ath_cancel_work(sc); in ath_reset_internal()
295 disable_irq(sc->irq); in ath_reset_internal()
296 tasklet_disable(&sc->intr_tq); in ath_reset_internal()
297 tasklet_disable(&sc->bcon_tasklet); in ath_reset_internal()
298 spin_lock_bh(&sc->sc_pcu_lock); in ath_reset_internal()
300 if (!sc->cur_chan->offchannel) { in ath_reset_internal()
302 caldata = &sc->cur_chan->caldata; in ath_reset_internal()
312 hchan = ath9k_cmn_get_channel(sc->hw, ah, &sc->cur_chan->chandef); in ath_reset_internal()
315 if (!ath_prepare_reset(sc)) in ath_reset_internal()
321 spin_lock_bh(&sc->chan_lock); in ath_reset_internal()
322 sc->cur_chandef = sc->cur_chan->chandef; in ath_reset_internal()
323 spin_unlock_bh(&sc->chan_lock); in ath_reset_internal()
334 ath9k_queue_reset(sc, RESET_TYPE_BB_HANG); in ath_reset_internal()
339 if (ath9k_hw_mci_is_enabled(sc->sc_ah) && in ath_reset_internal()
340 sc->cur_chan->offchannel) in ath_reset_internal()
341 ath9k_mci_set_txpower(sc, true, false); in ath_reset_internal()
343 if (!ath_complete_reset(sc, true)) in ath_reset_internal()
347 enable_irq(sc->irq); in ath_reset_internal()
348 spin_unlock_bh(&sc->sc_pcu_lock); in ath_reset_internal()
349 tasklet_enable(&sc->bcon_tasklet); in ath_reset_internal()
350 tasklet_enable(&sc->intr_tq); in ath_reset_internal()
355 static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, in ath_node_attach() argument
361 an->sc = sc; in ath_node_attach()
366 ath_tx_node_init(sc, an); in ath_node_attach()
368 ath_dynack_node_init(sc->sc_ah, an); in ath_node_attach()
371 static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) in ath_node_detach() argument
374 ath_tx_node_cleanup(sc, an); in ath_node_detach()
376 ath_dynack_node_deinit(sc->sc_ah, an); in ath_node_detach()
381 struct ath_softc *sc = from_tasklet(sc, t, intr_tq); in ath9k_tasklet() local
382 struct ath_hw *ah = sc->sc_ah; in ath9k_tasklet()
389 spin_lock_irqsave(&sc->intr_lock, flags); in ath9k_tasklet()
390 status = sc->intrstatus; in ath9k_tasklet()
391 sc->intrstatus = 0; in ath9k_tasklet()
392 spin_unlock_irqrestore(&sc->intr_lock, flags); in ath9k_tasklet()
394 ath9k_ps_wakeup(sc); in ath9k_tasklet()
395 spin_lock(&sc->sc_pcu_lock); in ath9k_tasklet()
399 ath9k_queue_reset(sc, type); in ath9k_tasklet()
413 ath9k_queue_reset(sc, type); in ath9k_tasklet()
422 sc->gtt_cnt++; in ath9k_tasklet()
424 if ((sc->gtt_cnt >= MAX_GTT_CNT) && !ath9k_hw_check_alive(ah)) { in ath9k_tasklet()
426 ath9k_queue_reset(sc, type); in ath9k_tasklet()
433 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_tasklet()
434 if ((status & ATH9K_INT_TSFOOR) && sc->ps_enabled) { in ath9k_tasklet()
440 sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC; in ath9k_tasklet()
442 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_tasklet()
454 ath_rx_tasklet(sc, 0, true); in ath9k_tasklet()
456 ath_rx_tasklet(sc, 0, false); in ath9k_tasklet()
467 sc->gtt_cnt = 0; in ath9k_tasklet()
469 ath_tx_edma_tasklet(sc); in ath9k_tasklet()
471 ath_tx_tasklet(sc); in ath9k_tasklet()
474 wake_up(&sc->tx_wait); in ath9k_tasklet()
478 ath_gen_timer_isr(sc->sc_ah); in ath9k_tasklet()
480 ath9k_btcoex_handle_interrupt(sc, status); in ath9k_tasklet()
485 spin_unlock(&sc->sc_pcu_lock); in ath9k_tasklet()
486 ath9k_ps_restore(sc); in ath9k_tasklet()
507 struct ath_softc *sc = dev; in ath_isr() local
508 struct ath_hw *ah = sc->sc_ah; in ath_isr()
533 ath9k_debug_sync_cause(sc, sync_cause); in ath_isr()
537 ath9k_hw_kill_interrupts(sc->sc_ah); in ath_isr()
549 spin_lock(&sc->intr_lock); in ath_isr()
550 sc->intrstatus |= status; in ath_isr()
551 spin_unlock(&sc->intr_lock); in ath_isr()
568 tasklet_schedule(&sc->bcon_tasklet); in ath_isr()
580 if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle)) in ath_isr()
584 ath9k_setpower(sc, ATH9K_PM_AWAKE); in ath_isr()
585 spin_lock(&sc->sc_pm_lock); in ath_isr()
586 ath9k_hw_setrxabort(sc->sc_ah, 0); in ath_isr()
587 sc->ps_flags |= PS_WAIT_FOR_BEACON; in ath_isr()
588 spin_unlock(&sc->sc_pm_lock); in ath_isr()
593 ath_debug_stat_interrupt(sc, status); in ath_isr()
598 tasklet_schedule(&sc->intr_tq); in ath_isr()
610 int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan) in ath_reset() argument
612 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_reset()
615 ath9k_hw_kill_interrupts(sc->sc_ah); in ath_reset()
618 ath9k_ps_wakeup(sc); in ath_reset()
619 r = ath_reset_internal(sc, hchan); in ath_reset()
620 ath9k_ps_restore(sc); in ath_reset()
630 void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type) in ath9k_queue_reset() argument
632 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_queue_reset()
634 RESET_STAT_INC(sc, type); in ath9k_queue_reset()
636 ath9k_hw_kill_interrupts(sc->sc_ah); in ath9k_queue_reset()
638 ieee80211_queue_work(sc->hw, &sc->hw_reset_work); in ath9k_queue_reset()
643 struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work); in ath_reset_work() local
645 ath9k_ps_wakeup(sc); in ath_reset_work()
646 ath_reset_internal(sc, NULL); in ath_reset_work()
647 ath9k_ps_restore(sc); in ath_reset_work()
656 struct ath_softc *sc = hw->priv; in ath9k_start() local
657 struct ath_hw *ah = sc->sc_ah; in ath9k_start()
659 struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; in ath9k_start()
660 struct ath_chanctx *ctx = sc->cur_chan; in ath9k_start()
668 ath9k_ps_wakeup(sc); in ath9k_start()
669 mutex_lock(&sc->mutex); in ath9k_start()
672 sc->cur_chandef = hw->conf.chandef; in ath9k_start()
684 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_start()
720 ath_mci_enable(sc); in ath9k_start()
723 sc->sc_ah->is_monitoring = false; in ath9k_start()
725 if (!ath_complete_reset(sc, false)) in ath9k_start()
739 ath9k_cmn_init_crypto(sc->sc_ah); in ath9k_start()
743 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_start()
745 ath9k_rng_start(sc); in ath9k_start()
747 mutex_unlock(&sc->mutex); in ath9k_start()
749 ath9k_ps_restore(sc); in ath9k_start()
758 struct ath_softc *sc = hw->priv; in ath9k_tx() local
759 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_tx()
764 if (sc->ps_enabled) { in ath9k_tx()
778 if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP)) { in ath9k_tx()
784 ath9k_ps_wakeup(sc); in ath9k_tx()
785 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_tx()
786 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) in ath9k_tx()
787 ath9k_hw_setrxabort(sc->sc_ah, 0); in ath9k_tx()
791 sc->ps_flags |= PS_WAIT_FOR_PSPOLL_DATA; in ath9k_tx()
794 sc->ps_flags |= PS_WAIT_FOR_TX_ACK; in ath9k_tx()
801 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_tx()
802 ath9k_ps_restore(sc); in ath9k_tx()
809 if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_FULL_SLEEP)) { in ath9k_tx()
815 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)]; in ath9k_tx()
822 TX_STAT_INC(sc, txctl.txq->axq_qnum, txfailed); in ath9k_tx()
850 static bool ath9k_txq_has_key(struct ath_softc *sc, u32 keyix) in ath9k_txq_has_key() argument
852 struct ath_hw *ah = sc->sc_ah; in ath9k_txq_has_key()
858 if (!ATH_TXQ_SETUP(sc, i)) in ath9k_txq_has_key()
860 txq = &sc->tx.txq[i]; in ath9k_txq_has_key()
866 ath_txq_lock(sc, txq); in ath9k_txq_has_key()
868 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { in ath9k_txq_has_key()
879 ath_txq_unlock(sc, txq); in ath9k_txq_has_key()
885 static void ath9k_pending_key_del(struct ath_softc *sc, u8 keyix) in ath9k_pending_key_del() argument
887 struct ath_hw *ah = sc->sc_ah; in ath9k_pending_key_del()
891 ath9k_txq_has_key(sc, keyix)) in ath9k_pending_key_del()
901 struct ath_softc *sc = hw->priv; in ath9k_stop() local
902 struct ath_hw *ah = sc->sc_ah; in ath9k_stop()
907 ath9k_deinit_channel_context(sc); in ath9k_stop()
909 mutex_lock(&sc->mutex); in ath9k_stop()
911 ath9k_rng_stop(sc); in ath9k_stop()
913 ath_cancel_work(sc); in ath9k_stop()
917 mutex_unlock(&sc->mutex); in ath9k_stop()
922 ath9k_ps_wakeup(sc); in ath9k_stop()
924 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_stop()
933 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_stop()
937 synchronize_irq(sc->irq); in ath9k_stop()
938 tasklet_kill(&sc->intr_tq); in ath9k_stop()
939 tasklet_kill(&sc->bcon_tasklet); in ath9k_stop()
941 prev_idle = sc->ps_idle; in ath9k_stop()
942 sc->ps_idle = true; in ath9k_stop()
944 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_stop()
952 ath_prepare_reset(sc); in ath9k_stop()
954 if (sc->rx.frag) { in ath9k_stop()
955 dev_kfree_skb_any(sc->rx.frag); in ath9k_stop()
956 sc->rx.frag = NULL; in ath9k_stop()
961 &sc->cur_chan->chandef); in ath9k_stop()
971 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_stop()
974 ath9k_pending_key_del(sc, i); in ath9k_stop()
979 ath9k_cmn_init_crypto(sc->sc_ah); in ath9k_stop()
981 ath9k_ps_restore(sc); in ath9k_stop()
983 sc->ps_idle = prev_idle; in ath9k_stop()
985 mutex_unlock(&sc->mutex); in ath9k_stop()
1068 static void ath9k_update_bssid_mask(struct ath_softc *sc, in ath9k_update_bssid_mask() argument
1072 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_update_bssid_mask()
1092 sc->hw->wiphy->perm_addr[i]); in ath9k_update_bssid_mask()
1096 /* Called with sc->mutex held. */
1097 void ath9k_calculate_iter_data(struct ath_softc *sc, in ath9k_calculate_iter_data() argument
1114 ath9k_update_bssid_mask(sc, ctx, iter_data); in ath9k_calculate_iter_data()
1117 static void ath9k_set_assoc_state(struct ath_softc *sc, in ath9k_set_assoc_state() argument
1120 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_set_assoc_state()
1128 ath9k_hw_write_associd(sc->sc_ah); in ath9k_set_assoc_state()
1132 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; in ath9k_set_assoc_state()
1134 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_set_assoc_state()
1135 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; in ath9k_set_assoc_state()
1136 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_set_assoc_state()
1139 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in ath9k_set_assoc_state()
1140 ath9k_mci_update_wlan_channels(sc, false); in ath9k_set_assoc_state()
1148 static void ath9k_set_offchannel_state(struct ath_softc *sc) in ath9k_set_offchannel_state() argument
1150 struct ath_hw *ah = sc->sc_ah; in ath9k_set_offchannel_state()
1154 ath9k_ps_wakeup(sc); in ath9k_set_offchannel_state()
1156 if (sc->offchannel.state < ATH_OFFCHANNEL_ROC_START) in ath9k_set_offchannel_state()
1157 vif = sc->offchannel.scan_vif; in ath9k_set_offchannel_state()
1159 vif = sc->offchannel.roc_vif; in ath9k_set_offchannel_state()
1175 ath9k_hw_write_associd(sc->sc_ah); in ath9k_set_offchannel_state()
1180 ath9k_ps_restore(sc); in ath9k_set_offchannel_state()
1184 /* Called with sc->mutex held. */
1185 void ath9k_calculate_summary_state(struct ath_softc *sc, in ath9k_calculate_summary_state() argument
1188 struct ath_hw *ah = sc->sc_ah; in ath9k_calculate_summary_state()
1192 ath_chanctx_check_active(sc, ctx); in ath9k_calculate_summary_state()
1194 if (ctx != sc->cur_chan) in ath9k_calculate_summary_state()
1198 if (ctx == &sc->offchannel.chan) in ath9k_calculate_summary_state()
1199 return ath9k_set_offchannel_state(sc); in ath9k_calculate_summary_state()
1202 ath9k_ps_wakeup(sc); in ath9k_calculate_summary_state()
1203 ath9k_calculate_iter_data(sc, ctx, &iter_data); in ath9k_calculate_summary_state()
1217 ath9k_beacon_ensure_primary_slot(sc); in ath9k_calculate_summary_state()
1248 ath9k_set_assoc_state(sc, iter_data.primary_sta, in ath9k_calculate_summary_state()
1255 ath9k_hw_write_associd(sc->sc_ah); in ath9k_calculate_summary_state()
1256 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in ath9k_calculate_summary_state()
1257 ath9k_mci_update_wlan_channels(sc, true); in ath9k_calculate_summary_state()
1260 sc->nbcnvifs = iter_data.nbcnvifs; in ath9k_calculate_summary_state()
1261 ath9k_beacon_config(sc, iter_data.primary_beacon_vif, in ath9k_calculate_summary_state()
1279 ath9k_ps_restore(sc); in ath9k_calculate_summary_state()
1293 /* Called with sc->mutex held. */
1294 void ath9k_set_txpower(struct ath_softc *sc, struct ieee80211_vif *vif) in ath9k_set_txpower() argument
1297 struct ath_hw *ah = sc->sc_ah; in ath9k_set_txpower()
1300 ath9k_ps_wakeup(sc); in ath9k_set_txpower()
1304 sc->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in ath9k_set_txpower()
1307 power = sc->hw->conf.power_level; in ath9k_set_txpower()
1309 power = sc->hw->conf.power_level; in ath9k_set_txpower()
1311 sc->cur_chan->txpower = 2 * power; in ath9k_set_txpower()
1312 ath9k_hw_set_txpowerlimit(ah, sc->cur_chan->txpower, false); in ath9k_set_txpower()
1313 sc->cur_chan->cur_txpower = reg->max_power_level; in ath9k_set_txpower()
1314 ath9k_ps_restore(sc); in ath9k_set_txpower()
1338 struct ath_softc *sc = hw->priv; in ath9k_add_interface() local
1339 struct ath_hw *ah = sc->sc_ah; in ath9k_add_interface()
1344 mutex_lock(&sc->mutex); in ath9k_add_interface()
1346 if (sc->cur_chan->nvifs >= 1) { in ath9k_add_interface()
1347 mutex_unlock(&sc->mutex); in ath9k_add_interface()
1350 sc->tx99_vif = vif; in ath9k_add_interface()
1354 sc->cur_chan->nvifs++; in ath9k_add_interface()
1360 ath9k_beacon_assign_slot(sc, vif); in ath9k_add_interface()
1364 avp->chanctx = sc->cur_chan; in ath9k_add_interface()
1368 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_add_interface()
1372 ath9k_set_txpower(sc, vif); in ath9k_add_interface()
1374 an->sc = sc; in ath9k_add_interface()
1378 ath_tx_node_init(sc, an); in ath9k_add_interface()
1380 mutex_unlock(&sc->mutex); in ath9k_add_interface()
1389 struct ath_softc *sc = hw->priv; in ath9k_change_interface() local
1390 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_change_interface()
1393 mutex_lock(&sc->mutex); in ath9k_change_interface()
1396 mutex_unlock(&sc->mutex); in ath9k_change_interface()
1403 ath9k_beacon_remove_slot(sc, vif); in ath9k_change_interface()
1409 ath9k_beacon_assign_slot(sc, vif); in ath9k_change_interface()
1412 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_change_interface()
1414 ath9k_set_txpower(sc, vif); in ath9k_change_interface()
1416 mutex_unlock(&sc->mutex); in ath9k_change_interface()
1423 struct ath_softc *sc = hw->priv; in ath9k_remove_interface() local
1424 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remove_interface()
1429 mutex_lock(&sc->mutex); in ath9k_remove_interface()
1431 ath9k_p2p_remove_vif(sc, vif); in ath9k_remove_interface()
1433 sc->cur_chan->nvifs--; in ath9k_remove_interface()
1434 sc->tx99_vif = NULL; in ath9k_remove_interface()
1439 ath9k_beacon_remove_slot(sc, vif); in ath9k_remove_interface()
1441 ath_tx_node_cleanup(sc, &avp->mcast_node); in ath9k_remove_interface()
1443 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_remove_interface()
1445 ath9k_set_txpower(sc, NULL); in ath9k_remove_interface()
1447 mutex_unlock(&sc->mutex); in ath9k_remove_interface()
1450 static void ath9k_enable_ps(struct ath_softc *sc) in ath9k_enable_ps() argument
1452 struct ath_hw *ah = sc->sc_ah; in ath9k_enable_ps()
1458 sc->ps_enabled = true; in ath9k_enable_ps()
1469 static void ath9k_disable_ps(struct ath_softc *sc) in ath9k_disable_ps() argument
1471 struct ath_hw *ah = sc->sc_ah; in ath9k_disable_ps()
1477 sc->ps_enabled = false; in ath9k_disable_ps()
1481 sc->ps_flags &= ~(PS_WAIT_FOR_BEACON | in ath9k_disable_ps()
1495 struct ath_softc *sc = hw->priv; in ath9k_config() local
1496 struct ath_hw *ah = sc->sc_ah; in ath9k_config()
1499 struct ath_chanctx *ctx = sc->cur_chan; in ath9k_config()
1501 ath9k_ps_wakeup(sc); in ath9k_config()
1502 mutex_lock(&sc->mutex); in ath9k_config()
1505 sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); in ath9k_config()
1506 if (sc->ps_idle) { in ath9k_config()
1507 ath_cancel_work(sc); in ath9k_config()
1508 ath9k_stop_btcoex(sc); in ath9k_config()
1510 ath9k_start_btcoex(sc); in ath9k_config()
1515 ath_chanctx_set_channel(sc, ctx, &ctx->chandef); in ath9k_config()
1527 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_config()
1529 ath9k_enable_ps(sc); in ath9k_config()
1531 ath9k_disable_ps(sc); in ath9k_config()
1532 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_config()
1538 sc->sc_ah->is_monitoring = true; in ath9k_config()
1541 sc->sc_ah->is_monitoring = false; in ath9k_config()
1547 ath_chanctx_set_channel(sc, ctx, &hw->conf.chandef); in ath9k_config()
1551 ath9k_set_txpower(sc, NULL); in ath9k_config()
1553 mutex_unlock(&sc->mutex); in ath9k_config()
1554 ath9k_ps_restore(sc); in ath9k_config()
1569 /* FIXME: sc->sc_full_reset ? */
1575 struct ath_softc *sc = hw->priv; in ath9k_configure_filter() local
1582 spin_lock_bh(&sc->chan_lock); in ath9k_configure_filter()
1583 ath_for_each_chanctx(sc, ctx) in ath9k_configure_filter()
1586 sc->offchannel.chan.rxfilter = *total_flags; in ath9k_configure_filter()
1588 spin_unlock_bh(&sc->chan_lock); in ath9k_configure_filter()
1590 ath9k_ps_wakeup(sc); in ath9k_configure_filter()
1591 rfilt = ath_calcrxfilter(sc); in ath9k_configure_filter()
1592 ath9k_hw_setrxfilter(sc->sc_ah, rfilt); in ath9k_configure_filter()
1593 ath9k_ps_restore(sc); in ath9k_configure_filter()
1595 ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG, "Set HW RX filter: 0x%x\n", in ath9k_configure_filter()
1603 struct ath_softc *sc = hw->priv; in ath9k_sta_add() local
1604 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sta_add()
1609 ath_node_attach(sc, sta, vif); in ath9k_sta_add()
1624 static void ath9k_del_ps_key(struct ath_softc *sc, in ath9k_del_ps_key() argument
1628 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_del_ps_key()
1643 struct ath_softc *sc = hw->priv; in ath9k_sta_remove() local
1645 ath9k_del_ps_key(sc, vif, sta); in ath9k_sta_remove()
1646 ath_node_detach(sc, sta); in ath9k_sta_remove()
1657 struct ath_softc *sc = hw->priv; in ath9k_sta_state() local
1658 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sta_state()
1677 ath_chanctx_event(sc, vif, in ath9k_sta_state()
1703 struct ath_softc *sc = hw->priv; in ath9k_sta_notify() local
1709 ath_tx_aggr_sleep(sta, sc, an); in ath9k_sta_notify()
1710 ath9k_sta_set_tx_filter(sc->sc_ah, an, true); in ath9k_sta_notify()
1713 ath9k_sta_set_tx_filter(sc->sc_ah, an, false); in ath9k_sta_notify()
1715 ath_tx_aggr_wakeup(sc, an); in ath9k_sta_notify()
1724 struct ath_softc *sc = hw->priv; in ath9k_conf_tx() local
1725 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_conf_tx()
1733 txq = sc->tx.txq_map[queue]; in ath9k_conf_tx()
1735 ath9k_ps_wakeup(sc); in ath9k_conf_tx()
1736 mutex_lock(&sc->mutex); in ath9k_conf_tx()
1750 ath_update_max_aggr_framelen(sc, queue, qi.tqi_burstTime); in ath9k_conf_tx()
1751 ret = ath_txq_update(sc, txq->axq_qnum, &qi); in ath9k_conf_tx()
1755 mutex_unlock(&sc->mutex); in ath9k_conf_tx()
1756 ath9k_ps_restore(sc); in ath9k_conf_tx()
1767 struct ath_softc *sc = hw->priv; in ath9k_set_key() local
1768 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_set_key()
1799 mutex_lock(&sc->mutex); in ath9k_set_key()
1800 ath9k_ps_wakeup(sc); in ath9k_set_key()
1809 ath9k_pending_key_del(sc, i); in ath9k_set_key()
1814 ath9k_del_ps_key(sc, vif, sta); in ath9k_set_key()
1824 if (sc->sc_ah->sw_mgmt_crypto_tx && in ath9k_set_key()
1840 if (ath9k_txq_has_key(sc, key->hw_key_idx)) { in ath9k_set_key()
1844 set_bit(key->hw_key_idx, sc->sc_ah->pending_del_keymap); in ath9k_set_key()
1863 ath9k_ps_restore(sc); in ath9k_set_key()
1864 mutex_unlock(&sc->mutex); in ath9k_set_key()
1879 struct ath_softc *sc = hw->priv; in ath9k_bss_info_changed() local
1880 struct ath_hw *ah = sc->sc_ah; in ath9k_bss_info_changed()
1885 ath9k_ps_wakeup(sc); in ath9k_bss_info_changed()
1886 mutex_lock(&sc->mutex); in ath9k_bss_info_changed()
1896 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_bss_info_changed()
1903 ath9k_hw_write_associd(sc->sc_ah); in ath9k_bss_info_changed()
1909 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_bss_info_changed()
1912 if ((avp->chanctx == sc->cur_chan) && in ath9k_bss_info_changed()
1925 sc->beacon.slottime = slottime; in ath9k_bss_info_changed()
1926 sc->beacon.updateslot = UPDATE; in ath9k_bss_info_changed()
1934 ath9k_p2p_bss_info_changed(sc, vif); in ath9k_bss_info_changed()
1937 ath_check_ani(sc); in ath9k_bss_info_changed()
1942 ath9k_set_txpower(sc, vif); in ath9k_bss_info_changed()
1945 mutex_unlock(&sc->mutex); in ath9k_bss_info_changed()
1946 ath9k_ps_restore(sc); in ath9k_bss_info_changed()
1953 struct ath_softc *sc = hw->priv; in ath9k_get_tsf() local
1957 mutex_lock(&sc->mutex); in ath9k_get_tsf()
1958 ath9k_ps_wakeup(sc); in ath9k_get_tsf()
1960 if (sc->cur_chan == avp->chanctx) { in ath9k_get_tsf()
1961 tsf = ath9k_hw_gettsf64(sc->sc_ah); in ath9k_get_tsf()
1963 tsf = sc->cur_chan->tsf_val + in ath9k_get_tsf()
1964 ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL); in ath9k_get_tsf()
1967 ath9k_ps_restore(sc); in ath9k_get_tsf()
1968 mutex_unlock(&sc->mutex); in ath9k_get_tsf()
1977 struct ath_softc *sc = hw->priv; in ath9k_set_tsf() local
1980 mutex_lock(&sc->mutex); in ath9k_set_tsf()
1981 ath9k_ps_wakeup(sc); in ath9k_set_tsf()
1984 if (sc->cur_chan == avp->chanctx) in ath9k_set_tsf()
1985 ath9k_hw_settsf64(sc->sc_ah, tsf); in ath9k_set_tsf()
1987 ath9k_ps_restore(sc); in ath9k_set_tsf()
1988 mutex_unlock(&sc->mutex); in ath9k_set_tsf()
1993 struct ath_softc *sc = hw->priv; in ath9k_reset_tsf() local
1996 mutex_lock(&sc->mutex); in ath9k_reset_tsf()
1998 ath9k_ps_wakeup(sc); in ath9k_reset_tsf()
2000 if (sc->cur_chan == avp->chanctx) in ath9k_reset_tsf()
2001 ath9k_hw_reset_tsf(sc->sc_ah); in ath9k_reset_tsf()
2003 ath9k_ps_restore(sc); in ath9k_reset_tsf()
2005 mutex_unlock(&sc->mutex); in ath9k_reset_tsf()
2012 struct ath_softc *sc = hw->priv; in ath9k_ampdu_action() local
2013 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ampdu_action()
2023 mutex_lock(&sc->mutex); in ath9k_ampdu_action()
2037 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
2038 ret = ath_tx_aggr_start(sc, sta, tid, ssn); in ath9k_ampdu_action()
2041 ath9k_ps_restore(sc); in ath9k_ampdu_action()
2048 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
2049 ath_tx_aggr_stop(sc, sta, tid); in ath9k_ampdu_action()
2052 ath9k_ps_restore(sc); in ath9k_ampdu_action()
2060 ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n"); in ath9k_ampdu_action()
2063 mutex_unlock(&sc->mutex); in ath9k_ampdu_action()
2071 struct ath_softc *sc = hw->priv; in ath9k_get_survey() local
2072 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_get_survey()
2083 ath_update_survey_stats(sc); in ath9k_get_survey()
2101 memcpy(survey, &sc->survey[pos], sizeof(*survey)); in ath9k_get_survey()
2108 static void ath9k_enable_dynack(struct ath_softc *sc) in ath9k_enable_dynack() argument
2112 struct ath_hw *ah = sc->sc_ah; in ath9k_enable_dynack()
2117 rfilt = ath_calcrxfilter(sc); in ath9k_enable_dynack()
2125 struct ath_softc *sc = hw->priv; in ath9k_set_coverage_class() local
2126 struct ath_hw *ah = sc->sc_ah; in ath9k_set_coverage_class()
2131 mutex_lock(&sc->mutex); in ath9k_set_coverage_class()
2139 rfilt = ath_calcrxfilter(sc); in ath9k_set_coverage_class()
2142 ath9k_ps_wakeup(sc); in ath9k_set_coverage_class()
2144 ath9k_ps_restore(sc); in ath9k_set_coverage_class()
2146 ath9k_enable_dynack(sc); in ath9k_set_coverage_class()
2149 mutex_unlock(&sc->mutex); in ath9k_set_coverage_class()
2152 static bool ath9k_has_tx_pending(struct ath_softc *sc, in ath9k_has_tx_pending() argument
2158 if (!ATH_TXQ_SETUP(sc, i)) in ath9k_has_tx_pending()
2161 npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i], in ath9k_has_tx_pending()
2173 struct ath_softc *sc = hw->priv; in ath9k_flush() local
2174 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_flush()
2184 * sc->mutex lock to allow the channel scheduler in ath9k_flush()
2194 mutex_lock(&sc->mutex); in ath9k_flush()
2196 mutex_unlock(&sc->mutex); in ath9k_flush()
2202 struct ath_softc *sc = hw->priv; in __ath9k_flush() local
2203 struct ath_hw *ah = sc->sc_ah; in __ath9k_flush()
2208 cancel_delayed_work_sync(&sc->hw_check_work); in __ath9k_flush()
2220 spin_lock_bh(&sc->chan_lock); in __ath9k_flush()
2224 timeout = sc->cur_chan->flush_timeout; in __ath9k_flush()
2225 spin_unlock_bh(&sc->chan_lock); in __ath9k_flush()
2230 if (wait_event_timeout(sc->tx_wait, !ath9k_has_tx_pending(sc, sw_pending), in __ath9k_flush()
2235 ath9k_ps_wakeup(sc); in __ath9k_flush()
2236 spin_lock_bh(&sc->sc_pcu_lock); in __ath9k_flush()
2237 drain_txq = ath_drain_all_txq(sc); in __ath9k_flush()
2238 spin_unlock_bh(&sc->sc_pcu_lock); in __ath9k_flush()
2241 ath_reset(sc, NULL); in __ath9k_flush()
2243 ath9k_ps_restore(sc); in __ath9k_flush()
2246 ieee80211_queue_delayed_work(hw, &sc->hw_check_work, in __ath9k_flush()
2252 struct ath_softc *sc = hw->priv; in ath9k_tx_frames_pending() local
2254 return ath9k_has_tx_pending(sc, true); in ath9k_tx_frames_pending()
2259 struct ath_softc *sc = hw->priv; in ath9k_tx_last_beacon() local
2260 struct ath_hw *ah = sc->sc_ah; in ath9k_tx_last_beacon()
2268 vif = sc->beacon.bslot[0]; in ath9k_tx_last_beacon()
2277 if (!sc->beacon.tx_processed && !edma) { in ath9k_tx_last_beacon()
2278 tasklet_disable(&sc->bcon_tasklet); in ath9k_tx_last_beacon()
2288 sc->beacon.tx_processed = true; in ath9k_tx_last_beacon()
2289 sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); in ath9k_tx_last_beacon()
2292 tasklet_enable(&sc->bcon_tasklet); in ath9k_tx_last_beacon()
2295 return sc->beacon.tx_last; in ath9k_tx_last_beacon()
2301 struct ath_softc *sc = hw->priv; in ath9k_get_stats() local
2302 struct ath_hw *ah = sc->sc_ah; in ath9k_get_stats()
2349 struct ath_softc *sc = hw->priv; in ath9k_set_antenna() local
2350 struct ath_hw *ah = sc->sc_ah; in ath9k_set_antenna()
2358 sc->ant_rx = rx_ant; in ath9k_set_antenna()
2359 sc->ant_tx = tx_ant; in ath9k_set_antenna()
2378 struct ath_softc *sc = hw->priv; in ath9k_get_antenna() local
2380 *tx_ant = sc->ant_tx; in ath9k_get_antenna()
2381 *rx_ant = sc->ant_rx; in ath9k_get_antenna()
2389 struct ath_softc *sc = hw->priv; in ath9k_sw_scan_start() local
2390 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sw_scan_start()
2397 struct ath_softc *sc = hw->priv; in ath9k_sw_scan_complete() local
2398 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sw_scan_complete()
2404 static void ath9k_cancel_pending_offchannel(struct ath_softc *sc) in ath9k_cancel_pending_offchannel() argument
2406 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_pending_offchannel()
2408 if (sc->offchannel.roc_vif) { in ath9k_cancel_pending_offchannel()
2412 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_pending_offchannel()
2413 if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START) in ath9k_cancel_pending_offchannel()
2414 ath_roc_complete(sc, ATH_ROC_COMPLETE_ABORT); in ath9k_cancel_pending_offchannel()
2421 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_pending_offchannel()
2422 ath_scan_complete(sc, true); in ath9k_cancel_pending_offchannel()
2430 struct ath_softc *sc = hw->priv; in ath9k_hw_scan() local
2431 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_hw_scan()
2434 mutex_lock(&sc->mutex); in ath9k_hw_scan()
2436 if (WARN_ON(sc->offchannel.scan_req)) { in ath9k_hw_scan()
2441 ath9k_ps_wakeup(sc); in ath9k_hw_scan()
2443 sc->offchannel.scan_vif = vif; in ath9k_hw_scan()
2444 sc->offchannel.scan_req = req; in ath9k_hw_scan()
2445 sc->offchannel.scan_idx = 0; in ath9k_hw_scan()
2450 if (sc->offchannel.state == ATH_OFFCHANNEL_IDLE) { in ath9k_hw_scan()
2452 ath_offchannel_next(sc); in ath9k_hw_scan()
2456 mutex_unlock(&sc->mutex); in ath9k_hw_scan()
2464 struct ath_softc *sc = hw->priv; in ath9k_cancel_hw_scan() local
2465 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_hw_scan()
2469 mutex_lock(&sc->mutex); in ath9k_cancel_hw_scan()
2470 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_hw_scan()
2471 ath_scan_complete(sc, true); in ath9k_cancel_hw_scan()
2472 mutex_unlock(&sc->mutex); in ath9k_cancel_hw_scan()
2480 struct ath_softc *sc = hw->priv; in ath9k_remain_on_channel() local
2481 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remain_on_channel()
2484 mutex_lock(&sc->mutex); in ath9k_remain_on_channel()
2486 if (WARN_ON(sc->offchannel.roc_vif)) { in ath9k_remain_on_channel()
2491 ath9k_ps_wakeup(sc); in ath9k_remain_on_channel()
2492 sc->offchannel.roc_vif = vif; in ath9k_remain_on_channel()
2493 sc->offchannel.roc_chan = chan; in ath9k_remain_on_channel()
2494 sc->offchannel.roc_duration = duration; in ath9k_remain_on_channel()
2500 if (sc->offchannel.state == ATH_OFFCHANNEL_IDLE) { in ath9k_remain_on_channel()
2502 ath_offchannel_next(sc); in ath9k_remain_on_channel()
2506 mutex_unlock(&sc->mutex); in ath9k_remain_on_channel()
2514 struct ath_softc *sc = hw->priv; in ath9k_cancel_remain_on_channel() local
2515 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_remain_on_channel()
2517 mutex_lock(&sc->mutex); in ath9k_cancel_remain_on_channel()
2520 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_remain_on_channel()
2522 if (sc->offchannel.roc_vif) { in ath9k_cancel_remain_on_channel()
2523 if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START) in ath9k_cancel_remain_on_channel()
2524 ath_roc_complete(sc, ATH_ROC_COMPLETE_CANCEL); in ath9k_cancel_remain_on_channel()
2527 mutex_unlock(&sc->mutex); in ath9k_cancel_remain_on_channel()
2535 struct ath_softc *sc = hw->priv; in ath9k_add_chanctx() local
2536 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_add_chanctx()
2540 mutex_lock(&sc->mutex); in ath9k_add_chanctx()
2542 ath_for_each_chanctx(sc, ctx) { in ath9k_add_chanctx()
2549 pos = ctx - &sc->chanctx[0]; in ath9k_add_chanctx()
2556 ath_chanctx_set_channel(sc, ctx, &conf->def); in ath9k_add_chanctx()
2558 mutex_unlock(&sc->mutex); in ath9k_add_chanctx()
2562 mutex_unlock(&sc->mutex); in ath9k_add_chanctx()
2570 struct ath_softc *sc = hw->priv; in ath9k_remove_chanctx() local
2571 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remove_chanctx()
2574 mutex_lock(&sc->mutex); in ath9k_remove_chanctx()
2582 ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_UNASSIGN); in ath9k_remove_chanctx()
2584 mutex_unlock(&sc->mutex); in ath9k_remove_chanctx()
2591 struct ath_softc *sc = hw->priv; in ath9k_change_chanctx() local
2592 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_change_chanctx()
2595 mutex_lock(&sc->mutex); in ath9k_change_chanctx()
2599 ath_chanctx_set_channel(sc, ctx, &conf->def); in ath9k_change_chanctx()
2600 mutex_unlock(&sc->mutex); in ath9k_change_chanctx()
2607 struct ath_softc *sc = hw->priv; in ath9k_assign_vif_chanctx() local
2608 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_assign_vif_chanctx()
2613 ath9k_cancel_pending_offchannel(sc); in ath9k_assign_vif_chanctx()
2615 mutex_lock(&sc->mutex); in ath9k_assign_vif_chanctx()
2625 ath9k_calculate_summary_state(sc, ctx); in ath9k_assign_vif_chanctx()
2629 mutex_unlock(&sc->mutex); in ath9k_assign_vif_chanctx()
2638 struct ath_softc *sc = hw->priv; in ath9k_unassign_vif_chanctx() local
2639 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_unassign_vif_chanctx()
2644 ath9k_cancel_pending_offchannel(sc); in ath9k_unassign_vif_chanctx()
2646 mutex_lock(&sc->mutex); in ath9k_unassign_vif_chanctx()
2656 ath9k_calculate_summary_state(sc, ctx); in ath9k_unassign_vif_chanctx()
2660 mutex_unlock(&sc->mutex); in ath9k_unassign_vif_chanctx()
2667 struct ath_softc *sc = hw->priv; in ath9k_mgd_prepare_tx() local
2668 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_mgd_prepare_tx()
2682 mutex_lock(&sc->mutex); in ath9k_mgd_prepare_tx()
2684 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2685 if (sc->next_chan || (sc->cur_chan != avp->chanctx)) in ath9k_mgd_prepare_tx()
2687 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2692 ath9k_cancel_pending_offchannel(sc); in ath9k_mgd_prepare_tx()
2694 go_ctx = ath_is_go_chanctx_present(sc); in ath9k_mgd_prepare_tx()
2701 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2702 sc->sched.mgd_prepare_tx = true; in ath9k_mgd_prepare_tx()
2705 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2708 init_completion(&sc->go_beacon); in ath9k_mgd_prepare_tx()
2710 mutex_unlock(&sc->mutex); in ath9k_mgd_prepare_tx()
2712 if (wait_for_completion_timeout(&sc->go_beacon, in ath9k_mgd_prepare_tx()
2717 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2718 sc->sched.mgd_prepare_tx = false; in ath9k_mgd_prepare_tx()
2719 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2722 mutex_lock(&sc->mutex); in ath9k_mgd_prepare_tx()
2729 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2730 sc->next_chan = avp->chanctx; in ath9k_mgd_prepare_tx()
2731 sc->sched.state = ATH_CHANCTX_STATE_FORCE_ACTIVE; in ath9k_mgd_prepare_tx()
2732 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2734 ath_chanctx_set_next(sc, true); in ath9k_mgd_prepare_tx()
2736 mutex_unlock(&sc->mutex); in ath9k_mgd_prepare_tx()
2761 struct ath_softc *sc = hw->priv; in ath9k_get_txpower() local
2764 mutex_lock(&sc->mutex); in ath9k_get_txpower()
2768 *dbm = sc->cur_chan->cur_txpower; in ath9k_get_txpower()
2769 mutex_unlock(&sc->mutex); in ath9k_get_txpower()