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 list = &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 = (struct ath_softc *) data; in ath_ps_full_sleep() local
99 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_ps_full_sleep()
106 ath9k_hw_setrxabort(sc->sc_ah, 1); in ath_ps_full_sleep()
107 ath9k_hw_stopdmarecv(sc->sc_ah, &reset); in ath_ps_full_sleep()
109 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); in ath_ps_full_sleep()
112 void ath9k_ps_wakeup(struct ath_softc *sc) in ath9k_ps_wakeup() argument
114 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ps_wakeup()
118 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_ps_wakeup()
119 if (++sc->ps_usecount != 1) in ath9k_ps_wakeup()
122 del_timer_sync(&sc->sleep_timer); in ath9k_ps_wakeup()
123 power_mode = sc->sc_ah->power_mode; in ath9k_ps_wakeup()
124 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); in ath9k_ps_wakeup()
140 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_ps_wakeup()
143 void ath9k_ps_restore(struct ath_softc *sc) in ath9k_ps_restore() argument
145 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ps_restore()
149 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_ps_restore()
150 if (--sc->ps_usecount != 0) in ath9k_ps_restore()
153 if (sc->ps_idle) { in ath9k_ps_restore()
154 mod_timer(&sc->sleep_timer, jiffies + HZ / 10); in ath9k_ps_restore()
158 if (sc->ps_enabled && in ath9k_ps_restore()
159 !(sc->ps_flags & (PS_WAIT_FOR_BEACON | in ath9k_ps_restore()
165 if (ath9k_hw_btcoex_is_enabled(sc->sc_ah)) in ath9k_ps_restore()
166 ath9k_btcoex_stop_gen_timer(sc); in ath9k_ps_restore()
175 ath9k_hw_setpower(sc->sc_ah, mode); in ath9k_ps_restore()
178 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_ps_restore()
181 static void __ath_cancel_work(struct ath_softc *sc) in __ath_cancel_work() argument
183 cancel_work_sync(&sc->paprd_work); in __ath_cancel_work()
184 cancel_delayed_work_sync(&sc->tx_complete_work); in __ath_cancel_work()
185 cancel_delayed_work_sync(&sc->hw_pll_work); in __ath_cancel_work()
188 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in __ath_cancel_work()
189 cancel_work_sync(&sc->mci_work); in __ath_cancel_work()
193 void ath_cancel_work(struct ath_softc *sc) in ath_cancel_work() argument
195 __ath_cancel_work(sc); in ath_cancel_work()
196 cancel_work_sync(&sc->hw_reset_work); in ath_cancel_work()
199 void ath_restart_work(struct ath_softc *sc) in ath_restart_work() argument
201 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); in ath_restart_work()
203 if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9330(sc->sc_ah)) in ath_restart_work()
204 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, in ath_restart_work()
207 ath_start_ani(sc); in ath_restart_work()
210 static bool ath_prepare_reset(struct ath_softc *sc) in ath_prepare_reset() argument
212 struct ath_hw *ah = sc->sc_ah; in ath_prepare_reset()
215 ieee80211_stop_queues(sc->hw); in ath_prepare_reset()
216 ath_stop_ani(sc); in ath_prepare_reset()
220 ret &= ath_stoprecv(sc); in ath_prepare_reset()
221 ret &= ath_drain_all_txq(sc); in ath_prepare_reset()
223 ret &= ath_drain_all_txq(sc); in ath_prepare_reset()
224 ret &= ath_stoprecv(sc); in ath_prepare_reset()
230 static bool ath_complete_reset(struct ath_softc *sc, bool start) in ath_complete_reset() argument
232 struct ath_hw *ah = sc->sc_ah; in ath_complete_reset()
236 ath9k_calculate_summary_state(sc, sc->cur_chan); in ath_complete_reset()
237 ath_startrecv(sc); in ath_complete_reset()
238 ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower, in ath_complete_reset()
239 sc->cur_chan->txpower, in ath_complete_reset()
240 &sc->cur_chan->cur_txpower); in ath_complete_reset()
243 if (!sc->cur_chan->offchannel && start) { in ath_complete_reset()
245 if (sc->cur_chan->tsf_val) { in ath_complete_reset()
248 offset = ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, in ath_complete_reset()
250 ath9k_hw_settsf64(ah, sc->cur_chan->tsf_val + offset); in ath_complete_reset()
259 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_complete_reset()
260 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; in ath_complete_reset()
261 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_complete_reset()
263 ath9k_set_beacon(sc); in ath_complete_reset()
266 ath_restart_work(sc); in ath_complete_reset()
267 ath_txq_schedule_all(sc); in ath_complete_reset()
270 sc->gtt_cnt = 0; in ath_complete_reset()
274 ieee80211_wake_queues(sc->hw); in ath_complete_reset()
275 ath9k_p2p_ps_timer(sc); in ath_complete_reset()
280 static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan) in ath_reset_internal() argument
282 struct ath_hw *ah = sc->sc_ah; in ath_reset_internal()
288 __ath_cancel_work(sc); in ath_reset_internal()
290 disable_irq(sc->irq); in ath_reset_internal()
291 tasklet_disable(&sc->intr_tq); in ath_reset_internal()
292 tasklet_disable(&sc->bcon_tasklet); in ath_reset_internal()
293 spin_lock_bh(&sc->sc_pcu_lock); in ath_reset_internal()
295 if (!sc->cur_chan->offchannel) { in ath_reset_internal()
297 caldata = &sc->cur_chan->caldata; in ath_reset_internal()
305 if (!ath_prepare_reset(sc)) in ath_reset_internal()
311 spin_lock_bh(&sc->chan_lock); in ath_reset_internal()
312 sc->cur_chandef = sc->cur_chan->chandef; in ath_reset_internal()
313 spin_unlock_bh(&sc->chan_lock); in ath_reset_internal()
324 ath9k_queue_reset(sc, RESET_TYPE_BB_HANG); in ath_reset_internal()
329 if (ath9k_hw_mci_is_enabled(sc->sc_ah) && in ath_reset_internal()
330 sc->cur_chan->offchannel) in ath_reset_internal()
331 ath9k_mci_set_txpower(sc, true, false); in ath_reset_internal()
333 if (!ath_complete_reset(sc, true)) in ath_reset_internal()
337 enable_irq(sc->irq); in ath_reset_internal()
338 spin_unlock_bh(&sc->sc_pcu_lock); in ath_reset_internal()
339 tasklet_enable(&sc->bcon_tasklet); in ath_reset_internal()
340 tasklet_enable(&sc->intr_tq); in ath_reset_internal()
345 static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, in ath_node_attach() argument
351 an->sc = sc; in ath_node_attach()
356 ath_tx_node_init(sc, an); in ath_node_attach()
358 ath_dynack_node_init(sc->sc_ah, an); in ath_node_attach()
361 static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) in ath_node_detach() argument
364 ath_tx_node_cleanup(sc, an); in ath_node_detach()
366 ath_dynack_node_deinit(sc->sc_ah, an); in ath_node_detach()
371 struct ath_softc *sc = (struct ath_softc *)data; in ath9k_tasklet() local
372 struct ath_hw *ah = sc->sc_ah; in ath9k_tasklet()
376 u32 status = sc->intrstatus; in ath9k_tasklet()
379 ath9k_ps_wakeup(sc); in ath9k_tasklet()
380 spin_lock(&sc->sc_pcu_lock); in ath9k_tasklet()
384 ath9k_queue_reset(sc, type); in ath9k_tasklet()
404 ath9k_queue_reset(sc, type); in ath9k_tasklet()
418 sc->gtt_cnt++; in ath9k_tasklet()
420 if ((sc->gtt_cnt >= MAX_GTT_CNT) && !ath9k_hw_check_alive(ah)) { in ath9k_tasklet()
422 ath9k_queue_reset(sc, type); in ath9k_tasklet()
430 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_tasklet()
431 if ((status & ATH9K_INT_TSFOOR) && sc->ps_enabled) { in ath9k_tasklet()
437 sc->ps_flags |= PS_WAIT_FOR_BEACON | PS_BEACON_SYNC; in ath9k_tasklet()
439 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_tasklet()
451 ath_rx_tasklet(sc, 0, true); in ath9k_tasklet()
453 ath_rx_tasklet(sc, 0, false); in ath9k_tasklet()
464 sc->gtt_cnt = 0; in ath9k_tasklet()
466 ath_tx_edma_tasklet(sc); in ath9k_tasklet()
468 ath_tx_tasklet(sc); in ath9k_tasklet()
471 wake_up(&sc->tx_wait); in ath9k_tasklet()
475 ath_gen_timer_isr(sc->sc_ah); in ath9k_tasklet()
477 ath9k_btcoex_handle_interrupt(sc, status); in ath9k_tasklet()
482 spin_unlock(&sc->sc_pcu_lock); in ath9k_tasklet()
483 ath9k_ps_restore(sc); in ath9k_tasklet()
504 struct ath_softc *sc = dev; in ath_isr() local
505 struct ath_hw *ah = sc->sc_ah; in ath_isr()
530 ath9k_debug_sync_cause(sc, sync_cause); in ath_isr()
544 sc->intrstatus = status; in ath_isr()
561 tasklet_schedule(&sc->bcon_tasklet); in ath_isr()
573 if (ATH_DBG_WARN_ON_ONCE(sc->ps_idle)) in ath_isr()
577 ath9k_setpower(sc, ATH9K_PM_AWAKE); in ath_isr()
578 spin_lock(&sc->sc_pm_lock); in ath_isr()
579 ath9k_hw_setrxabort(sc->sc_ah, 0); in ath_isr()
580 sc->ps_flags |= PS_WAIT_FOR_BEACON; in ath_isr()
581 spin_unlock(&sc->sc_pm_lock); in ath_isr()
586 ath_debug_stat_interrupt(sc, status); in ath_isr()
591 tasklet_schedule(&sc->intr_tq); in ath_isr()
603 int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan) in ath_reset() argument
605 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_reset()
608 ath9k_hw_kill_interrupts(sc->sc_ah); in ath_reset()
611 ath9k_ps_wakeup(sc); in ath_reset()
612 r = ath_reset_internal(sc, hchan); in ath_reset()
613 ath9k_ps_restore(sc); in ath_reset()
623 void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type) in ath9k_queue_reset() argument
625 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_queue_reset()
627 RESET_STAT_INC(sc, type); in ath9k_queue_reset()
629 ath9k_hw_kill_interrupts(sc->sc_ah); in ath9k_queue_reset()
631 ieee80211_queue_work(sc->hw, &sc->hw_reset_work); in ath9k_queue_reset()
636 struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work); in ath_reset_work() local
638 ath9k_ps_wakeup(sc); in ath_reset_work()
639 ath_reset_internal(sc, NULL); in ath_reset_work()
640 ath9k_ps_restore(sc); in ath_reset_work()
649 struct ath_softc *sc = hw->priv; in ath9k_start() local
650 struct ath_hw *ah = sc->sc_ah; in ath9k_start()
652 struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; in ath9k_start()
653 struct ath_chanctx *ctx = sc->cur_chan; in ath9k_start()
661 ath9k_ps_wakeup(sc); in ath9k_start()
662 mutex_lock(&sc->mutex); in ath9k_start()
665 sc->cur_chandef = hw->conf.chandef; in ath9k_start()
677 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_start()
713 ath_mci_enable(sc); in ath9k_start()
716 sc->sc_ah->is_monitoring = false; in ath9k_start()
718 if (!ath_complete_reset(sc, false)) in ath9k_start()
732 ath9k_cmn_init_crypto(sc->sc_ah); in ath9k_start()
736 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_start()
738 mutex_unlock(&sc->mutex); in ath9k_start()
740 ath9k_ps_restore(sc); in ath9k_start()
749 struct ath_softc *sc = hw->priv; in ath9k_tx() local
750 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_tx()
755 if (sc->ps_enabled) { in ath9k_tx()
769 if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP)) { in ath9k_tx()
775 ath9k_ps_wakeup(sc); in ath9k_tx()
776 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_tx()
777 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) in ath9k_tx()
778 ath9k_hw_setrxabort(sc->sc_ah, 0); in ath9k_tx()
782 sc->ps_flags |= PS_WAIT_FOR_PSPOLL_DATA; in ath9k_tx()
785 sc->ps_flags |= PS_WAIT_FOR_TX_ACK; in ath9k_tx()
792 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_tx()
793 ath9k_ps_restore(sc); in ath9k_tx()
800 if (unlikely(sc->sc_ah->power_mode == ATH9K_PM_FULL_SLEEP)) { in ath9k_tx()
806 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)]; in ath9k_tx()
824 struct ath_softc *sc = hw->priv; in ath9k_stop() local
825 struct ath_hw *ah = sc->sc_ah; in ath9k_stop()
829 ath9k_deinit_channel_context(sc); in ath9k_stop()
831 mutex_lock(&sc->mutex); in ath9k_stop()
833 ath_cancel_work(sc); in ath9k_stop()
837 mutex_unlock(&sc->mutex); in ath9k_stop()
842 ath9k_ps_wakeup(sc); in ath9k_stop()
844 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_stop()
853 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_stop()
857 synchronize_irq(sc->irq); in ath9k_stop()
858 tasklet_kill(&sc->intr_tq); in ath9k_stop()
859 tasklet_kill(&sc->bcon_tasklet); in ath9k_stop()
861 prev_idle = sc->ps_idle; in ath9k_stop()
862 sc->ps_idle = true; in ath9k_stop()
864 spin_lock_bh(&sc->sc_pcu_lock); in ath9k_stop()
872 ath_prepare_reset(sc); in ath9k_stop()
874 if (sc->rx.frag) { in ath9k_stop()
875 dev_kfree_skb_any(sc->rx.frag); in ath9k_stop()
876 sc->rx.frag = NULL; in ath9k_stop()
881 &sc->cur_chan->chandef); in ath9k_stop()
891 spin_unlock_bh(&sc->sc_pcu_lock); in ath9k_stop()
893 ath9k_ps_restore(sc); in ath9k_stop()
895 sc->ps_idle = prev_idle; in ath9k_stop()
897 mutex_unlock(&sc->mutex); in ath9k_stop()
962 static void ath9k_update_bssid_mask(struct ath_softc *sc, in ath9k_update_bssid_mask() argument
966 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_update_bssid_mask()
986 sc->hw->wiphy->perm_addr[i]); in ath9k_update_bssid_mask()
991 void ath9k_calculate_iter_data(struct ath_softc *sc, in ath9k_calculate_iter_data() argument
1008 ath9k_update_bssid_mask(sc, ctx, iter_data); in ath9k_calculate_iter_data()
1011 static void ath9k_set_assoc_state(struct ath_softc *sc, in ath9k_set_assoc_state() argument
1014 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_set_assoc_state()
1022 ath9k_hw_write_associd(sc->sc_ah); in ath9k_set_assoc_state()
1026 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; in ath9k_set_assoc_state()
1028 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_set_assoc_state()
1029 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; in ath9k_set_assoc_state()
1030 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_set_assoc_state()
1033 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in ath9k_set_assoc_state()
1034 ath9k_mci_update_wlan_channels(sc, false); in ath9k_set_assoc_state()
1042 static void ath9k_set_offchannel_state(struct ath_softc *sc) in ath9k_set_offchannel_state() argument
1044 struct ath_hw *ah = sc->sc_ah; in ath9k_set_offchannel_state()
1048 ath9k_ps_wakeup(sc); in ath9k_set_offchannel_state()
1050 if (sc->offchannel.state < ATH_OFFCHANNEL_ROC_START) in ath9k_set_offchannel_state()
1051 vif = sc->offchannel.scan_vif; in ath9k_set_offchannel_state()
1053 vif = sc->offchannel.roc_vif; in ath9k_set_offchannel_state()
1069 ath9k_hw_write_associd(sc->sc_ah); in ath9k_set_offchannel_state()
1074 ath9k_ps_restore(sc); in ath9k_set_offchannel_state()
1079 void ath9k_calculate_summary_state(struct ath_softc *sc, in ath9k_calculate_summary_state() argument
1082 struct ath_hw *ah = sc->sc_ah; in ath9k_calculate_summary_state()
1087 ath_chanctx_check_active(sc, ctx); in ath9k_calculate_summary_state()
1089 if (ctx != sc->cur_chan) in ath9k_calculate_summary_state()
1093 if (ctx == &sc->offchannel.chan) in ath9k_calculate_summary_state()
1094 return ath9k_set_offchannel_state(sc); in ath9k_calculate_summary_state()
1097 ath9k_ps_wakeup(sc); in ath9k_calculate_summary_state()
1098 ath9k_calculate_iter_data(sc, ctx, &iter_data); in ath9k_calculate_summary_state()
1144 ath9k_set_assoc_state(sc, iter_data.primary_sta, in ath9k_calculate_summary_state()
1151 ath9k_hw_write_associd(sc->sc_ah); in ath9k_calculate_summary_state()
1152 if (ath9k_hw_mci_is_enabled(sc->sc_ah)) in ath9k_calculate_summary_state()
1153 ath9k_mci_update_wlan_channels(sc, true); in ath9k_calculate_summary_state()
1179 ath9k_ps_restore(sc); in ath9k_calculate_summary_state()
1191 void ath9k_set_txpower(struct ath_softc *sc, struct ieee80211_vif *vif) in ath9k_set_txpower() argument
1194 struct ath_hw *ah = sc->sc_ah; in ath9k_set_txpower()
1197 ath9k_ps_wakeup(sc); in ath9k_set_txpower()
1201 sc->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in ath9k_set_txpower()
1204 power = sc->hw->conf.power_level; in ath9k_set_txpower()
1206 power = sc->hw->conf.power_level; in ath9k_set_txpower()
1208 sc->cur_chan->txpower = 2 * power; in ath9k_set_txpower()
1209 ath9k_hw_set_txpowerlimit(ah, sc->cur_chan->txpower, false); in ath9k_set_txpower()
1210 sc->cur_chan->cur_txpower = reg->max_power_level; in ath9k_set_txpower()
1211 ath9k_ps_restore(sc); in ath9k_set_txpower()
1235 struct ath_softc *sc = hw->priv; in ath9k_add_interface() local
1236 struct ath_hw *ah = sc->sc_ah; in ath9k_add_interface()
1241 mutex_lock(&sc->mutex); in ath9k_add_interface()
1244 if (sc->cur_chan->nvifs >= 1) { in ath9k_add_interface()
1245 mutex_unlock(&sc->mutex); in ath9k_add_interface()
1248 sc->tx99_vif = vif; in ath9k_add_interface()
1252 sc->cur_chan->nvifs++; in ath9k_add_interface()
1255 ath9k_beacon_assign_slot(sc, vif); in ath9k_add_interface()
1259 avp->chanctx = sc->cur_chan; in ath9k_add_interface()
1263 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_add_interface()
1267 ath9k_set_txpower(sc, vif); in ath9k_add_interface()
1269 an->sc = sc; in ath9k_add_interface()
1273 ath_tx_node_init(sc, an); in ath9k_add_interface()
1275 mutex_unlock(&sc->mutex); in ath9k_add_interface()
1284 struct ath_softc *sc = hw->priv; in ath9k_change_interface() local
1285 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_change_interface()
1288 mutex_lock(&sc->mutex); in ath9k_change_interface()
1291 mutex_unlock(&sc->mutex); in ath9k_change_interface()
1298 ath9k_beacon_remove_slot(sc, vif); in ath9k_change_interface()
1304 ath9k_beacon_assign_slot(sc, vif); in ath9k_change_interface()
1307 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_change_interface()
1309 ath9k_set_txpower(sc, vif); in ath9k_change_interface()
1311 mutex_unlock(&sc->mutex); in ath9k_change_interface()
1318 struct ath_softc *sc = hw->priv; in ath9k_remove_interface() local
1319 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remove_interface()
1324 mutex_lock(&sc->mutex); in ath9k_remove_interface()
1326 ath9k_p2p_remove_vif(sc, vif); in ath9k_remove_interface()
1328 sc->cur_chan->nvifs--; in ath9k_remove_interface()
1329 sc->tx99_vif = NULL; in ath9k_remove_interface()
1334 ath9k_beacon_remove_slot(sc, vif); in ath9k_remove_interface()
1336 ath_tx_node_cleanup(sc, &avp->mcast_node); in ath9k_remove_interface()
1338 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_remove_interface()
1340 ath9k_set_txpower(sc, NULL); in ath9k_remove_interface()
1342 mutex_unlock(&sc->mutex); in ath9k_remove_interface()
1345 static void ath9k_enable_ps(struct ath_softc *sc) in ath9k_enable_ps() argument
1347 struct ath_hw *ah = sc->sc_ah; in ath9k_enable_ps()
1353 sc->ps_enabled = true; in ath9k_enable_ps()
1364 static void ath9k_disable_ps(struct ath_softc *sc) in ath9k_disable_ps() argument
1366 struct ath_hw *ah = sc->sc_ah; in ath9k_disable_ps()
1372 sc->ps_enabled = false; in ath9k_disable_ps()
1376 sc->ps_flags &= ~(PS_WAIT_FOR_BEACON | in ath9k_disable_ps()
1390 struct ath_softc *sc = hw->priv; in ath9k_config() local
1391 struct ath_hw *ah = sc->sc_ah; in ath9k_config()
1394 struct ath_chanctx *ctx = sc->cur_chan; in ath9k_config()
1396 ath9k_ps_wakeup(sc); in ath9k_config()
1397 mutex_lock(&sc->mutex); in ath9k_config()
1400 sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); in ath9k_config()
1401 if (sc->ps_idle) { in ath9k_config()
1402 ath_cancel_work(sc); in ath9k_config()
1403 ath9k_stop_btcoex(sc); in ath9k_config()
1405 ath9k_start_btcoex(sc); in ath9k_config()
1410 ath_chanctx_set_channel(sc, ctx, &ctx->chandef); in ath9k_config()
1422 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath9k_config()
1424 ath9k_enable_ps(sc); in ath9k_config()
1426 ath9k_disable_ps(sc); in ath9k_config()
1427 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath9k_config()
1433 sc->sc_ah->is_monitoring = true; in ath9k_config()
1436 sc->sc_ah->is_monitoring = false; in ath9k_config()
1442 ath_chanctx_set_channel(sc, ctx, &hw->conf.chandef); in ath9k_config()
1445 mutex_unlock(&sc->mutex); in ath9k_config()
1446 ath9k_ps_restore(sc); in ath9k_config()
1466 struct ath_softc *sc = hw->priv; in ath9k_configure_filter() local
1473 spin_lock_bh(&sc->chan_lock); in ath9k_configure_filter()
1474 ath_for_each_chanctx(sc, ctx) in ath9k_configure_filter()
1477 sc->offchannel.chan.rxfilter = *total_flags; in ath9k_configure_filter()
1479 spin_unlock_bh(&sc->chan_lock); in ath9k_configure_filter()
1481 ath9k_ps_wakeup(sc); in ath9k_configure_filter()
1482 rfilt = ath_calcrxfilter(sc); in ath9k_configure_filter()
1483 ath9k_hw_setrxfilter(sc->sc_ah, rfilt); in ath9k_configure_filter()
1484 ath9k_ps_restore(sc); in ath9k_configure_filter()
1486 ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG, "Set HW RX filter: 0x%x\n", in ath9k_configure_filter()
1494 struct ath_softc *sc = hw->priv; in ath9k_sta_add() local
1495 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sta_add()
1500 ath_node_attach(sc, sta, vif); in ath9k_sta_add()
1515 static void ath9k_del_ps_key(struct ath_softc *sc, in ath9k_del_ps_key() argument
1519 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_del_ps_key()
1535 struct ath_softc *sc = hw->priv; in ath9k_sta_remove() local
1537 ath9k_del_ps_key(sc, vif, sta); in ath9k_sta_remove()
1538 ath_node_detach(sc, sta); in ath9k_sta_remove()
1549 struct ath_softc *sc = hw->priv; in ath9k_sta_state() local
1550 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sta_state()
1569 ath_chanctx_event(sc, vif, in ath9k_sta_state()
1595 struct ath_softc *sc = hw->priv; in ath9k_sta_notify() local
1601 ath_tx_aggr_sleep(sta, sc, an); in ath9k_sta_notify()
1602 ath9k_sta_set_tx_filter(sc->sc_ah, an, true); in ath9k_sta_notify()
1605 ath9k_sta_set_tx_filter(sc->sc_ah, an, false); in ath9k_sta_notify()
1607 ath_tx_aggr_wakeup(sc, an); in ath9k_sta_notify()
1616 struct ath_softc *sc = hw->priv; in ath9k_conf_tx() local
1617 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_conf_tx()
1625 txq = sc->tx.txq_map[queue]; in ath9k_conf_tx()
1627 ath9k_ps_wakeup(sc); in ath9k_conf_tx()
1628 mutex_lock(&sc->mutex); in ath9k_conf_tx()
1642 ath_update_max_aggr_framelen(sc, queue, qi.tqi_burstTime); in ath9k_conf_tx()
1643 ret = ath_txq_update(sc, txq->axq_qnum, &qi); in ath9k_conf_tx()
1647 mutex_unlock(&sc->mutex); in ath9k_conf_tx()
1648 ath9k_ps_restore(sc); in ath9k_conf_tx()
1659 struct ath_softc *sc = hw->priv; in ath9k_set_key() local
1660 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_set_key()
1682 mutex_lock(&sc->mutex); in ath9k_set_key()
1683 ath9k_ps_wakeup(sc); in ath9k_set_key()
1691 ath9k_del_ps_key(sc, vif, sta); in ath9k_set_key()
1701 if (sc->sc_ah->sw_mgmt_crypto_tx && in ath9k_set_key()
1732 ath9k_ps_restore(sc); in ath9k_set_key()
1733 mutex_unlock(&sc->mutex); in ath9k_set_key()
1748 struct ath_softc *sc = hw->priv; in ath9k_bss_info_changed() local
1749 struct ath_hw *ah = sc->sc_ah; in ath9k_bss_info_changed()
1754 ath9k_ps_wakeup(sc); in ath9k_bss_info_changed()
1755 mutex_lock(&sc->mutex); in ath9k_bss_info_changed()
1765 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_bss_info_changed()
1772 ath9k_hw_write_associd(sc->sc_ah); in ath9k_bss_info_changed()
1778 ath9k_beacon_config(sc, vif, changed); in ath9k_bss_info_changed()
1780 ath9k_calculate_summary_state(sc, avp->chanctx); in ath9k_bss_info_changed()
1783 if ((avp->chanctx == sc->cur_chan) && in ath9k_bss_info_changed()
1795 sc->beacon.slottime = slottime; in ath9k_bss_info_changed()
1796 sc->beacon.updateslot = UPDATE; in ath9k_bss_info_changed()
1804 ath9k_p2p_bss_info_changed(sc, vif); in ath9k_bss_info_changed()
1807 ath_check_ani(sc); in ath9k_bss_info_changed()
1812 ath9k_set_txpower(sc, vif); in ath9k_bss_info_changed()
1815 mutex_unlock(&sc->mutex); in ath9k_bss_info_changed()
1816 ath9k_ps_restore(sc); in ath9k_bss_info_changed()
1823 struct ath_softc *sc = hw->priv; in ath9k_get_tsf() local
1826 mutex_lock(&sc->mutex); in ath9k_get_tsf()
1827 ath9k_ps_wakeup(sc); in ath9k_get_tsf()
1828 tsf = ath9k_hw_gettsf64(sc->sc_ah); in ath9k_get_tsf()
1829 ath9k_ps_restore(sc); in ath9k_get_tsf()
1830 mutex_unlock(&sc->mutex); in ath9k_get_tsf()
1839 struct ath_softc *sc = hw->priv; in ath9k_set_tsf() local
1841 mutex_lock(&sc->mutex); in ath9k_set_tsf()
1842 ath9k_ps_wakeup(sc); in ath9k_set_tsf()
1843 ath9k_hw_settsf64(sc->sc_ah, tsf); in ath9k_set_tsf()
1844 ath9k_ps_restore(sc); in ath9k_set_tsf()
1845 mutex_unlock(&sc->mutex); in ath9k_set_tsf()
1850 struct ath_softc *sc = hw->priv; in ath9k_reset_tsf() local
1852 mutex_lock(&sc->mutex); in ath9k_reset_tsf()
1854 ath9k_ps_wakeup(sc); in ath9k_reset_tsf()
1855 ath9k_hw_reset_tsf(sc->sc_ah); in ath9k_reset_tsf()
1856 ath9k_ps_restore(sc); in ath9k_reset_tsf()
1858 mutex_unlock(&sc->mutex); in ath9k_reset_tsf()
1867 struct ath_softc *sc = hw->priv; in ath9k_ampdu_action() local
1868 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_ampdu_action()
1872 mutex_lock(&sc->mutex); in ath9k_ampdu_action()
1886 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
1887 ret = ath_tx_aggr_start(sc, sta, tid, ssn); in ath9k_ampdu_action()
1890 ath9k_ps_restore(sc); in ath9k_ampdu_action()
1896 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
1897 ath_tx_aggr_stop(sc, sta, tid); in ath9k_ampdu_action()
1900 ath9k_ps_restore(sc); in ath9k_ampdu_action()
1903 ath9k_ps_wakeup(sc); in ath9k_ampdu_action()
1904 ath_tx_aggr_resume(sc, sta, tid); in ath9k_ampdu_action()
1905 ath9k_ps_restore(sc); in ath9k_ampdu_action()
1908 ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n"); in ath9k_ampdu_action()
1911 mutex_unlock(&sc->mutex); in ath9k_ampdu_action()
1919 struct ath_softc *sc = hw->priv; in ath9k_get_survey() local
1920 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_get_survey()
1930 ath_update_survey_stats(sc); in ath9k_get_survey()
1948 memcpy(survey, &sc->survey[pos], sizeof(*survey)); in ath9k_get_survey()
1955 static void ath9k_enable_dynack(struct ath_softc *sc) in ath9k_enable_dynack() argument
1959 struct ath_hw *ah = sc->sc_ah; in ath9k_enable_dynack()
1964 rfilt = ath_calcrxfilter(sc); in ath9k_enable_dynack()
1972 struct ath_softc *sc = hw->priv; in ath9k_set_coverage_class() local
1973 struct ath_hw *ah = sc->sc_ah; in ath9k_set_coverage_class()
1978 mutex_lock(&sc->mutex); in ath9k_set_coverage_class()
1986 rfilt = ath_calcrxfilter(sc); in ath9k_set_coverage_class()
1989 ath9k_ps_wakeup(sc); in ath9k_set_coverage_class()
1991 ath9k_ps_restore(sc); in ath9k_set_coverage_class()
1993 ath9k_enable_dynack(sc); in ath9k_set_coverage_class()
1996 mutex_unlock(&sc->mutex); in ath9k_set_coverage_class()
1999 static bool ath9k_has_tx_pending(struct ath_softc *sc, in ath9k_has_tx_pending() argument
2005 if (!ATH_TXQ_SETUP(sc, i)) in ath9k_has_tx_pending()
2008 npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i], in ath9k_has_tx_pending()
2020 struct ath_softc *sc = hw->priv; in ath9k_flush() local
2021 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_flush()
2041 mutex_lock(&sc->mutex); in ath9k_flush()
2043 mutex_unlock(&sc->mutex); in ath9k_flush()
2049 struct ath_softc *sc = hw->priv; in __ath9k_flush() local
2050 struct ath_hw *ah = sc->sc_ah; in __ath9k_flush()
2055 cancel_delayed_work_sync(&sc->tx_complete_work); in __ath9k_flush()
2067 spin_lock_bh(&sc->chan_lock); in __ath9k_flush()
2071 timeout = sc->cur_chan->flush_timeout; in __ath9k_flush()
2072 spin_unlock_bh(&sc->chan_lock); in __ath9k_flush()
2077 if (wait_event_timeout(sc->tx_wait, !ath9k_has_tx_pending(sc, sw_pending), in __ath9k_flush()
2082 ath9k_ps_wakeup(sc); in __ath9k_flush()
2083 spin_lock_bh(&sc->sc_pcu_lock); in __ath9k_flush()
2084 drain_txq = ath_drain_all_txq(sc); in __ath9k_flush()
2085 spin_unlock_bh(&sc->sc_pcu_lock); in __ath9k_flush()
2088 ath_reset(sc, NULL); in __ath9k_flush()
2090 ath9k_ps_restore(sc); in __ath9k_flush()
2093 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); in __ath9k_flush()
2098 struct ath_softc *sc = hw->priv; in ath9k_tx_frames_pending() local
2100 return ath9k_has_tx_pending(sc, true); in ath9k_tx_frames_pending()
2105 struct ath_softc *sc = hw->priv; in ath9k_tx_last_beacon() local
2106 struct ath_hw *ah = sc->sc_ah; in ath9k_tx_last_beacon()
2114 vif = sc->beacon.bslot[0]; in ath9k_tx_last_beacon()
2123 if (!sc->beacon.tx_processed && !edma) { in ath9k_tx_last_beacon()
2124 tasklet_disable(&sc->bcon_tasklet); in ath9k_tx_last_beacon()
2134 sc->beacon.tx_processed = true; in ath9k_tx_last_beacon()
2135 sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); in ath9k_tx_last_beacon()
2138 tasklet_enable(&sc->bcon_tasklet); in ath9k_tx_last_beacon()
2141 return sc->beacon.tx_last; in ath9k_tx_last_beacon()
2147 struct ath_softc *sc = hw->priv; in ath9k_get_stats() local
2148 struct ath_hw *ah = sc->sc_ah; in ath9k_get_stats()
2195 struct ath_softc *sc = hw->priv; in ath9k_set_antenna() local
2196 struct ath_hw *ah = sc->sc_ah; in ath9k_set_antenna()
2204 sc->ant_rx = rx_ant; in ath9k_set_antenna()
2205 sc->ant_tx = tx_ant; in ath9k_set_antenna()
2224 struct ath_softc *sc = hw->priv; in ath9k_get_antenna() local
2226 *tx_ant = sc->ant_tx; in ath9k_get_antenna()
2227 *rx_ant = sc->ant_rx; in ath9k_get_antenna()
2235 struct ath_softc *sc = hw->priv; in ath9k_sw_scan_start() local
2236 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sw_scan_start()
2243 struct ath_softc *sc = hw->priv; in ath9k_sw_scan_complete() local
2244 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_sw_scan_complete()
2250 static void ath9k_cancel_pending_offchannel(struct ath_softc *sc) in ath9k_cancel_pending_offchannel() argument
2252 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_pending_offchannel()
2254 if (sc->offchannel.roc_vif) { in ath9k_cancel_pending_offchannel()
2258 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_pending_offchannel()
2259 if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START) in ath9k_cancel_pending_offchannel()
2260 ath_roc_complete(sc, ATH_ROC_COMPLETE_ABORT); in ath9k_cancel_pending_offchannel()
2267 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_pending_offchannel()
2268 ath_scan_complete(sc, true); in ath9k_cancel_pending_offchannel()
2276 struct ath_softc *sc = hw->priv; in ath9k_hw_scan() local
2277 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_hw_scan()
2280 mutex_lock(&sc->mutex); in ath9k_hw_scan()
2282 if (WARN_ON(sc->offchannel.scan_req)) { in ath9k_hw_scan()
2287 ath9k_ps_wakeup(sc); in ath9k_hw_scan()
2289 sc->offchannel.scan_vif = vif; in ath9k_hw_scan()
2290 sc->offchannel.scan_req = req; in ath9k_hw_scan()
2291 sc->offchannel.scan_idx = 0; in ath9k_hw_scan()
2296 if (sc->offchannel.state == ATH_OFFCHANNEL_IDLE) { in ath9k_hw_scan()
2298 ath_offchannel_next(sc); in ath9k_hw_scan()
2302 mutex_unlock(&sc->mutex); in ath9k_hw_scan()
2310 struct ath_softc *sc = hw->priv; in ath9k_cancel_hw_scan() local
2311 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_hw_scan()
2315 mutex_lock(&sc->mutex); in ath9k_cancel_hw_scan()
2316 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_hw_scan()
2317 ath_scan_complete(sc, true); in ath9k_cancel_hw_scan()
2318 mutex_unlock(&sc->mutex); in ath9k_cancel_hw_scan()
2326 struct ath_softc *sc = hw->priv; in ath9k_remain_on_channel() local
2327 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remain_on_channel()
2330 mutex_lock(&sc->mutex); in ath9k_remain_on_channel()
2332 if (WARN_ON(sc->offchannel.roc_vif)) { in ath9k_remain_on_channel()
2337 ath9k_ps_wakeup(sc); in ath9k_remain_on_channel()
2338 sc->offchannel.roc_vif = vif; in ath9k_remain_on_channel()
2339 sc->offchannel.roc_chan = chan; in ath9k_remain_on_channel()
2340 sc->offchannel.roc_duration = duration; in ath9k_remain_on_channel()
2346 if (sc->offchannel.state == ATH_OFFCHANNEL_IDLE) { in ath9k_remain_on_channel()
2348 ath_offchannel_next(sc); in ath9k_remain_on_channel()
2352 mutex_unlock(&sc->mutex); in ath9k_remain_on_channel()
2359 struct ath_softc *sc = hw->priv; in ath9k_cancel_remain_on_channel() local
2360 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_cancel_remain_on_channel()
2362 mutex_lock(&sc->mutex); in ath9k_cancel_remain_on_channel()
2365 del_timer_sync(&sc->offchannel.timer); in ath9k_cancel_remain_on_channel()
2367 if (sc->offchannel.roc_vif) { in ath9k_cancel_remain_on_channel()
2368 if (sc->offchannel.state >= ATH_OFFCHANNEL_ROC_START) in ath9k_cancel_remain_on_channel()
2369 ath_roc_complete(sc, ATH_ROC_COMPLETE_CANCEL); in ath9k_cancel_remain_on_channel()
2372 mutex_unlock(&sc->mutex); in ath9k_cancel_remain_on_channel()
2380 struct ath_softc *sc = hw->priv; in ath9k_add_chanctx() local
2381 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_add_chanctx()
2385 mutex_lock(&sc->mutex); in ath9k_add_chanctx()
2387 ath_for_each_chanctx(sc, ctx) { in ath9k_add_chanctx()
2394 pos = ctx - &sc->chanctx[0]; in ath9k_add_chanctx()
2401 ath_chanctx_set_channel(sc, ctx, &conf->def); in ath9k_add_chanctx()
2403 mutex_unlock(&sc->mutex); in ath9k_add_chanctx()
2407 mutex_unlock(&sc->mutex); in ath9k_add_chanctx()
2415 struct ath_softc *sc = hw->priv; in ath9k_remove_chanctx() local
2416 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_remove_chanctx()
2419 mutex_lock(&sc->mutex); in ath9k_remove_chanctx()
2427 ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_UNASSIGN); in ath9k_remove_chanctx()
2429 mutex_unlock(&sc->mutex); in ath9k_remove_chanctx()
2436 struct ath_softc *sc = hw->priv; in ath9k_change_chanctx() local
2437 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_change_chanctx()
2440 mutex_lock(&sc->mutex); in ath9k_change_chanctx()
2444 ath_chanctx_set_channel(sc, ctx, &conf->def); in ath9k_change_chanctx()
2445 mutex_unlock(&sc->mutex); in ath9k_change_chanctx()
2452 struct ath_softc *sc = hw->priv; in ath9k_assign_vif_chanctx() local
2453 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_assign_vif_chanctx()
2458 ath9k_cancel_pending_offchannel(sc); in ath9k_assign_vif_chanctx()
2460 mutex_lock(&sc->mutex); in ath9k_assign_vif_chanctx()
2470 ath9k_calculate_summary_state(sc, ctx); in ath9k_assign_vif_chanctx()
2474 mutex_unlock(&sc->mutex); in ath9k_assign_vif_chanctx()
2483 struct ath_softc *sc = hw->priv; in ath9k_unassign_vif_chanctx() local
2484 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_unassign_vif_chanctx()
2489 ath9k_cancel_pending_offchannel(sc); in ath9k_unassign_vif_chanctx()
2491 mutex_lock(&sc->mutex); in ath9k_unassign_vif_chanctx()
2501 ath9k_calculate_summary_state(sc, ctx); in ath9k_unassign_vif_chanctx()
2505 mutex_unlock(&sc->mutex); in ath9k_unassign_vif_chanctx()
2511 struct ath_softc *sc = hw->priv; in ath9k_mgd_prepare_tx() local
2512 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_mgd_prepare_tx()
2526 mutex_lock(&sc->mutex); in ath9k_mgd_prepare_tx()
2528 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2529 if (sc->next_chan || (sc->cur_chan != avp->chanctx)) in ath9k_mgd_prepare_tx()
2531 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2536 ath9k_cancel_pending_offchannel(sc); in ath9k_mgd_prepare_tx()
2538 go_ctx = ath_is_go_chanctx_present(sc); in ath9k_mgd_prepare_tx()
2545 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2546 sc->sched.mgd_prepare_tx = true; in ath9k_mgd_prepare_tx()
2549 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2552 init_completion(&sc->go_beacon); in ath9k_mgd_prepare_tx()
2554 mutex_unlock(&sc->mutex); in ath9k_mgd_prepare_tx()
2556 if (wait_for_completion_timeout(&sc->go_beacon, in ath9k_mgd_prepare_tx()
2561 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2562 sc->sched.mgd_prepare_tx = false; in ath9k_mgd_prepare_tx()
2563 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2566 mutex_lock(&sc->mutex); in ath9k_mgd_prepare_tx()
2573 spin_lock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2574 sc->next_chan = avp->chanctx; in ath9k_mgd_prepare_tx()
2575 sc->sched.state = ATH_CHANCTX_STATE_FORCE_ACTIVE; in ath9k_mgd_prepare_tx()
2576 spin_unlock_bh(&sc->chan_lock); in ath9k_mgd_prepare_tx()
2578 ath_chanctx_set_next(sc, true); in ath9k_mgd_prepare_tx()
2580 mutex_unlock(&sc->mutex); in ath9k_mgd_prepare_tx()
2605 struct ath_softc *sc = hw->priv; in ath9k_get_txpower() local
2608 mutex_lock(&sc->mutex); in ath9k_get_txpower()
2612 *dbm = sc->cur_chan->cur_txpower; in ath9k_get_txpower()
2613 mutex_unlock(&sc->mutex); in ath9k_get_txpower()