Lines Matching refs:sc
23 static bool ath_tx_complete_check(struct ath_softc *sc) in ath_tx_complete_check() argument
28 if (sc->tx99_state) in ath_tx_complete_check()
32 txq = sc->tx.txq_map[i]; in ath_tx_complete_check()
34 ath_txq_lock(sc, txq); in ath_tx_complete_check()
37 ath_txq_unlock(sc, txq); in ath_tx_complete_check()
43 ath_txq_unlock(sc, txq); in ath_tx_complete_check()
49 ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, in ath_tx_complete_check()
51 ath9k_queue_reset(sc, RESET_TYPE_TX_HANG); in ath_tx_complete_check()
58 struct ath_softc *sc = container_of(work, struct ath_softc, in ath_hw_check_work() local
61 if (!ath_hw_check(sc) || in ath_hw_check_work()
62 !ath_tx_complete_check(sc)) in ath_hw_check_work()
65 ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work, in ath_hw_check_work()
72 bool ath_hw_check(struct ath_softc *sc) in ath_hw_check() argument
74 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_hw_check()
78 ath9k_ps_wakeup(sc); in ath_hw_check()
80 is_alive = ath9k_hw_check_alive(sc->sc_ah); in ath_hw_check()
86 ath9k_queue_reset(sc, type); in ath_hw_check()
89 ath9k_ps_restore(sc); in ath_hw_check()
97 static bool ath_hw_pll_rx_hang_check(struct ath_softc *sc, u32 pll_sqsum) in ath_hw_pll_rx_hang_check() argument
100 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_hw_pll_rx_hang_check()
106 ath9k_queue_reset(sc, RESET_TYPE_PLL_HANG); in ath_hw_pll_rx_hang_check()
120 struct ath_softc *sc = container_of(work, struct ath_softc, in ath_hw_pll_work() local
122 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_hw_pll_work()
132 if (sc->tx99_state) in ath_hw_pll_work()
135 ath9k_ps_wakeup(sc); in ath_hw_pll_work()
136 pll_sqsum = ar9003_get_pll_sqsum_dvc(sc->sc_ah); in ath_hw_pll_work()
137 ath9k_ps_restore(sc); in ath_hw_pll_work()
138 if (ath_hw_pll_rx_hang_check(sc, pll_sqsum)) in ath_hw_pll_work()
141 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, in ath_hw_pll_work()
148 static void ath_paprd_activate(struct ath_softc *sc) in ath_paprd_activate() argument
150 struct ath_hw *ah = sc->sc_ah; in ath_paprd_activate()
172 static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int chain) in ath_paprd_send_frame() argument
174 struct ieee80211_hw *hw = sc->hw; in ath_paprd_send_frame()
176 struct ath_hw *ah = sc->sc_ah; in ath_paprd_send_frame()
182 txctl.txq = sc->tx.txq_map[IEEE80211_AC_BE]; in ath_paprd_send_frame()
185 tx_info->band = sc->cur_chandef.chan->band; in ath_paprd_send_frame()
192 init_completion(&sc->paprd_complete); in ath_paprd_send_frame()
201 time_left = wait_for_completion_timeout(&sc->paprd_complete, in ath_paprd_send_frame()
214 struct ath_softc *sc = container_of(work, struct ath_softc, paprd_work); in ath_paprd_calibrate() local
215 struct ieee80211_hw *hw = sc->hw; in ath_paprd_calibrate()
216 struct ath_hw *ah = sc->sc_ah; in ath_paprd_calibrate()
234 ath9k_ps_wakeup(sc); in ath_paprd_calibrate()
262 if (!ath_paprd_send_frame(sc, skb, chain)) in ath_paprd_calibrate()
290 ath_paprd_activate(sc); in ath_paprd_calibrate()
294 ath9k_ps_restore(sc); in ath_paprd_calibrate()
307 struct ath_softc *sc = (struct ath_softc *)common->priv; in ath_ani_calibrate() local
308 struct ath_hw *ah = sc->sc_ah; in ath_ani_calibrate()
325 if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE) { in ath_ani_calibrate()
327 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
328 sc->ps_flags |= PS_WAIT_FOR_ANI; in ath_ani_calibrate()
329 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
334 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
335 sc->ps_flags &= ~PS_WAIT_FOR_ANI; in ath_ani_calibrate()
336 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_ani_calibrate()
338 ath9k_ps_wakeup(sc); in ath_ani_calibrate()
372 ath_update_survey_stats(sc); in ath_ani_calibrate()
382 ath9k_queue_reset(sc, RESET_TYPE_CALIBRATION); in ath_ani_calibrate()
395 ath9k_ps_restore(sc); in ath_ani_calibrate()
412 ieee80211_queue_work(sc->hw, &sc->paprd_work); in ath_ani_calibrate()
414 ath9k_ps_wakeup(sc); in ath_ani_calibrate()
415 ath_paprd_activate(sc); in ath_ani_calibrate()
416 ath9k_ps_restore(sc); in ath_ani_calibrate()
421 void ath_start_ani(struct ath_softc *sc) in ath_start_ani() argument
423 struct ath_hw *ah = sc->sc_ah; in ath_start_ani()
429 sc->cur_chan->offchannel) in ath_start_ani()
441 void ath_stop_ani(struct ath_softc *sc) in ath_stop_ani() argument
443 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_stop_ani()
449 void ath_check_ani(struct ath_softc *sc) in ath_check_ani() argument
451 struct ath_hw *ah = sc->sc_ah; in ath_check_ani()
452 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_check_ani()
453 struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; in ath_check_ani()
478 ath_start_ani(sc); in ath_check_ani()
485 ath_stop_ani(sc); in ath_check_ani()
488 void ath_update_survey_nf(struct ath_softc *sc, int channel) in ath_update_survey_nf() argument
490 struct ath_hw *ah = sc->sc_ah; in ath_update_survey_nf()
492 struct survey_info *survey = &sc->survey[channel]; in ath_update_survey_nf()
506 int ath_update_survey_stats(struct ath_softc *sc) in ath_update_survey_stats() argument
508 struct ath_hw *ah = sc->sc_ah; in ath_update_survey_stats()
511 struct survey_info *survey = &sc->survey[pos]; in ath_update_survey_stats()
541 ath_update_survey_nf(sc, pos); in ath_update_survey_stats()