htc.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /*
  2. * Copyright (c) 2010 Atheros Communications Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef HTC_H
  17. #define HTC_H
  18. #include <linux/module.h>
  19. #include <linux/usb.h>
  20. #include <linux/firmware.h>
  21. #include <linux/skbuff.h>
  22. #include <linux/netdevice.h>
  23. #include <linux/leds.h>
  24. #include <linux/slab.h>
  25. #include <net/mac80211.h>
  26. #include "common.h"
  27. #include "htc_hst.h"
  28. #include "hif_usb.h"
  29. #include "wmi.h"
  30. #define ATH_STA_SHORT_CALINTERVAL 1000 /* 1 second */
  31. #define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */
  32. #define ATH_ANI_POLLINTERVAL 100 /* 100 ms */
  33. #define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */
  34. #define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */
  35. #define ATH_DEFAULT_BMISS_LIMIT 10
  36. #define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024)
  37. #define TSF_TO_TU(_h, _l) \
  38. ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
  39. extern struct ieee80211_ops ath9k_htc_ops;
  40. extern int htc_modparam_nohwcrypt;
  41. enum htc_phymode {
  42. HTC_MODE_AUTO = 0,
  43. HTC_MODE_11A = 1,
  44. HTC_MODE_11B = 2,
  45. HTC_MODE_11G = 3,
  46. HTC_MODE_FH = 4,
  47. HTC_MODE_TURBO_A = 5,
  48. HTC_MODE_TURBO_G = 6,
  49. HTC_MODE_11NA = 7,
  50. HTC_MODE_11NG = 8
  51. };
  52. enum htc_opmode {
  53. HTC_M_STA = 1,
  54. HTC_M_IBSS = 0,
  55. HTC_M_AHDEMO = 3,
  56. HTC_M_HOSTAP = 6,
  57. HTC_M_MONITOR = 8,
  58. HTC_M_WDS = 2
  59. };
  60. #define ATH9K_HTC_AMPDU 1
  61. #define ATH9K_HTC_NORMAL 2
  62. #define ATH9K_HTC_BEACON 3
  63. #define ATH9K_HTC_MGMT 4
  64. #define ATH9K_HTC_TX_CTSONLY 0x1
  65. #define ATH9K_HTC_TX_RTSCTS 0x2
  66. struct tx_frame_hdr {
  67. u8 data_type;
  68. u8 node_idx;
  69. u8 vif_idx;
  70. u8 tidno;
  71. __be32 flags; /* ATH9K_HTC_TX_* */
  72. u8 key_type;
  73. u8 keyix;
  74. u8 cookie;
  75. u8 pad;
  76. } __packed;
  77. struct tx_mgmt_hdr {
  78. u8 node_idx;
  79. u8 vif_idx;
  80. u8 tidno;
  81. u8 flags;
  82. u8 key_type;
  83. u8 keyix;
  84. u8 cookie;
  85. u8 pad;
  86. } __packed;
  87. struct tx_beacon_header {
  88. u8 vif_index;
  89. u8 len_changed;
  90. u16 rev;
  91. } __packed;
  92. #define MAX_TX_AMPDU_SUBFRAMES_9271 17
  93. #define MAX_TX_AMPDU_SUBFRAMES_7010 22
  94. struct ath9k_htc_cap_target {
  95. __be32 ampdu_limit;
  96. u8 ampdu_subframes;
  97. u8 enable_coex;
  98. u8 tx_chainmask;
  99. u8 pad;
  100. } __packed;
  101. struct ath9k_htc_target_vif {
  102. u8 index;
  103. u8 opmode;
  104. u8 myaddr[ETH_ALEN];
  105. u8 ath_cap;
  106. __be16 rtsthreshold;
  107. u8 pad;
  108. } __packed;
  109. #define ATH_HTC_STA_AUTH 0x0001
  110. #define ATH_HTC_STA_QOS 0x0002
  111. #define ATH_HTC_STA_ERP 0x0004
  112. #define ATH_HTC_STA_HT 0x0008
  113. struct ath9k_htc_target_sta {
  114. u8 macaddr[ETH_ALEN];
  115. u8 bssid[ETH_ALEN];
  116. u8 sta_index;
  117. u8 vif_index;
  118. u8 is_vif_sta;
  119. __be16 flags; /* ATH_HTC_STA_* */
  120. __be16 htcap;
  121. __be16 maxampdu;
  122. u8 pad;
  123. } __packed;
  124. struct ath9k_htc_target_aggr {
  125. u8 sta_index;
  126. u8 tidno;
  127. u8 aggr_enable;
  128. u8 padding;
  129. } __packed;
  130. #define ATH_HTC_RATE_MAX 30
  131. #define WLAN_RC_DS_FLAG 0x01
  132. #define WLAN_RC_40_FLAG 0x02
  133. #define WLAN_RC_SGI_FLAG 0x04
  134. #define WLAN_RC_HT_FLAG 0x08
  135. struct ath9k_htc_rateset {
  136. u8 rs_nrates;
  137. u8 rs_rates[ATH_HTC_RATE_MAX];
  138. };
  139. struct ath9k_htc_rate {
  140. struct ath9k_htc_rateset legacy_rates;
  141. struct ath9k_htc_rateset ht_rates;
  142. } __packed;
  143. struct ath9k_htc_target_rate {
  144. u8 sta_index;
  145. u8 isnew;
  146. __be32 capflags;
  147. struct ath9k_htc_rate rates;
  148. };
  149. struct ath9k_htc_target_int_stats {
  150. __be32 rx;
  151. __be32 rxorn;
  152. __be32 rxeol;
  153. __be32 txurn;
  154. __be32 txto;
  155. __be32 cst;
  156. } __packed;
  157. struct ath9k_htc_target_tx_stats {
  158. __be32 xretries;
  159. __be32 fifoerr;
  160. __be32 filtered;
  161. __be32 timer_exp;
  162. __be32 shortretries;
  163. __be32 longretries;
  164. __be32 qnull;
  165. __be32 encap_fail;
  166. __be32 nobuf;
  167. } __packed;
  168. struct ath9k_htc_target_rx_stats {
  169. __be32 nobuf;
  170. __be32 host_send;
  171. __be32 host_done;
  172. } __packed;
  173. #define ATH9K_HTC_MAX_VIF 2
  174. #define ATH9K_HTC_MAX_BCN_VIF 2
  175. #define INC_VIF(_priv, _type) do { \
  176. switch (_type) { \
  177. case NL80211_IFTYPE_STATION: \
  178. _priv->num_sta_vif++; \
  179. break; \
  180. case NL80211_IFTYPE_ADHOC: \
  181. _priv->num_ibss_vif++; \
  182. break; \
  183. case NL80211_IFTYPE_AP: \
  184. _priv->num_ap_vif++; \
  185. break; \
  186. default: \
  187. break; \
  188. } \
  189. } while (0)
  190. #define DEC_VIF(_priv, _type) do { \
  191. switch (_type) { \
  192. case NL80211_IFTYPE_STATION: \
  193. _priv->num_sta_vif--; \
  194. break; \
  195. case NL80211_IFTYPE_ADHOC: \
  196. _priv->num_ibss_vif--; \
  197. break; \
  198. case NL80211_IFTYPE_AP: \
  199. _priv->num_ap_vif--; \
  200. break; \
  201. default: \
  202. break; \
  203. } \
  204. } while (0)
  205. struct ath9k_htc_vif {
  206. u8 index;
  207. u16 seq_no;
  208. bool beacon_configured;
  209. int bslot;
  210. __le64 tsfadjust;
  211. };
  212. struct ath9k_vif_iter_data {
  213. const u8 *hw_macaddr;
  214. u8 mask[ETH_ALEN];
  215. };
  216. #define ATH9K_HTC_MAX_STA 8
  217. #define ATH9K_HTC_MAX_TID 8
  218. enum tid_aggr_state {
  219. AGGR_STOP = 0,
  220. AGGR_PROGRESS,
  221. AGGR_START,
  222. AGGR_OPERATIONAL
  223. };
  224. struct ath9k_htc_sta {
  225. u8 index;
  226. enum tid_aggr_state tid_state[ATH9K_HTC_MAX_TID];
  227. };
  228. #define ATH9K_HTC_RXBUF 256
  229. #define HTC_RX_FRAME_HEADER_SIZE 40
  230. struct ath9k_htc_rxbuf {
  231. bool in_process;
  232. struct sk_buff *skb;
  233. struct ath_htc_rx_status rxstatus;
  234. struct list_head list;
  235. };
  236. struct ath9k_htc_rx {
  237. int last_rssi; /* FIXME: per-STA */
  238. struct list_head rxbuf;
  239. spinlock_t rxbuflock;
  240. };
  241. #define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */
  242. #define ATH9K_HTC_TX_TIMEOUT_INTERVAL 2500 /* ms */
  243. #define ATH9K_HTC_TX_RESERVE 10
  244. #define ATH9K_HTC_TX_TIMEOUT_COUNT 20
  245. #define ATH9K_HTC_TX_THRESHOLD (MAX_TX_BUF_NUM - ATH9K_HTC_TX_RESERVE)
  246. #define ATH9K_HTC_OP_TX_QUEUES_STOP BIT(0)
  247. #define ATH9K_HTC_OP_TX_DRAIN BIT(1)
  248. struct ath9k_htc_tx {
  249. u8 flags;
  250. int queued_cnt;
  251. struct sk_buff_head mgmt_ep_queue;
  252. struct sk_buff_head cab_ep_queue;
  253. struct sk_buff_head data_be_queue;
  254. struct sk_buff_head data_bk_queue;
  255. struct sk_buff_head data_vi_queue;
  256. struct sk_buff_head data_vo_queue;
  257. struct sk_buff_head tx_failed;
  258. DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM);
  259. struct timer_list cleanup_timer;
  260. spinlock_t tx_lock;
  261. };
  262. struct ath9k_htc_tx_ctl {
  263. u8 type; /* ATH9K_HTC_* */
  264. u8 epid;
  265. u8 txok;
  266. u8 sta_idx;
  267. unsigned long timestamp;
  268. };
  269. static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)
  270. {
  271. struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
  272. BUILD_BUG_ON(sizeof(struct ath9k_htc_tx_ctl) >
  273. IEEE80211_TX_INFO_DRIVER_DATA_SIZE);
  274. return (struct ath9k_htc_tx_ctl *) &tx_info->driver_data;
  275. }
  276. #ifdef CONFIG_ATH9K_HTC_DEBUGFS
  277. #define TX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c++)
  278. #define RX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.rx_stats.c++)
  279. #define CAB_STAT_INC priv->debug.tx_stats.cab_queued++
  280. #define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)
  281. void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
  282. struct ath_htc_rx_status *rxs);
  283. struct ath_tx_stats {
  284. u32 buf_queued;
  285. u32 buf_completed;
  286. u32 skb_queued;
  287. u32 skb_success;
  288. u32 skb_failed;
  289. u32 cab_queued;
  290. u32 queue_stats[WME_NUM_AC];
  291. };
  292. struct ath_rx_stats {
  293. u32 skb_allocated;
  294. u32 skb_completed;
  295. u32 skb_dropped;
  296. u32 err_crc;
  297. u32 err_decrypt_crc;
  298. u32 err_mic;
  299. u32 err_pre_delim;
  300. u32 err_post_delim;
  301. u32 err_decrypt_busy;
  302. u32 err_phy;
  303. u32 err_phy_stats[ATH9K_PHYERR_MAX];
  304. };
  305. struct ath9k_debug {
  306. struct dentry *debugfs_phy;
  307. struct ath_tx_stats tx_stats;
  308. struct ath_rx_stats rx_stats;
  309. };
  310. #else
  311. #define TX_STAT_INC(c) do { } while (0)
  312. #define RX_STAT_INC(c) do { } while (0)
  313. #define CAB_STAT_INC do { } while (0)
  314. #define TX_QSTAT_INC(c) do { } while (0)
  315. static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
  316. struct ath_htc_rx_status *rxs)
  317. {
  318. }
  319. #endif /* CONFIG_ATH9K_HTC_DEBUGFS */
  320. #define ATH_LED_PIN_DEF 1
  321. #define ATH_LED_PIN_9287 10
  322. #define ATH_LED_PIN_9271 15
  323. #define ATH_LED_PIN_7010 12
  324. #define ATH_LED_ON_DURATION_IDLE 350 /* in msecs */
  325. #define ATH_LED_OFF_DURATION_IDLE 250 /* in msecs */
  326. enum ath_led_type {
  327. ATH_LED_RADIO,
  328. ATH_LED_ASSOC,
  329. ATH_LED_TX,
  330. ATH_LED_RX
  331. };
  332. struct ath_led {
  333. struct ath9k_htc_priv *priv;
  334. struct led_classdev led_cdev;
  335. enum ath_led_type led_type;
  336. struct delayed_work brightness_work;
  337. char name[32];
  338. bool registered;
  339. int brightness;
  340. };
  341. #define BSTUCK_THRESHOLD 10
  342. /*
  343. * Adjust these when the max. no of beaconing interfaces is
  344. * increased.
  345. */
  346. #define DEFAULT_SWBA_RESPONSE 40 /* in TUs */
  347. #define MIN_SWBA_RESPONSE 10 /* in TUs */
  348. struct htc_beacon_config {
  349. struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF];
  350. u16 beacon_interval;
  351. u16 dtim_period;
  352. u16 bmiss_timeout;
  353. u32 bmiss_cnt;
  354. };
  355. struct ath_btcoex {
  356. u32 bt_priority_cnt;
  357. unsigned long bt_priority_time;
  358. int bt_stomp_type; /* Types of BT stomping */
  359. u32 btcoex_no_stomp;
  360. u32 btcoex_period;
  361. u32 btscan_no_stomp;
  362. };
  363. void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv);
  364. void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv);
  365. void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv);
  366. #define OP_INVALID BIT(0)
  367. #define OP_SCANNING BIT(1)
  368. #define OP_LED_ASSOCIATED BIT(2)
  369. #define OP_LED_ON BIT(3)
  370. #define OP_ENABLE_BEACON BIT(4)
  371. #define OP_LED_DEINIT BIT(5)
  372. #define OP_BT_PRIORITY_DETECTED BIT(6)
  373. #define OP_BT_SCAN BIT(7)
  374. #define OP_ANI_RUNNING BIT(8)
  375. #define OP_TSF_RESET BIT(9)
  376. struct ath9k_htc_priv {
  377. struct device *dev;
  378. struct ieee80211_hw *hw;
  379. struct ath_hw *ah;
  380. struct htc_target *htc;
  381. struct wmi *wmi;
  382. u16 fw_version_major;
  383. u16 fw_version_minor;
  384. enum htc_endpoint_id wmi_cmd_ep;
  385. enum htc_endpoint_id beacon_ep;
  386. enum htc_endpoint_id cab_ep;
  387. enum htc_endpoint_id uapsd_ep;
  388. enum htc_endpoint_id mgmt_ep;
  389. enum htc_endpoint_id data_be_ep;
  390. enum htc_endpoint_id data_bk_ep;
  391. enum htc_endpoint_id data_vi_ep;
  392. enum htc_endpoint_id data_vo_ep;
  393. u8 vif_slot;
  394. u8 mon_vif_idx;
  395. u8 sta_slot;
  396. u8 vif_sta_pos[ATH9K_HTC_MAX_VIF];
  397. u8 num_ibss_vif;
  398. u8 num_sta_vif;
  399. u8 num_ap_vif;
  400. u16 op_flags;
  401. u16 curtxpow;
  402. u16 txpowlimit;
  403. u16 nvifs;
  404. u16 nstations;
  405. bool rearm_ani;
  406. bool reconfig_beacon;
  407. unsigned int rxfilter;
  408. struct ath9k_hw_cal_data caldata;
  409. struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
  410. spinlock_t beacon_lock;
  411. struct htc_beacon_config cur_beacon_conf;
  412. struct ath9k_htc_rx rx;
  413. struct ath9k_htc_tx tx;
  414. struct tasklet_struct swba_tasklet;
  415. struct tasklet_struct rx_tasklet;
  416. struct delayed_work ani_work;
  417. struct tasklet_struct tx_failed_tasklet;
  418. struct work_struct ps_work;
  419. struct work_struct fatal_work;
  420. struct mutex htc_pm_lock;
  421. unsigned long ps_usecount;
  422. bool ps_enabled;
  423. bool ps_idle;
  424. struct ath_led radio_led;
  425. struct ath_led assoc_led;
  426. struct ath_led tx_led;
  427. struct ath_led rx_led;
  428. struct delayed_work ath9k_led_blink_work;
  429. int led_on_duration;
  430. int led_off_duration;
  431. int led_on_cnt;
  432. int led_off_cnt;
  433. int beaconq;
  434. int cabq;
  435. int hwq_map[WME_NUM_AC];
  436. struct ath_btcoex btcoex;
  437. struct delayed_work coex_period_work;
  438. struct delayed_work duty_cycle_work;
  439. #ifdef CONFIG_ATH9K_HTC_DEBUGFS
  440. struct ath9k_debug debug;
  441. #endif
  442. struct mutex mutex;
  443. };
  444. static inline void ath_read_cachesize(struct ath_common *common, int *csz)
  445. {
  446. common->bus_ops->read_cachesize(common, csz);
  447. }
  448. void ath9k_htc_reset(struct ath9k_htc_priv *priv);
  449. void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,
  450. struct ieee80211_vif *vif);
  451. void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,
  452. struct ieee80211_vif *vif);
  453. void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv,
  454. struct ieee80211_vif *vif);
  455. void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv);
  456. void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,
  457. struct ieee80211_vif *vif);
  458. void ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv);
  459. void ath9k_htc_swba(struct ath9k_htc_priv *priv,
  460. struct wmi_event_swba *swba);
  461. void ath9k_htc_rxep(void *priv, struct sk_buff *skb,
  462. enum htc_endpoint_id ep_id);
  463. void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
  464. bool txok);
  465. void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
  466. enum htc_endpoint_id ep_id, bool txok);
  467. int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
  468. u8 enable_coex);
  469. void ath9k_htc_station_work(struct work_struct *work);
  470. void ath9k_htc_aggr_work(struct work_struct *work);
  471. void ath9k_htc_ani_work(struct work_struct *work);
  472. void ath9k_htc_start_ani(struct ath9k_htc_priv *priv);
  473. void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);
  474. int ath9k_tx_init(struct ath9k_htc_priv *priv);
  475. int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
  476. struct sk_buff *skb, u8 slot, bool is_cab);
  477. void ath9k_tx_cleanup(struct ath9k_htc_priv *priv);
  478. bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype);
  479. int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv);
  480. int get_hw_qnum(u16 queue, int *hwq_map);
  481. int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
  482. struct ath9k_tx_queue_info *qinfo);
  483. void ath9k_htc_check_stop_queues(struct ath9k_htc_priv *priv);
  484. void ath9k_htc_check_wake_queues(struct ath9k_htc_priv *priv);
  485. int ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv);
  486. void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
  487. void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
  488. void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
  489. void ath9k_htc_tx_failed(struct ath9k_htc_priv *priv);
  490. void ath9k_tx_failed_tasklet(unsigned long data);
  491. void ath9k_htc_tx_cleanup_timer(unsigned long data);
  492. int ath9k_rx_init(struct ath9k_htc_priv *priv);
  493. void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
  494. void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
  495. void ath9k_rx_tasklet(unsigned long data);
  496. u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
  497. void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);
  498. void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
  499. void ath9k_ps_work(struct work_struct *work);
  500. bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
  501. enum ath9k_power_mode mode);
  502. void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
  503. void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
  504. void ath9k_htc_radio_enable(struct ieee80211_hw *hw);
  505. void ath9k_htc_radio_disable(struct ieee80211_hw *hw);
  506. void ath9k_led_stop_brightness(struct ath9k_htc_priv *priv);
  507. void ath9k_init_leds(struct ath9k_htc_priv *priv);
  508. void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
  509. int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
  510. u16 devid, char *product, u32 drv_info);
  511. void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug);
  512. #ifdef CONFIG_PM
  513. void ath9k_htc_suspend(struct htc_target *htc_handle);
  514. int ath9k_htc_resume(struct htc_target *htc_handle);
  515. #endif
  516. #ifdef CONFIG_ATH9K_HTC_DEBUGFS
  517. int ath9k_htc_init_debug(struct ath_hw *ah);
  518. #else
  519. static inline int ath9k_htc_init_debug(struct ath_hw *ah) { return 0; };
  520. #endif /* CONFIG_ATH9K_HTC_DEBUGFS */
  521. #endif /* HTC_H */