Lines Matching refs: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 priv->op_flags &= ~(OP_BT_PRIORITY_DETECTED | OP_BT_SCAN);
45 priv->op_flags |= (OP_BT_SCAN |
50 priv->op_flags |= OP_BT_PRIORITY_DETECTED;
65 struct ath9k_htc_priv *priv = container_of(work, struct ath9k_htc_priv,
67 struct ath_btcoex *btcoex = &priv->btcoex;
68 struct ath_common *common = ath9k_hw_common(priv->ah);
73 ath_detect_bt_priority(priv);
75 is_btscan = !!(priv->op_flags & OP_BT_SCAN);
77 ret = ath9k_htc_update_cap_target(priv,
78 !!(priv->op_flags & OP_BT_PRIORITY_DETECTED));
84 ath9k_hw_btcoex_bt_stomp(priv->ah, is_btscan ? ATH_BTCOEX_STOMP_ALL :
87 ath9k_hw_btcoex_enable(priv->ah);
90 ieee80211_queue_delayed_work(priv->hw, &priv->duty_cycle_work,
92 ieee80211_queue_delayed_work(priv->hw, &priv->coex_period_work,
102 struct ath9k_htc_priv *priv = container_of(work, struct ath9k_htc_priv,
104 struct ath_hw *ah = priv->ah;
105 struct ath_btcoex *btcoex = &priv->btcoex;
107 bool is_btscan = priv->op_flags & OP_BT_SCAN;
115 ath9k_hw_btcoex_enable(priv->ah);
118 static void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv)
120 struct ath_btcoex *btcoex = &priv->btcoex;
127 INIT_DELAYED_WORK(&priv->coex_period_work, ath_btcoex_period_work);
128 INIT_DELAYED_WORK(&priv->duty_cycle_work, ath_btcoex_duty_cycle_work);
135 static void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv)
137 struct ath_btcoex *btcoex = &priv->btcoex;
138 struct ath_hw *ah = priv->ah;
144 priv->op_flags &= ~(OP_BT_PRIORITY_DETECTED | OP_BT_SCAN);
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;
178 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;
191 switch (ath9k_hw_get_btcoex_scheme(priv->ah)) {
195 priv->ah->btcoex_hw.btactive_gpio = 7;
196 priv->ah->btcoex_hw.btpriority_gpio = 6;
197 priv->ah->btcoex_hw.wlanactive_gpio = 8;
198 priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
199 ath9k_hw_btcoex_init_3wire(priv->ah);
200 ath_htc_init_btcoex_work(priv);
201 qnum = priv->hwq_map[WME_AC_BE];
202 ath9k_hw_init_btcoex_hw(priv->ah, qnum);
219 struct ath9k_htc_priv *priv = container_of(work,
223 ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin,
224 (priv->brightness == LED_OFF));
230 struct ath9k_htc_priv *priv = container_of(led_cdev,
235 priv->brightness = brightness;
236 ieee80211_queue_work(priv->hw, &priv->led_work);
239 void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
241 if (!priv->led_registered)
244 ath9k_led_brightness(&priv->led_cdev, LED_OFF);
245 led_classdev_unregister(&priv->led_cdev);
246 cancel_work_sync(&priv->led_work);
249 void ath9k_init_leds(struct ath9k_htc_priv *priv)
253 if (AR_SREV_9287(priv->ah))
254 priv->ah->led_pin = ATH_LED_PIN_9287;
255 else if (AR_SREV_9271(priv->ah))
256 priv->ah->led_pin = ATH_LED_PIN_9271;
257 else if (AR_DEVID_7010(priv->ah))
258 priv->ah->led_pin = ATH_LED_PIN_7010;
260 priv->ah->led_pin = ATH_LED_PIN_DEF;
263 ath9k_hw_cfg_output(priv->ah, priv->ah->led_pin,
266 ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
268 snprintf(priv->led_name, sizeof(priv->led_name),
269 "ath9k_htc-%s", wiphy_name(priv->hw->wiphy));
270 priv->led_cdev.name = priv->led_name;
271 priv->led_cdev.brightness_set = ath9k_led_brightness;
273 ret = led_classdev_register(wiphy_dev(priv->hw->wiphy), &priv->led_cdev);
277 INIT_WORK(&priv->led_work, ath9k_led_work);
278 priv->led_registered = true;
288 static bool ath_is_rfkill_set(struct ath9k_htc_priv *priv)
292 ath9k_htc_ps_wakeup(priv);
293 is_blocked = ath9k_hw_gpio_get(priv->ah, priv->ah->rfkill_gpio) ==
294 priv->ah->rfkill_polarity;
295 ath9k_htc_ps_restore(priv);
302 struct ath9k_htc_priv *priv = hw->priv;
303 bool blocked = !!ath_is_rfkill_set(priv);
308 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv)
310 if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
311 wiphy_rfkill_start_polling(priv->hw->wiphy);
316 struct ath9k_htc_priv *priv = hw->priv;
317 struct ath_hw *ah = priv->ah;
333 ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
334 &priv->curtxpow);
338 ath9k_host_rx_init(priv);
341 htc_start(priv->htc);
342 spin_lock_bh(&priv->tx.tx_lock);
343 priv->tx.flags &= ~ATH9K_HTC_OP_TX_QUEUES_STOP;
344 spin_unlock_bh(&priv->tx.tx_lock);
357 struct ath9k_htc_priv *priv = hw->priv;
358 struct ath_hw *ah = priv->ah;
363 ath9k_htc_ps_wakeup(priv);
373 ath9k_htc_tx_drain(priv);
380 ath9k_wmi_event_drain(priv);
402 ath9k_htc_ps_restore(priv);
403 ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP);