23 #ifdef CONFIG_MAC80211_LEDS
24 static void ath_led_brightness(
struct led_classdev *led_cdev,
33 if (!sc->led_registered)
36 ath_led_brightness(&sc->led_cdev,
LED_OFF);
48 sc->led_cdev.default_trigger =
49 ieee80211_get_radio_led_name(sc->
hw);
51 snprintf(sc->led_name,
sizeof(sc->led_name),
52 "ath9k-%s", wiphy_name(sc->
hw->wiphy));
53 sc->led_cdev.name = sc->led_name;
54 sc->led_cdev.brightness_set = ath_led_brightness;
60 sc->led_registered =
true;
63 void ath_fill_led_pin(
struct ath_softc *sc)
93 static bool ath_is_rfkill_set(
struct ath_softc *sc)
109 bool blocked = !!ath_is_rfkill_set(sc);
122 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
131 static void ath_detect_bt_priority(
struct ath_softc *sc)
146 "BT scan detected\n");
151 "BT priority traffic detected\n");
160 static void ath9k_gen_timer_start(
struct ath_hw *ah,
195 static void ath_btcoex_period_timer(
unsigned long data)
207 spin_unlock_irqrestore(&sc->
sc_pm_lock, flags);
210 spin_unlock_irqrestore(&sc->
sc_pm_lock, flags);
214 ath_detect_bt_priority(sc);
221 ah->btcoex_hw.mci.stomp_ftp =
224 ah->btcoex_hw.mci.stomp_ftp =
false;
263 static void ath_btcoex_no_stomp_timer(
void *
arg)
270 ath_dbg(common, BTCOEX,
"no stomp timer running\n");
286 static int ath_init_btcoex_timer(
struct ath_softc *sc)
302 ath_btcoex_no_stomp_timer,
303 ath_btcoex_no_stomp_timer,
315 void ath9k_btcoex_timer_resume(
struct ath_softc *sc)
320 ath_dbg(ath9k_hw_common(ah), BTCOEX,
"Starting btcoex timers\n");
340 void ath9k_btcoex_timer_pause(
struct ath_softc *sc)
353 void ath9k_btcoex_stop_gen_timer(
struct ath_softc *sc)
363 u16 ath9k_btcoex_aggr_limit(
struct ath_softc *sc,
u32 max_4ms_framelen)
370 aggr_limit = (max_4ms_framelen * mci->
aggr_limit) >> 4;
372 aggr_limit =
min((max_4ms_framelen * 3) / 8,
390 void ath9k_start_btcoex(
struct ath_softc *sc)
395 !ah->btcoex_hw.enabled) {
405 ath9k_btcoex_timer_resume(sc);
409 void ath9k_stop_btcoex(
struct ath_softc *sc)
413 if (ah->btcoex_hw.enabled &&
416 ath9k_btcoex_timer_pause(sc);
423 void ath9k_deinit_btcoex(
struct ath_softc *sc)
427 if ((sc->btcoex.no_stomp_timer) &&
431 if (ath9k_hw_mci_is_enabled(ah))
435 int ath9k_init_btcoex(
struct ath_softc *sc)
443 switch (ath9k_hw_get_btcoex_scheme(sc->
sc_ah)) {
451 r = ath_init_btcoex_timer(sc);
457 if (ath9k_hw_mci_is_enabled(ah)) {
459 INIT_LIST_HEAD(&sc->btcoex.mci.info);