Lines Matching defs:sc

25 static void ath_fill_led_pin(struct ath_softc *sc)
27 struct ath_hw *ah = sc->sc_ah;
54 struct ath_softc *sc = container_of(led_cdev, struct ath_softc, led_cdev);
57 if (sc->sc_ah->config.led_active_high)
60 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
63 void ath_deinit_leds(struct ath_softc *sc)
65 if (!sc->led_registered)
68 ath_led_brightness(&sc->led_cdev, LED_OFF);
69 led_classdev_unregister(&sc->led_cdev);
71 ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin);
74 void ath_init_leds(struct ath_softc *sc)
78 if (AR_SREV_9100(sc->sc_ah))
81 ath_fill_led_pin(sc);
84 sc->led_cdev.default_trigger =
85 ieee80211_get_radio_led_name(sc->hw);
87 snprintf(sc->led_name, sizeof(sc->led_name),
88 "ath9k-%s", wiphy_name(sc->hw->wiphy));
89 sc->led_cdev.name = sc->led_name;
90 sc->led_cdev.brightness_set = ath_led_brightness;
92 ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &sc->led_cdev);
96 sc->led_registered = true;
104 static bool ath_is_rfkill_set(struct ath_softc *sc)
106 struct ath_hw *ah = sc->sc_ah;
109 ath9k_ps_wakeup(sc);
112 ath9k_ps_restore(sc);
119 struct ath_softc *sc = hw->priv;
120 bool blocked = !!ath_is_rfkill_set(sc);
125 void ath_start_rfkill_poll(struct ath_softc *sc)
127 struct ath_hw *ah = sc->sc_ah;
130 wiphy_rfkill_start_polling(sc->hw->wiphy);
142 static void ath_detect_bt_priority(struct ath_softc *sc)
144 struct ath_btcoex *btcoex = &sc->btcoex;
145 struct ath_hw *ah = sc->sc_ah;
147 if (ath9k_hw_gpio_get(sc->sc_ah, ah->btcoex_hw.btpriority_gpio))
156 ath_dbg(ath9k_hw_common(sc->sc_ah), BTCOEX,
161 ath_dbg(ath9k_hw_common(sc->sc_ah), BTCOEX,
171 static void ath_mci_ftp_adjust(struct ath_softc *sc)
173 struct ath_btcoex *btcoex = &sc->btcoex;
175 struct ath_hw *ah = sc->sc_ah;
181 (sc->rx.num_pkts < ATH_BTCOEX_STOMP_FTP_THRESH);
185 sc->rx.num_pkts = 0;
196 struct ath_softc *sc = from_timer(sc, t, btcoex.period_timer);
197 struct ath_hw *ah = sc->sc_ah;
198 struct ath_btcoex *btcoex = &sc->btcoex;
203 spin_lock_irqsave(&sc->sc_pm_lock, flags);
204 if (sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP) {
206 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
209 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
211 ath9k_ps_wakeup(sc);
215 ath9k_mci_update_rssi(sc);
216 ath_mci_ftp_adjust(sc);
220 ath_detect_bt_priority(sc);
244 ath9k_ps_restore(sc);
257 struct ath_softc *sc = from_timer(sc, t, btcoex.no_stomp_timer);
258 struct ath_hw *ah = sc->sc_ah;
259 struct ath_btcoex *btcoex = &sc->btcoex;
261 ath9k_ps_wakeup(sc);
273 ath9k_ps_restore(sc);
276 static void ath_init_btcoex_timer(struct ath_softc *sc)
278 struct ath_btcoex *btcoex = &sc->btcoex;
296 void ath9k_btcoex_timer_resume(struct ath_softc *sc)
298 struct ath_btcoex *btcoex = &sc->btcoex;
299 struct ath_hw *ah = sc->sc_ah;
321 void ath9k_btcoex_timer_pause(struct ath_softc *sc)
323 struct ath_btcoex *btcoex = &sc->btcoex;
324 struct ath_hw *ah = sc->sc_ah;
336 void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc)
338 struct ath_btcoex *btcoex = &sc->btcoex;
343 u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen)
345 struct ath_btcoex *btcoex = &sc->btcoex;
346 struct ath_mci_profile *mci = &sc->btcoex.mci;
349 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI) && mci->aggr_limit)
358 void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status)
361 ath_mci_intr(sc);
364 void ath9k_start_btcoex(struct ath_softc *sc)
366 struct ath_hw *ah = sc->sc_ah;
379 ath9k_btcoex_timer_resume(sc);
382 void ath9k_stop_btcoex(struct ath_softc *sc)
384 struct ath_hw *ah = sc->sc_ah;
390 ath9k_btcoex_timer_pause(sc);
394 ath_mci_flush_profile(&sc->btcoex.mci);
397 void ath9k_deinit_btcoex(struct ath_softc *sc)
399 struct ath_hw *ah = sc->sc_ah;
402 ath_mci_cleanup(sc);
408 ath9k_hw_btcoex_deinit(sc->sc_ah);
412 int ath9k_init_btcoex(struct ath_softc *sc)
415 struct ath_hw *ah = sc->sc_ah;
420 switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) {
424 ath9k_hw_btcoex_init_2wire(sc->sc_ah);
427 ath9k_hw_btcoex_init_3wire(sc->sc_ah);
428 ath_init_btcoex_timer(sc);
429 txq = sc->tx.txq_map[IEEE80211_AC_BE];
430 ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
433 ath_init_btcoex_timer(sc);
435 sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE;
436 INIT_LIST_HEAD(&sc->btcoex.mci.info);
439 r = ath_mci_setup(sc);
452 static int ath9k_dump_mci_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
454 struct ath_btcoex *btcoex = &sc->btcoex;
456 struct ath_hw *ah = sc->sc_ah;
497 static int ath9k_dump_legacy_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
500 struct ath_btcoex *btcoex = &sc->btcoex;
511 int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
513 if (ath9k_hw_mci_is_enabled(sc->sc_ah))
514 return ath9k_dump_mci_btcoex(sc, buf, size);
516 return ath9k_dump_legacy_btcoex(sc, buf, size);