Lines Matching refs:sc
57 static bool ath9k_has_pending_frames(struct ath_softc *sc, struct ath_txq *txq, in ath9k_has_pending_frames() argument
75 acq = &sc->cur_chan->acq[txq->mac80211_qnum]; in ath9k_has_pending_frames()
84 static bool ath9k_setpower(struct ath_softc *sc, enum ath9k_power_mode mode) in ath9k_setpower() argument
89 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_setpower()
90 ret = ath9k_hw_setpower(sc->sc_ah, mode); in ath9k_setpower()
91 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_setpower()
98 struct ath_softc *sc = from_timer(sc, t, sleep_timer); in ath_ps_full_sleep() local
99 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_ps_full_sleep()
107 ath9k_hw_setrxabort(sc->sc_ah, 1); in ath_ps_full_sleep()
108 ath9k_hw_stopdmarecv(sc->sc_ah, &reset); in ath_ps_full_sleep()
110 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); in ath_ps_full_sleep()
113 void ath9k_ps_wakeup(struct ath_softc *sc) in ath9k_ps_wakeup() argument
115 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ps_wakeup()
119 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_ps_wakeup()
120 if (++sc->ps_usecount != 1) in ath9k_ps_wakeup()
123 del_timer_sync(&sc->sleep_timer); in ath9k_ps_wakeup()
124 power_mode = sc->sc_ah->power_mode; in ath9k_ps_wakeup()
125 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); in ath9k_ps_wakeup()
141 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_ps_wakeup()
144 void ath9k_ps_restore(struct ath_softc *sc) in ath9k_ps_restore() argument
146 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ps_restore()
150 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_ps_restore()
151 if (--sc->ps_usecount != 0) in ath9k_ps_restore()
154 if (sc->ps_idle) { in ath9k_ps_restore()
155 mod_timer(&sc->sleep_timer, jiffies + HZ / 10); in ath9k_ps_restore()
159 if (sc->ps_enabled && in ath9k_ps_restore()
160 !(sc->ps_flags & (PS_WAIT_FOR_BEACON | in ath9k_ps_restore()
166 if (ath9k_hw_btcoex_is_enabled(sc->sc_ah)) in ath9k_ps_restore()
167 ath9k_btcoex_stop_gen_timer(sc); in ath9k_ps_restore()
176 ath9k_hw_setpower(sc->sc_ah, mode); in ath9k_ps_restore()
179 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_ps_restore()
182 static void __ath_cancel_work(struct ath_softc *sc) in __ath_cancel_work() argument
184 cancel_work_sync(&sc->paprd_work); in __ath_cancel_work()
185 cancel_delayed_work_sync(&sc->hw_check_work); in __ath_cancel_work()
186 cancel_delayed_work_sync(&sc->hw_pll_work); in __ath_cancel_work()
189 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in __ath_cancel_work()
190 cancel_work_sync(&sc->mci_work); in __ath_cancel_work()
194 void ath_cancel_work(struct ath_softc *sc) in ath_cancel_work() argument
196 __ath_cancel_work(sc); in ath_cancel_work()
197 cancel_work_sync(&sc->hw_reset_work); in ath_cancel_work()
200 void ath_restart_work(struct ath_softc *sc) in ath_restart_work() argument
202 ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work, in ath_restart_work()
205 if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9330(sc->sc_ah)) in ath_restart_work()
206 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, in ath_restart_work()
209 ath_start_ani(sc); in ath_restart_work()
212 static bool ath_prepare_reset(struct ath_softc *sc) in ath_prepare_reset() argument
214 struct ath_hw *ah = sc->sc_ah; in ath_prepare_reset()
217 ieee80211_stop_queues(sc->hw); in ath_prepare_reset()
218 ath_stop_ani(sc); in ath_prepare_reset()
222 ret &= ath_stoprecv(sc); in ath_prepare_reset()
223 ret &= ath_drain_all_txq(sc); in ath_prepare_reset()
225 ret &= ath_drain_all_txq(sc); in ath_prepare_reset()
226 ret &= ath_stoprecv(sc); in ath_prepare_reset()
232 static bool ath_complete_reset(struct ath_softc *sc, bool start) in ath_complete_reset() argument
234 struct ath_hw *ah = sc->sc_ah; in ath_complete_reset()
238 ath9k_calculate_summary_state(sc, sc->cur_chan); in ath_complete_reset()
239 ath_startrecv(sc); in ath_complete_reset()
240 ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower, in ath_complete_reset()
241 sc->cur_chan->txpower, in ath_complete_reset()
242 &sc->cur_chan->cur_txpower); in ath_complete_reset()
245 if (!sc->cur_chan->offchannel && start) { in ath_complete_reset()
247 if (sc->cur_chan->tsf_val) { in ath_complete_reset()
250 offset = ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, in ath_complete_reset()
252 ath9k_hw_settsf64(ah, sc->cur_chan->tsf_val + offset); in ath_complete_reset()
261 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_complete_reset()
262 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; in ath_complete_reset()
263 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_complete_reset()
265 ath9k_set_beacon(sc); in ath_complete_reset()
268 ath_restart_work(sc); in ath_complete_reset()
269 ath_txq_schedule_all(sc); in ath_complete_reset()
272 sc->gtt_cnt = 0; in ath_complete_reset()
276 ieee80211_wake_queues(sc->hw); in ath_complete_reset()
277 ath9k_p2p_ps_timer(sc); in ath_complete_reset()
282 static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan) in ath_reset_internal() argument
284 struct ath_hw *ah = sc->sc_ah; in ath_reset_internal()
290 __ath_cancel_work(sc); in ath_reset_internal()
292 disable_irq(sc->irq); in ath_reset_internal()
293 tasklet_disable(&sc->intr_tq); in ath_reset_internal()
294 tasklet_disable(&sc->bcon_tasklet); in ath_reset_internal()
295 spin_lock_bh(&sc->sc_pcu_lock); in ath_reset_internal()
297 if (!sc->cur_chan->offchannel) { in ath_reset_internal()
299 caldata = &sc->cur_chan->caldata; in ath_reset_internal()
307 if (!ath_prepare_reset(sc)) in ath_reset_internal()
313 spin_lock_bh(&sc->chan_lock); in ath_reset_internal()
314 sc->cur_chandef = sc->cur_chan->chandef; in ath_reset_internal()
315 spin_unlock_bh(&sc->chan_lock); in ath_reset_internal()
326 ath9k_queue_reset(sc, RESET_TYPE_BB_HANG); in ath_reset_internal()
331 if (ath9k_hw_mci_is_enabled(sc->sc_ah) && in ath_reset_internal()
332 sc->cur_chan->offchannel) in ath_reset_internal()
333 ath9k_mci_set_txpower(sc, true, false); in ath_reset_internal()
335 if (!ath_complete_reset(sc, true)) in ath_reset_internal()
339 enable_irq(sc->irq); in ath_reset_internal()
340 spin_unlock_bh(&sc->sc_pcu_lock); in ath_reset_internal()
341 tasklet_enable(&sc->bcon_tasklet); in ath_reset_internal()
342 tasklet_enable(&sc->intr_tq); in ath_reset_internal()
347 static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, in ath_node_attach() argument
353 an->sc = sc; in ath_node_attach()
358 ath_tx_node_init(sc, an); in ath_node_attach()
360 ath_dynack_node_init(sc->sc_ah, an); in ath_node_attach()
363 static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) in ath_node_detach() argument
366 ath_tx_node_cleanup(sc, an); in ath_node_detach()
368 ath_dynack_node_deinit(sc->sc_ah, an); in ath_node_detach()
373 struct ath_softc *sc = (struct ath_softc *)data; in ath9k_tasklet() local
374 struct ath_hw *ah = sc->sc_ah; in ath9k_tasklet()
381 spin_lock_irqsave(&sc->intr_lock, flags); in ath9k_tasklet()
382 status = sc->intrstatus; in ath9k_tasklet()
383 sc->intrstatus = 0; in ath9k_tasklet()
384 spin_unlock_irqrestore(&sc->intr_lock, flags); in ath9k_tasklet()
386 ath9k_ps_wakeup(sc); in ath9k_tasklet()
387 spin_lock(&sc->sc_pcu_lock); in ath9k_tasklet()
391 ath9k_queue_reset(sc, type); in ath9k_tasklet()
405 ath9k_queue_reset(sc, type); in ath9k_tasklet()
414 sc->gtt_cnt++; in ath9k_tasklet()
416 if ((sc->gtt_cnt >= MAX_GTT_CNT) && !ath9k_hw_check_alive(ah)) { in ath9k_tasklet()
418 ath9k_queue_reset(sc, type); in ath9k_tasklet()
425 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_tasklet()
426 if ((status & ATH9K_INT_TSFOOR) && sc->ps_enabled) { in ath9k_tasklet()
432 sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC; in ath9k_tasklet()
434 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_tasklet()
446 ath_rx_tasklet(sc, 0, true); in ath9k_tasklet()
448 ath_rx_tasklet(sc, 0, false); in ath9k_tasklet()
459 sc->gtt_cnt = 0; in ath9k_tasklet()
461 ath_tx_edma_tasklet(sc); in ath9k_tasklet()
463 ath_tx_tasklet(sc); in ath9k_tasklet()
466 wake_up(&sc->tx_wait); in ath9k_tasklet()
470 ath_gen_timer_isr(sc->sc_ah); in ath9k_tasklet()
472 ath9k_btcoex_handle_interrupt(sc, status); in ath9k_tasklet()
477 spin_unlock(&sc->sc_pcu_lock); in ath9k_tasklet()
478 ath9k_ps_restore(sc); in ath9k_tasklet()
499 struct ath_softc *sc = dev; in ath_isr() local
500 struct ath_hw *ah = sc->sc_ah; in ath_isr()
525 ath9k_debug_sync_cause(sc, sync_cause); in ath_isr()
539 spin_lock(&sc->intr_lock); in ath_isr()
540 sc->intrstatus |= status; in ath_isr()
541 spin_unlock(&sc->intr_lock); in ath_isr()
558 tasklet_schedule(&sc->bcon_tasklet); in ath_isr()
570 if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle)) in ath_isr()
574 ath9k_setpower(sc, ATH9K_PM_AWAKE); in ath_isr()
575 spin_lock(&sc->sc_pm_lock); in ath_isr()
576 ath9k_hw_setrxabort(sc->sc_ah, 0); in ath_isr()
577 sc->ps_flags |= PS_WAIT_FOR_BEACON; in ath_isr()
578 spin_unlock(&sc->sc_pm_lock); in ath_isr()
583 ath_debug_stat_interrupt(sc, status); in ath_isr()
588 tasklet_schedule(&sc->intr_tq); in ath_isr()
600 int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan) in ath_reset() argument
602 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_reset()
605 ath9k_hw_kill_interrupts(sc->sc_ah); in ath_reset()
608 ath9k_ps_wakeup(sc); in ath_reset()
609 r = ath_reset_internal(sc, hchan); in ath_reset()
610 ath9k_ps_restore(sc); in ath_reset()
620 void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type) in ath9k_queue_reset() argument
622 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_queue_reset()
624 RESET_STAT_INC(sc, type); in ath9k_queue_reset()
626 ath9k_hw_kill_interrupts(sc->sc_ah); in ath9k_queue_reset()
628 ieee80211_queue_work(sc->hw, &sc->hw_reset_work); in ath9k_queue_reset()
633 struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work); in ath_reset_work() local
635 ath9k_ps_wakeup(sc); in ath_reset_work()
636 ath_reset_internal(sc, NULL); in ath_reset_work()
637 ath9k_ps_restore(sc); in ath_reset_work()
646 struct ath_softc *sc = hw->priv; in ath9k_start() local
647 struct ath_hw *ah = sc->sc_ah; in ath9k_start()
649 struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; in ath9k_start()
650 struct ath_chanctx *ctx = sc->cur_chan; in ath9k_start()
658 ath9k_ps_wakeup(sc); in ath9k_start()
659 mutex_lock(&sc->mutex); in ath9k_start()
662 sc->cur_chandef = hw->conf.chandef; in ath9k_start()
674 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_start()
710 ath_mci_enable(sc); in ath9k_start()
713 sc->sc_ah->is_monitoring = false; in ath9k_start()
715 if (!ath_complete_reset(sc, false)) in ath9k_start()
729 ath9k_cmn_init_crypto(sc->sc_ah); in ath9k_start()
733 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_start()
735 ath9k_rng_start(sc); in ath9k_start()
737 mutex_unlock(&sc->mutex); in ath9k_start()
739 ath9k_ps_restore(sc); in ath9k_start()
748 struct ath_softc *sc = hw->priv; in ath9k_tx() local
749 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_tx()
754 if (sc->ps_enabled) { in ath9k_tx()
768 if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP)) { in ath9k_tx()
774 ath9k_ps_wakeup(sc); in ath9k_tx()
775 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_tx()
776 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) in ath9k_tx()
777 ath9k_hw_setrxabort(sc->sc_ah, 0); in ath9k_tx()
781 sc->ps_flags |= PS_WAIT_FOR_PSPOLL_DATA; in ath9k_tx()
784 sc->ps_flags |= PS_WAIT_FOR_TX_ACK; in ath9k_tx()
791 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_tx()
792 ath9k_ps_restore(sc); in ath9k_tx()
799 if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_FULL_SLEEP)) { in ath9k_tx()
805 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)]; in ath9k_tx()
823 struct ath_softc *sc = hw->priv; in ath9k_stop() local
824 struct ath_hw *ah = sc->sc_ah; in ath9k_stop()
828 ath9k_deinit_channel_context(sc); in ath9k_stop()
830 mutex_lock(&sc->mutex); in ath9k_stop()
832 ath9k_rng_stop(sc); in ath9k_stop()
834 ath_cancel_work(sc); in ath9k_stop()
838 mutex_unlock(&sc->mutex); in ath9k_stop()
843 ath9k_ps_wakeup(sc); in ath9k_stop()
845 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_stop()
854 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_stop()
858 synchronize_irq(sc->irq); in ath9k_stop()
859 tasklet_kill(&sc->intr_tq); in ath9k_stop()
860 tasklet_kill(&sc->bcon_tasklet); in ath9k_stop()
862 prev_idle = sc->ps_idle; in ath9k_stop()
863 sc->ps_idle = true; in ath9k_stop()
865 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_stop()
873 ath_prepare_reset(sc); in ath9k_stop()
875 if (sc->rx.frag) { in ath9k_stop()
876 dev_kfree_skb_any(sc->rx.frag); in ath9k_stop()
877 sc->rx.frag = NULL; in ath9k_stop()
882 &sc->cur_chan->chandef); in ath9k_stop()
892 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_stop()
894 ath9k_ps_restore(sc); in ath9k_stop()
896 sc->ps_idle = prev_idle; in ath9k_stop()
898 mutex_unlock(&sc->mutex); in ath9k_stop()
981 static void ath9k_update_bssid_mask(struct ath_softc *sc, in ath9k_update_bssid_mask() argument
985 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_update_bssid_mask()
1005 sc->hw->wiphy->perm_addr[i]); in ath9k_update_bssid_mask()
1010 void ath9k_calculate_iter_data(struct ath_softc *sc, in ath9k_calculate_iter_data() argument
1027 ath9k_update_bssid_mask(sc, ctx, iter_data); in ath9k_calculate_iter_data()
1030 static void ath9k_set_assoc_state(struct ath_softc *sc, in ath9k_set_assoc_state() argument
1033 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_set_assoc_state()
1041 ath9k_hw_write_associd(sc->sc_ah); in ath9k_set_assoc_state()
1045 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; in ath9k_set_assoc_state()
1047 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_set_assoc_state()
1048 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; in ath9k_set_assoc_state()
1049 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_set_assoc_state()
1052 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in ath9k_set_assoc_state()
1053 ath9k_mci_update_wlan_channels(sc, false); in ath9k_set_assoc_state()
1061 static void ath9k_set_offchannel_state(struct ath_softc *sc) in ath9k_set_offchannel_state() argument
1063 struct ath_hw *ah = sc->sc_ah; in ath9k_set_offchannel_state()
1067 ath9k_ps_wakeup(sc); in ath9k_set_offchannel_state()
1069 if (sc->offchannel.state < ATH_OFFCHANNEL_ROC_START) in ath9k_set_offchannel_state()
1070 vif = sc->offchannel.scan_vif; in ath9k_set_offchannel_state()
1072 vif = sc->offchannel.roc_vif; in ath9k_set_offchannel_state()
1088 ath9k_hw_write_associd(sc->sc_ah); in ath9k_set_offchannel_state()
1093 ath9k_ps_restore(sc); in ath9k_set_offchannel_state()
1098 void ath9k_calculate_summary_state(struct ath_softc *sc, in ath9k_calculate_summary_state() argument
1101 struct ath_hw *ah = sc->sc_ah; in ath9k_calculate_summary_state()
1105 ath_chanctx_check_active(sc, ctx); in ath9k_calculate_summary_state()
1107 if (ctx != sc->cur_chan) in ath9k_calculate_summary_state()
1111 if (ctx == &sc->offchannel.chan) in ath9k_calculate_summary_state()
1112 return ath9k_set_offchannel_state(sc); in ath9k_calculate_summary_state()
1115 ath9k_ps_wakeup(sc); in ath9k_calculate_summary_state()
1116 ath9k_calculate_iter_data(sc, ctx, &iter_data); in ath9k_calculate_summary_state()
1130 ath9k_beacon_ensure_primary_slot(sc); in ath9k_calculate_summary_state()
1161 ath9k_set_assoc_state(sc, iter_data.primary_sta, in ath9k_calculate_summary_state()
1168 ath9k_hw_write_associd(sc->sc_ah); in ath9k_calculate_summary_state()
1169 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in ath9k_calculate_summary_state()
1170 ath9k_mci_update_wlan_channels(sc, true); in ath9k_calculate_summary_state()
1173 sc->nbcnvifs = iter_data.nbcnvifs; in ath9k_calculate_summary_state()
1174 ath9k_beacon_config(sc, iter_data.primary_beacon_vif, in ath9k_calculate_summary_state()
1192 ath9k_ps_restore(sc); in ath9k_calculate_summary_state()
1204 void ath9k_set_txpower(struct ath_softc *sc, struct ieee80211_vif *vif) in ath9k_set_txpower() argument
1207 struct ath_hw *ah = sc->sc_ah; in ath9k_set_txpower()
1210 ath9k_ps_wakeup(sc); in ath9k_set_txpower()
1214 sc->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in ath9k_set_txpower()
1217 power = sc->hw->conf.power_level; in ath9k_set_txpower()
1219 power = sc->hw->conf.power_level; in ath9k_set_txpower()
1221 sc->cur_chan->txpower = 2 * power; in ath9k_set_txpower()
1222 ath9k_hw_set_txpowerlimit(ah, sc->cur_chan->txpower, false); in ath9k_set_txpower()
1223 sc->cur_chan->cur_txpower = reg->max_power_level; in ath9k_set_txpower()
1224 ath9k_ps_restore(sc); in ath9k_set_txpower()
1248 struct ath_softc *sc = hw->priv; in ath9k_add_interface() local
1249 struct ath_hw *ah = sc->sc_ah; in ath9k_add_interface()
1254 mutex_lock(&sc->mutex); in ath9k_add_interface()
1257 if (sc->cur_chan->nvifs >= 1) { in ath9k_add_interface()
1258 mutex_unlock(&sc->mutex); in ath9k_add_interface()
1261 sc->tx99_vif = vif; in ath9k_add_interface()
1265 sc->cur_chan->nvifs++; in ath9k_add_interface()
1271 ath9k_beacon_assign_slot(sc, vif); in ath9k_add_interface()
1275 avp->chanctx = sc->cur_chan; in ath9k_add_interface()
1279 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_add_interface()
1283 ath9k_set_txpower(sc, vif); in ath9k_add_interface()
1285 an->sc = sc; in ath9k_add_interface()
1289 ath_tx_node_init(sc, an); in ath9k_add_interface()
1291 mutex_unlock(&sc->mutex); in ath9k_add_interface()
1300 struct ath_softc *sc = hw->priv; in ath9k_change_interface() local
1301 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_change_interface()
1304 mutex_lock(&sc->mutex); in ath9k_change_interface()
1307 mutex_unlock(&sc->mutex); in ath9k_change_interface()
1314 ath9k_beacon_remove_slot(sc, vif); in ath9k_change_interface()
1320 ath9k_beacon_assign_slot(sc, vif); in ath9k_change_interface()
1323 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_change_interface()
1325 ath9k_set_txpower(sc, vif); in ath9k_change_interface()
1327 mutex_unlock(&sc->mutex); in ath9k_change_interface()
1334 struct ath_softc *sc = hw->priv; in ath9k_remove_interface() local
1335 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remove_interface()
1340 mutex_lock(&sc->mutex); in ath9k_remove_interface()
1342 ath9k_p2p_remove_vif(sc, vif); in ath9k_remove_interface()
1344 sc->cur_chan->nvifs--; in ath9k_remove_interface()
1345 sc->tx99_vif = NULL; in ath9k_remove_interface()
1350 ath9k_beacon_remove_slot(sc, vif); in ath9k_remove_interface()
1352 ath_tx_node_cleanup(sc, &avp->mcast_node); in ath9k_remove_interface()
1354 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_remove_interface()
1356 ath9k_set_txpower(sc, NULL); in ath9k_remove_interface()
1358 mutex_unlock(&sc->mutex); in ath9k_remove_interface()
1361 static void ath9k_enable_ps(struct ath_softc *sc) in ath9k_enable_ps() argument
1363 struct ath_hw *ah = sc->sc_ah; in ath9k_enable_ps()
1369 sc->ps_enabled = true; in ath9k_enable_ps()
1380 static void ath9k_disable_ps(struct ath_softc *sc) in ath9k_disable_ps() argument
1382 struct ath_hw *ah = sc->sc_ah; in ath9k_disable_ps()
1388 sc->ps_enabled = false; in ath9k_disable_ps()
1392 sc->ps_flags &= ~(PS_WAIT_FOR_BEACON | in ath9k_disable_ps()
1406 struct ath_softc *sc = hw->priv; in ath9k_config() local
1407 struct ath_hw *ah = sc->sc_ah; in ath9k_config()
1410 struct ath_chanctx *ctx = sc->cur_chan; in ath9k_config()
1412 ath9k_ps_wakeup(sc); in ath9k_config()
1413 mutex_lock(&sc->mutex); in ath9k_config()
1416 sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); in ath9k_config()
1417 if (sc->ps_idle) { in ath9k_config()
1418 ath_cancel_work(sc); in ath9k_config()
1419 ath9k_stop_btcoex(sc); in ath9k_config()
1421 ath9k_start_btcoex(sc); in ath9k_config()
1426 ath_chanctx_set_channel(sc, ctx, &ctx->chandef); in ath9k_config()
1438 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_config()
1440 ath9k_enable_ps(sc); in ath9k_config()
1442 ath9k_disable_ps(sc); in ath9k_config()
1443 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_config()
1449 sc->sc_ah->is_monitoring = true; in ath9k_config()
1452 sc->sc_ah->is_monitoring = false; in ath9k_config()
1458 ath_chanctx_set_channel(sc, ctx, &hw->conf.chandef); in ath9k_config()
1461 mutex_unlock(&sc->mutex); in ath9k_config()
1462 ath9k_ps_restore(sc); in ath9k_config()
1482 struct ath_softc *sc = hw->priv; in ath9k_configure_filter() local
1489 spin_lock_bh(&sc->chan_lock); in ath9k_configure_filter()
1490 ath_for_each_chanctx(sc, ctx) in ath9k_configure_filter()
1493 sc->offchannel.chan.rxfilter = *total_flags; in ath9k_configure_filter()
1495 spin_unlock_bh(&sc->chan_lock); in ath9k_configure_filter()
1497 ath9k_ps_wakeup(sc); in ath9k_configure_filter()
1498 rfilt = ath_calcrxfilter(sc); in ath9k_configure_filter()
1499 ath9k_hw_setrxfilter(sc->sc_ah, rfilt); in ath9k_configure_filter()
1500 ath9k_ps_restore(sc); in ath9k_configure_filter()
1502 ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG, "Set HW RX filter: 0x%x\n", in ath9k_configure_filter()
1510 struct ath_softc *sc = hw->priv; in ath9k_sta_add() local
1511 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sta_add()
1516 ath_node_attach(sc, sta, vif); in ath9k_sta_add()
1531 static void ath9k_del_ps_key(struct ath_softc *sc, in ath9k_del_ps_key() argument
1535 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_del_ps_key()
1551 struct ath_softc *sc = hw->priv; in ath9k_sta_remove() local
1553 ath9k_del_ps_key(sc, vif, sta); in ath9k_sta_remove()
1554 ath_node_detach(sc, sta); in ath9k_sta_remove()
1565 struct ath_softc *sc = hw->priv; in ath9k_sta_state() local
1566 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sta_state()
1585 ath_chanctx_event(sc, vif, in ath9k_sta_state()
1611 struct ath_softc *sc = hw->priv; in ath9k_sta_notify() local
1617 ath_tx_aggr_sleep(sta, sc, an); in ath9k_sta_notify()
1618 ath9k_sta_set_tx_filter(sc->sc_ah, an, true); in ath9k_sta_notify()
1621 ath9k_sta_set_tx_filter(sc->sc_ah, an, false); in ath9k_sta_notify()
1623 ath_tx_aggr_wakeup(sc, an); in ath9k_sta_notify()
1632 struct ath_softc *sc = hw->priv; in ath9k_conf_tx() local
1633 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_conf_tx()
1641 txq = sc->tx.txq_map[queue]; in ath9k_conf_tx()
1643 ath9k_ps_wakeup(sc); in ath9k_conf_tx()
1644 mutex_lock(&sc->mutex); in ath9k_conf_tx()
1658 ath_update_max_aggr_framelen(sc, queue, qi.tqi_burstTime); in ath9k_conf_tx()
1659 ret = ath_txq_update(sc, txq->axq_qnum, &qi); in ath9k_conf_tx()
1663 mutex_unlock(&sc->mutex); in ath9k_conf_tx()
1664 ath9k_ps_restore(sc); in ath9k_conf_tx()
1675 struct ath_softc *sc = hw->priv; in ath9k_set_key() local
1676 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_set_key()
1698 mutex_lock(&sc->mutex); in ath9k_set_key()
1699 ath9k_ps_wakeup(sc); in ath9k_set_key()
1707 ath9k_del_ps_key(sc, vif, sta); in ath9k_set_key()
1717 if (sc->sc_ah->sw_mgmt_crypto_tx && in ath9k_set_key()
1748 ath9k_ps_restore(sc); in ath9k_set_key()
1749 mutex_unlock(&sc->mutex); in ath9k_set_key()
1764 struct ath_softc *sc = hw->priv; in ath9k_bss_info_changed() local
1765 struct ath_hw *ah = sc->sc_ah; in ath9k_bss_info_changed()
1770 ath9k_ps_wakeup(sc); in ath9k_bss_info_changed()
1771 mutex_lock(&sc->mutex); in ath9k_bss_info_changed()
1781 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_bss_info_changed()
1788 ath9k_hw_write_associd(sc->sc_ah); in ath9k_bss_info_changed()
1794 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_bss_info_changed()
1797 if ((avp->chanctx == sc->cur_chan) && in ath9k_bss_info_changed()
1810 sc->beacon.slottime = slottime; in ath9k_bss_info_changed()
1811 sc->beacon.updateslot = UPDATE; in ath9k_bss_info_changed()
1819 ath9k_p2p_bss_info_changed(sc, vif); in ath9k_bss_info_changed()
1822 ath_check_ani(sc); in ath9k_bss_info_changed()
1827 ath9k_set_txpower(sc, vif); in ath9k_bss_info_changed()
1830 mutex_unlock(&sc->mutex); in ath9k_bss_info_changed()
1831 ath9k_ps_restore(sc); in ath9k_bss_info_changed()
1838 struct ath_softc *sc = hw->priv; in ath9k_get_tsf() local
1842 mutex_lock(&sc->mutex); in ath9k_get_tsf()
1843 ath9k_ps_wakeup(sc); in ath9k_get_tsf()
1845 if (sc->cur_chan == avp->chanctx) { in ath9k_get_tsf()
1846 tsf = ath9k_hw_gettsf64(sc->sc_ah); in ath9k_get_tsf()
1848 tsf = sc->cur_chan->tsf_val + in ath9k_get_tsf()
1849 ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL); in ath9k_get_tsf()
1852 ath9k_ps_restore(sc); in ath9k_get_tsf()
1853 mutex_unlock(&sc->mutex); in ath9k_get_tsf()
1862 struct ath_softc *sc = hw->priv; in ath9k_set_tsf() local
1865 mutex_lock(&sc->mutex); in ath9k_set_tsf()
1866 ath9k_ps_wakeup(sc); in ath9k_set_tsf()
1869 if (sc->cur_chan == avp->chanctx) in ath9k_set_tsf()
1870 ath9k_hw_settsf64(sc->sc_ah, tsf); in ath9k_set_tsf()
1872 ath9k_ps_restore(sc); in ath9k_set_tsf()
1873 mutex_unlock(&sc->mutex); in ath9k_set_tsf()
1878 struct ath_softc *sc = hw->priv; in ath9k_reset_tsf() local
1881 mutex_lock(&sc->mutex); in ath9k_reset_tsf()
1883 ath9k_ps_wakeup(sc); in ath9k_reset_tsf()
1885 if (sc->cur_chan == avp->chanctx) in ath9k_reset_tsf()
1886 ath9k_hw_reset_tsf(sc->sc_ah); in ath9k_reset_tsf()
1888 ath9k_ps_restore(sc); in ath9k_reset_tsf()
1890 mutex_unlock(&sc->mutex); in ath9k_reset_tsf()
1897 struct ath_softc *sc = hw->priv; in ath9k_ampdu_action() local
1898 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ampdu_action()
1908 mutex_lock(&sc->mutex); in ath9k_ampdu_action()
1922 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
1923 ret = ath_tx_aggr_start(sc, sta, tid, ssn); in ath9k_ampdu_action()
1926 ath9k_ps_restore(sc); in ath9k_ampdu_action()
1933 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
1934 ath_tx_aggr_stop(sc, sta, tid); in ath9k_ampdu_action()
1937 ath9k_ps_restore(sc); in ath9k_ampdu_action()
1945 ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n"); in ath9k_ampdu_action()
1948 mutex_unlock(&sc->mutex); in ath9k_ampdu_action()
1956 struct ath_softc *sc = hw->priv; in ath9k_get_survey() local
1957 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_get_survey()
1968 ath_update_survey_stats(sc); in ath9k_get_survey()
1986 memcpy(survey, &sc->survey[pos], sizeof(*survey)); in ath9k_get_survey()
1993 static void ath9k_enable_dynack(struct ath_softc *sc) in ath9k_enable_dynack() argument
1997 struct ath_hw *ah = sc->sc_ah; in ath9k_enable_dynack()
2002 rfilt = ath_calcrxfilter(sc); in ath9k_enable_dynack()
2010 struct ath_softc *sc = hw->priv; in ath9k_set_coverage_class() local
2011 struct ath_hw *ah = sc->sc_ah; in ath9k_set_coverage_class()
2016 mutex_lock(&sc->mutex); in ath9k_set_coverage_class()
2024 rfilt = ath_calcrxfilter(sc); in ath9k_set_coverage_class()
2027 ath9k_ps_wakeup(sc); in ath9k_set_coverage_class()
2029 ath9k_ps_restore(sc); in ath9k_set_coverage_class()
2031 ath9k_enable_dynack(sc); in ath9k_set_coverage_class()
2034 mutex_unlock(&sc->mutex); in ath9k_set_coverage_class()
2037 static bool ath9k_has_tx_pending(struct ath_softc *sc, in ath9k_has_tx_pending() argument
2043 if (!ATH_TXQ_SETUP(sc, i)) in ath9k_has_tx_pending()
2046 npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i], in ath9k_has_tx_pending()
2058 struct ath_softc *sc = hw->priv; in ath9k_flush() local
2059 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_flush()
2079 mutex_lock(&sc->mutex); in ath9k_flush()
2081 mutex_unlock(&sc->mutex); in ath9k_flush()
2087 struct ath_softc *sc = hw->priv; in __ath9k_flush() local
2088 struct ath_hw *ah = sc->sc_ah; in __ath9k_flush()
2093 cancel_delayed_work_sync(&sc->hw_check_work); in __ath9k_flush()
2105 spin_lock_bh(&sc->chan_lock); in __ath9k_flush()
2109 timeout = sc->cur_chan->flush_timeout; in __ath9k_flush()
2110 spin_unlock_bh(&sc->chan_lock); in __ath9k_flush()
2115 if (wait_event_timeout(sc->tx_wait, !ath9k_has_tx_pending(sc, sw_pending), in __ath9k_flush()
2120 ath9k_ps_wakeup(sc); in __ath9k_flush()
2121 spin_lock_bh(&sc->sc_pcu_lock); in __ath9k_flush()
2122 drain_txq = ath_drain_all_txq(sc); in __ath9k_flush()
2123 spin_unlock_bh(&sc->sc_pcu_lock); in __ath9k_flush()
2126 ath_reset(sc, NULL); in __ath9k_flush()
2128 ath9k_ps_restore(sc); in __ath9k_flush()
2131 ieee80211_queue_delayed_work(hw, &sc->hw_check_work, in __ath9k_flush()
2137 struct ath_softc *sc = hw->priv; in ath9k_tx_frames_pending() local
2139 return ath9k_has_tx_pending(sc, true); in ath9k_tx_frames_pending()
2144 struct ath_softc *sc = hw->priv; in ath9k_tx_last_beacon() local
2145 struct ath_hw *ah = sc->sc_ah; in ath9k_tx_last_beacon()
2153 vif = sc->beacon.bslot[0]; in ath9k_tx_last_beacon()
2162 if (!sc->beacon.tx_processed && !edma) { in ath9k_tx_last_beacon()
2163 tasklet_disable(&sc->bcon_tasklet); in ath9k_tx_last_beacon()
2173 sc->beacon.tx_processed = true; in ath9k_tx_last_beacon()
2174 sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); in ath9k_tx_last_beacon()
2177 tasklet_enable(&sc->bcon_tasklet); in ath9k_tx_last_beacon()
2180 return sc->beacon.tx_last; in ath9k_tx_last_beacon()
2186 struct ath_softc *sc = hw->priv; in ath9k_get_stats() local
2187 struct ath_hw *ah = sc->sc_ah; in ath9k_get_stats()
2234 struct ath_softc *sc = hw->priv; in ath9k_set_antenna() local
2235 struct ath_hw *ah = sc->sc_ah; in ath9k_set_antenna()
2243 sc->ant_rx = rx_ant; in ath9k_set_antenna()
2244 sc->ant_tx = tx_ant; in ath9k_set_antenna()
2263 struct ath_softc *sc = hw->priv; in ath9k_get_antenna() local
2265 *tx_ant = sc->ant_tx; in ath9k_get_antenna()
2266 *rx_ant = sc->ant_rx; in ath9k_get_antenna()
2274 struct ath_softc *sc = hw->priv; in ath9k_sw_scan_start() local
2275 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sw_scan_start()
2282 struct ath_softc *sc = hw->priv; in ath9k_sw_scan_complete() local
2283 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sw_scan_complete()
2289 static void ath9k_cancel_pending_offchannel(struct ath_softc *sc) in ath9k_cancel_pending_offchannel() argument
2291 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_pending_offchannel()
2293 if (sc->offchannel.roc_vif) { in ath9k_cancel_pending_offchannel()
2297 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_pending_offchannel()
2298 if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START) in ath9k_cancel_pending_offchannel()
2299 ath_roc_complete(sc, ATH_ROC_COMPLETE_ABORT); in ath9k_cancel_pending_offchannel()
2306 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_pending_offchannel()
2307 ath_scan_complete(sc, true); in ath9k_cancel_pending_offchannel()
2315 struct ath_softc *sc = hw->priv; in ath9k_hw_scan() local
2316 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_hw_scan()
2319 mutex_lock(&sc->mutex); in ath9k_hw_scan()
2321 if (WARN_ON(sc->offchannel.scan_req)) { in ath9k_hw_scan()
2326 ath9k_ps_wakeup(sc); in ath9k_hw_scan()
2328 sc->offchannel.scan_vif = vif; in ath9k_hw_scan()
2329 sc->offchannel.scan_req = req; in ath9k_hw_scan()
2330 sc->offchannel.scan_idx = 0; in ath9k_hw_scan()
2335 if (sc->offchannel.state == ATH_OFFCHANNEL_IDLE) { in ath9k_hw_scan()
2337 ath_offchannel_next(sc); in ath9k_hw_scan()
2341 mutex_unlock(&sc->mutex); in ath9k_hw_scan()
2349 struct ath_softc *sc = hw->priv; in ath9k_cancel_hw_scan() local
2350 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_hw_scan()
2354 mutex_lock(&sc->mutex); in ath9k_cancel_hw_scan()
2355 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_hw_scan()
2356 ath_scan_complete(sc, true); in ath9k_cancel_hw_scan()
2357 mutex_unlock(&sc->mutex); in ath9k_cancel_hw_scan()
2365 struct ath_softc *sc = hw->priv; in ath9k_remain_on_channel() local
2366 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remain_on_channel()
2369 mutex_lock(&sc->mutex); in ath9k_remain_on_channel()
2371 if (WARN_ON(sc->offchannel.roc_vif)) { in ath9k_remain_on_channel()
2376 ath9k_ps_wakeup(sc); in ath9k_remain_on_channel()
2377 sc->offchannel.roc_vif = vif; in ath9k_remain_on_channel()
2378 sc->offchannel.roc_chan = chan; in ath9k_remain_on_channel()
2379 sc->offchannel.roc_duration = duration; in ath9k_remain_on_channel()
2385 if (sc->offchannel.state == ATH_OFFCHANNEL_IDLE) { in ath9k_remain_on_channel()
2387 ath_offchannel_next(sc); in ath9k_remain_on_channel()
2391 mutex_unlock(&sc->mutex); in ath9k_remain_on_channel()
2398 struct ath_softc *sc = hw->priv; in ath9k_cancel_remain_on_channel() local
2399 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_remain_on_channel()
2401 mutex_lock(&sc->mutex); in ath9k_cancel_remain_on_channel()
2404 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_remain_on_channel()
2406 if (sc->offchannel.roc_vif) { in ath9k_cancel_remain_on_channel()
2407 if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START) in ath9k_cancel_remain_on_channel()
2408 ath_roc_complete(sc, ATH_ROC_COMPLETE_CANCEL); in ath9k_cancel_remain_on_channel()
2411 mutex_unlock(&sc->mutex); in ath9k_cancel_remain_on_channel()
2419 struct ath_softc *sc = hw->priv; in ath9k_add_chanctx() local
2420 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_add_chanctx()
2424 mutex_lock(&sc->mutex); in ath9k_add_chanctx()
2426 ath_for_each_chanctx(sc, ctx) { in ath9k_add_chanctx()
2433 pos = ctx - &sc->chanctx[0]; in ath9k_add_chanctx()
2440 ath_chanctx_set_channel(sc, ctx, &conf->def); in ath9k_add_chanctx()
2442 mutex_unlock(&sc->mutex); in ath9k_add_chanctx()
2446 mutex_unlock(&sc->mutex); in ath9k_add_chanctx()
2454 struct ath_softc *sc = hw->priv; in ath9k_remove_chanctx() local
2455 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remove_chanctx()
2458 mutex_lock(&sc->mutex); in ath9k_remove_chanctx()
2466 ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_UNASSIGN); in ath9k_remove_chanctx()
2468 mutex_unlock(&sc->mutex); in ath9k_remove_chanctx()
2475 struct ath_softc *sc = hw->priv; in ath9k_change_chanctx() local
2476 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_change_chanctx()
2479 mutex_lock(&sc->mutex); in ath9k_change_chanctx()
2483 ath_chanctx_set_channel(sc, ctx, &conf->def); in ath9k_change_chanctx()
2484 mutex_unlock(&sc->mutex); in ath9k_change_chanctx()
2491 struct ath_softc *sc = hw->priv; in ath9k_assign_vif_chanctx() local
2492 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_assign_vif_chanctx()
2497 ath9k_cancel_pending_offchannel(sc); in ath9k_assign_vif_chanctx()
2499 mutex_lock(&sc->mutex); in ath9k_assign_vif_chanctx()
2509 ath9k_calculate_summary_state(sc, ctx); in ath9k_assign_vif_chanctx()
2513 mutex_unlock(&sc->mutex); in ath9k_assign_vif_chanctx()
2522 struct ath_softc *sc = hw->priv; in ath9k_unassign_vif_chanctx() local
2523 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_unassign_vif_chanctx()
2528 ath9k_cancel_pending_offchannel(sc); in ath9k_unassign_vif_chanctx()
2530 mutex_lock(&sc->mutex); in ath9k_unassign_vif_chanctx()
2540 ath9k_calculate_summary_state(sc, ctx); in ath9k_unassign_vif_chanctx()
2544 mutex_unlock(&sc->mutex); in ath9k_unassign_vif_chanctx()
2551 struct ath_softc *sc = hw->priv; in ath9k_mgd_prepare_tx() local
2552 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_mgd_prepare_tx()
2566 mutex_lock(&sc->mutex); in ath9k_mgd_prepare_tx()
2568 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2569 if (sc->next_chan || (sc->cur_chan != avp->chanctx)) in ath9k_mgd_prepare_tx()
2571 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2576 ath9k_cancel_pending_offchannel(sc); in ath9k_mgd_prepare_tx()
2578 go_ctx = ath_is_go_chanctx_present(sc); in ath9k_mgd_prepare_tx()
2585 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2586 sc->sched.mgd_prepare_tx = true; in ath9k_mgd_prepare_tx()
2589 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2592 init_completion(&sc->go_beacon); in ath9k_mgd_prepare_tx()
2594 mutex_unlock(&sc->mutex); in ath9k_mgd_prepare_tx()
2596 if (wait_for_completion_timeout(&sc->go_beacon, in ath9k_mgd_prepare_tx()
2601 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2602 sc->sched.mgd_prepare_tx = false; in ath9k_mgd_prepare_tx()
2603 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2606 mutex_lock(&sc->mutex); in ath9k_mgd_prepare_tx()
2613 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2614 sc->next_chan = avp->chanctx; in ath9k_mgd_prepare_tx()
2615 sc->sched.state = ATH_CHANCTX_STATE_FORCE_ACTIVE; in ath9k_mgd_prepare_tx()
2616 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2618 ath_chanctx_set_next(sc, true); in ath9k_mgd_prepare_tx()
2620 mutex_unlock(&sc->mutex); in ath9k_mgd_prepare_tx()
2645 struct ath_softc *sc = hw->priv; in ath9k_get_txpower() local
2648 mutex_lock(&sc->mutex); in ath9k_get_txpower()
2652 *dbm = sc->cur_chan->cur_txpower; in ath9k_get_txpower()
2653 mutex_unlock(&sc->mutex); in ath9k_get_txpower()