Lines Matching defs:priv
30 static void ath_detect_bt_priority(struct ath9k_htc_priv *priv)
32 struct ath_btcoex *btcoex = &priv->btcoex;
33 struct ath_hw *ah = priv->ah;
40 clear_bit(OP_BT_PRIORITY_DETECTED, &priv->op_flags);
41 clear_bit(OP_BT_SCAN, &priv->op_flags);
46 set_bit(OP_BT_PRIORITY_DETECTED, &priv->op_flags);
47 set_bit(OP_BT_SCAN, &priv->op_flags);
51 set_bit(OP_BT_PRIORITY_DETECTED, &priv->op_flags);
66 struct ath9k_htc_priv *priv = container_of(work, struct ath9k_htc_priv,
68 struct ath_btcoex *btcoex = &priv->btcoex;
69 struct ath_common *common = ath9k_hw_common(priv->ah);
73 ath_detect_bt_priority(priv);
75 ret = ath9k_htc_update_cap_target(priv,
76 test_bit(OP_BT_PRIORITY_DETECTED, &priv->op_flags));
82 ath9k_hw_btcoex_bt_stomp(priv->ah, test_bit(OP_BT_SCAN, &priv->op_flags) ?
85 ath9k_hw_btcoex_enable(priv->ah);
86 timer_period = test_bit(OP_BT_SCAN, &priv->op_flags) ?
88 ieee80211_queue_delayed_work(priv->hw, &priv->duty_cycle_work,
90 ieee80211_queue_delayed_work(priv->hw, &priv->coex_period_work,
100 struct ath9k_htc_priv *priv = container_of(work, struct ath9k_htc_priv,
102 struct ath_hw *ah = priv->ah;
103 struct ath_btcoex *btcoex = &priv->btcoex;
109 test_bit(OP_BT_SCAN, &priv->op_flags))
114 ath9k_hw_btcoex_enable(priv->ah);
117 static void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv)
119 struct ath_btcoex *btcoex = &priv->btcoex;
126 INIT_DELAYED_WORK(&priv->coex_period_work, ath_btcoex_period_work);
127 INIT_DELAYED_WORK(&priv->duty_cycle_work, ath_btcoex_duty_cycle_work);
134 static void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv)
136 struct ath_btcoex *btcoex = &priv->btcoex;
137 struct ath_hw *ah = priv->ah;
143 clear_bit(OP_BT_PRIORITY_DETECTED, &priv->op_flags);
144 clear_bit(OP_BT_SCAN, &priv->op_flags);
145 ieee80211_queue_delayed_work(priv->hw, &priv->coex_period_work, 0);
152 static void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv)
154 cancel_delayed_work_sync(&priv->coex_period_work);
155 cancel_delayed_work_sync(&priv->duty_cycle_work);
158 void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv)
160 struct ath_hw *ah = priv->ah;
166 ath_htc_resume_btcoex_work(priv);
170 void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
172 struct ath_hw *ah = priv->ah;
177 ath_htc_cancel_btcoex_work(priv);
182 void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
184 struct ath_hw *ah = priv->ah;
200 switch (ath9k_hw_get_btcoex_scheme(priv->ah)) {
204 priv->ah->btcoex_hw.btactive_gpio = 7;
205 priv->ah->btcoex_hw.btpriority_gpio = 6;
206 priv->ah->btcoex_hw.wlanactive_gpio = 8;
207 priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
208 ath9k_hw_btcoex_init_3wire(priv->ah);
209 ath_htc_init_btcoex_work(priv);
210 qnum = priv->hwq_map[IEEE80211_AC_BE];
211 ath9k_hw_init_btcoex_hw(priv->ah, qnum);
228 struct ath9k_htc_priv *priv = container_of(work,
232 ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin,
233 (priv->brightness == LED_OFF));
239 struct ath9k_htc_priv *priv = container_of(led_cdev,
244 priv->brightness = brightness;
245 ieee80211_queue_work(priv->hw, &priv->led_work);
248 void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
250 if (!priv->led_registered)
253 ath9k_led_brightness(&priv->led_cdev, LED_OFF);
254 led_classdev_unregister(&priv->led_cdev);
255 cancel_work_sync(&priv->led_work);
257 ath9k_hw_gpio_free(priv->ah, priv->ah->led_pin);
261 void ath9k_configure_leds(struct ath9k_htc_priv *priv)
264 ath9k_hw_gpio_request_out(priv->ah, priv->ah->led_pin,
268 ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
271 void ath9k_init_leds(struct ath9k_htc_priv *priv)
275 if (AR_SREV_9287(priv->ah))
276 priv->ah->led_pin = ATH_LED_PIN_9287;
277 else if (AR_SREV_9271(priv->ah))
278 priv->ah->led_pin = ATH_LED_PIN_9271;
279 else if (AR_DEVID_7010(priv->ah))
280 priv->ah->led_pin = ATH_LED_PIN_7010;
282 priv->ah->led_pin = ATH_LED_PIN_DEF;
285 priv->led_cdev.default_trigger =
286 ieee80211_get_radio_led_name(priv->hw);
288 ath9k_configure_leds(priv);
290 snprintf(priv->led_name, sizeof(priv->led_name),
291 "ath9k_htc-%s", wiphy_name(priv->hw->wiphy));
292 priv->led_cdev.name = priv->led_name;
293 priv->led_cdev.brightness_set = ath9k_led_brightness;
295 ret = led_classdev_register(wiphy_dev(priv->hw->wiphy), &priv->led_cdev);
299 INIT_WORK(&priv->led_work, ath9k_led_work);
300 priv->led_registered = true;
310 static bool ath_is_rfkill_set(struct ath9k_htc_priv *priv)
314 ath9k_htc_ps_wakeup(priv);
315 is_blocked = ath9k_hw_gpio_get(priv->ah, priv->ah->rfkill_gpio) ==
316 priv->ah->rfkill_polarity;
317 ath9k_htc_ps_restore(priv);
324 struct ath9k_htc_priv *priv = hw->priv;
325 bool blocked = !!ath_is_rfkill_set(priv);
330 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv)
332 if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
333 wiphy_rfkill_start_polling(priv->hw->wiphy);