Lines Matching refs:sc
25 struct ath_softc *sc = container_of(work, struct ath_softc, in ath_tx_complete_poll_work() local
32 txq = sc->tx.txq_map[i]; in ath_tx_complete_poll_work()
34 ath_txq_lock(sc, txq); in ath_tx_complete_poll_work()
38 ath_txq_unlock(sc, txq); in ath_tx_complete_poll_work()
44 ath_txq_unlock_complete(sc, txq); in ath_tx_complete_poll_work()
48 ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, in ath_tx_complete_poll_work()
50 ath9k_queue_reset(sc, RESET_TYPE_TX_HANG); in ath_tx_complete_poll_work()
54 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, in ath_tx_complete_poll_work()
63 struct ath_softc *sc = container_of(work, struct ath_softc, hw_check_work); in ath_hw_check() local
64 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_hw_check()
70 ath9k_ps_wakeup(sc); in ath_hw_check()
71 is_alive = ath9k_hw_check_alive(sc->sc_ah); in ath_hw_check()
73 if (is_alive && !AR_SREV_9300(sc->sc_ah)) in ath_hw_check()
75 else if (!is_alive && AR_SREV_9300(sc->sc_ah)) { in ath_hw_check()
83 busy = ath_update_survey_stats(sc); in ath_hw_check()
87 busy, sc->hw_busy_count + 1); in ath_hw_check()
89 if (++sc->hw_busy_count >= 3) { in ath_hw_check()
94 sc->hw_busy_count = 0; in ath_hw_check()
98 ath_start_rx_poll(sc, nbeacon); in ath_hw_check()
102 ath9k_queue_reset(sc, type); in ath_hw_check()
104 ath9k_ps_restore(sc); in ath_hw_check()
110 static bool ath_hw_pll_rx_hang_check(struct ath_softc *sc, u32 pll_sqsum) in ath_hw_pll_rx_hang_check() argument
113 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_hw_pll_rx_hang_check()
119 ath9k_queue_reset(sc, RESET_TYPE_PLL_HANG); in ath_hw_pll_rx_hang_check()
133 struct ath_softc *sc = container_of(work, struct ath_softc, in ath_hw_pll_work() local
141 if (!test_bit(SC_OP_BEACONS, &sc->sc_flags)) in ath_hw_pll_work()
144 ath9k_ps_wakeup(sc); in ath_hw_pll_work()
145 pll_sqsum = ar9003_get_pll_sqsum_dvc(sc->sc_ah); in ath_hw_pll_work()
146 ath9k_ps_restore(sc); in ath_hw_pll_work()
147 if (ath_hw_pll_rx_hang_check(sc, pll_sqsum)) in ath_hw_pll_work()
150 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, in ath_hw_pll_work()
157 void ath_start_rx_poll(struct ath_softc *sc, u8 nbeacon) in ath_start_rx_poll() argument
159 if (!AR_SREV_9300(sc->sc_ah)) in ath_start_rx_poll()
162 if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) in ath_start_rx_poll()
165 mod_timer(&sc->rx_poll_timer, jiffies + msecs_to_jiffies in ath_start_rx_poll()
166 (nbeacon * sc->cur_beacon_conf.beacon_interval)); in ath_start_rx_poll()
171 struct ath_softc *sc = (struct ath_softc *)data; in ath_rx_poll() local
173 if (!test_bit(SC_OP_INVALID, &sc->sc_flags)) in ath_rx_poll()
174 ieee80211_queue_work(sc->hw, &sc->hw_check_work); in ath_rx_poll()
180 static void ath_paprd_activate(struct ath_softc *sc) in ath_paprd_activate() argument
182 struct ath_hw *ah = sc->sc_ah; in ath_paprd_activate()
204 static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int chain) in ath_paprd_send_frame() argument
206 struct ieee80211_hw *hw = sc->hw; in ath_paprd_send_frame()
208 struct ath_hw *ah = sc->sc_ah; in ath_paprd_send_frame()
214 txctl.txq = sc->tx.txq_map[IEEE80211_AC_BE]; in ath_paprd_send_frame()
224 init_completion(&sc->paprd_complete); in ath_paprd_send_frame()
233 time_left = wait_for_completion_timeout(&sc->paprd_complete, in ath_paprd_send_frame()
246 struct ath_softc *sc = container_of(work, struct ath_softc, paprd_work); in ath_paprd_calibrate() local
247 struct ieee80211_hw *hw = sc->hw; in ath_paprd_calibrate()
248 struct ath_hw *ah = sc->sc_ah; in ath_paprd_calibrate()
264 ath9k_ps_wakeup(sc); in ath_paprd_calibrate()
292 if (!ath_paprd_send_frame(sc, skb, chain)) in ath_paprd_calibrate()
320 ath_paprd_activate(sc); in ath_paprd_calibrate()
324 ath9k_ps_restore(sc); in ath_paprd_calibrate()
336 struct ath_softc *sc = (struct ath_softc *)data; in ath_ani_calibrate() local
337 struct ath_hw *ah = sc->sc_ah; in ath_ani_calibrate()
355 if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE) { in ath_ani_calibrate()
357 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
358 sc->ps_flags |= PS_WAIT_FOR_ANI; in ath_ani_calibrate()
359 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
364 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
365 sc->ps_flags &= ~PS_WAIT_FOR_ANI; in ath_ani_calibrate()
366 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
368 ath9k_ps_wakeup(sc); in ath_ani_calibrate()
393 if (sc->sc_ah->config.enable_ani in ath_ani_calibrate()
404 ath_update_survey_stats(sc); in ath_ani_calibrate()
421 ath9k_debug_samp_bb_mac(sc); in ath_ani_calibrate()
422 ath9k_ps_restore(sc); in ath_ani_calibrate()
431 if (sc->sc_ah->config.enable_ani) in ath_ani_calibrate()
441 ieee80211_queue_work(sc->hw, &sc->paprd_work); in ath_ani_calibrate()
443 ath9k_ps_wakeup(sc); in ath_ani_calibrate()
444 ath_paprd_activate(sc); in ath_ani_calibrate()
445 ath9k_ps_restore(sc); in ath_ani_calibrate()
450 void ath_start_ani(struct ath_softc *sc) in ath_start_ani() argument
452 struct ath_hw *ah = sc->sc_ah; in ath_start_ani()
457 !test_bit(SC_OP_ANI_RUN, &sc->sc_flags) || in ath_start_ani()
458 (sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) in ath_start_ani()
470 void ath_stop_ani(struct ath_softc *sc) in ath_stop_ani() argument
472 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_stop_ani()
478 void ath_check_ani(struct ath_softc *sc) in ath_check_ani() argument
480 struct ath_hw *ah = sc->sc_ah; in ath_check_ani()
481 struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; in ath_check_ani()
496 if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) in ath_check_ani()
500 if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) in ath_check_ani()
504 if (!test_bit(SC_OP_ANI_RUN, &sc->sc_flags)) { in ath_check_ani()
505 set_bit(SC_OP_ANI_RUN, &sc->sc_flags); in ath_check_ani()
506 ath_start_ani(sc); in ath_check_ani()
512 clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); in ath_check_ani()
513 ath_stop_ani(sc); in ath_check_ani()
516 void ath_update_survey_nf(struct ath_softc *sc, int channel) in ath_update_survey_nf() argument
518 struct ath_hw *ah = sc->sc_ah; in ath_update_survey_nf()
520 struct survey_info *survey = &sc->survey[channel]; in ath_update_survey_nf()
533 int ath_update_survey_stats(struct ath_softc *sc) in ath_update_survey_stats() argument
535 struct ath_hw *ah = sc->sc_ah; in ath_update_survey_stats()
538 struct survey_info *survey = &sc->survey[pos]; in ath_update_survey_stats()
568 ath_update_survey_nf(sc, pos); in ath_update_survey_stats()