htc.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. /*
  2. * Copyright (c) 2010-2011 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/etherdevice.h>
  24. #include <linux/leds.h>
  25. #include <linux/slab.h>
  26. #include <net/mac80211.h>
  27. #include "common.h"
  28. #include "htc_hst.h"
  29. #include "hif_usb.h"
  30. #include "wmi.h"
  31. #define ATH_STA_SHORT_CALINTERVAL 1000 /* 1 second */
  32. #define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */
  33. #define ATH_ANI_POLLINTERVAL 100 /* 100 ms */
  34. #define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */
  35. #define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */
  36. #define ATH_DEFAULT_BMISS_LIMIT 10
  37. #define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024)
  38. #define TSF_TO_TU(_h, _l) \
  39. ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
  40. extern struct ieee80211_ops ath9k_htc_ops;
  41. extern int htc_modparam_nohwcrypt;
  42. enum htc_phymode {
  43. HTC_MODE_11NA = 0,
  44. HTC_MODE_11NG = 1
  45. };
  46. enum htc_opmode {
  47. HTC_M_STA = 1,
  48. HTC_M_IBSS = 0,
  49. HTC_M_AHDEMO = 3,
  50. HTC_M_HOSTAP = 6,
  51. HTC_M_MONITOR = 8,
  52. HTC_M_WDS = 2
  53. };
  54. #define ATH9K_HTC_AMPDU 1
  55. #define ATH9K_HTC_NORMAL 2
  56. #define ATH9K_HTC_BEACON 3
  57. #define ATH9K_HTC_MGMT 4
  58. #define ATH9K_HTC_TX_CTSONLY 0x1
  59. #define ATH9K_HTC_TX_RTSCTS 0x2
  60. struct tx_frame_hdr {
  61. u8 data_type;
  62. u8 node_idx;
  63. u8 vif_idx;
  64. u8 tidno;
  65. __be32 flags; /* ATH9K_HTC_TX_* */
  66. u8 key_type;
  67. u8 keyix;
  68. u8 cookie;
  69. u8 pad;
  70. } __packed;
  71. struct tx_mgmt_hdr {
  72. u8 node_idx;
  73. u8 vif_idx;
  74. u8 tidno;
  75. u8 flags;
  76. u8 key_type;
  77. u8 keyix;
  78. u8 cookie;
  79. u8 pad;
  80. } __packed;
  81. struct tx_beacon_header {
  82. u8 vif_index;
  83. u8 len_changed;
  84. u16 rev;
  85. } __packed;
  86. #define MAX_TX_AMPDU_SUBFRAMES_9271 17
  87. #define MAX_TX_AMPDU_SUBFRAMES_7010 22
  88. struct ath9k_htc_cap_target {
  89. __be32 ampdu_limit;
  90. u8 ampdu_subframes;
  91. u8 enable_coex;
  92. u8 tx_chainmask;
  93. u8 pad;
  94. } __packed;
  95. struct ath9k_htc_target_vif {
  96. u8 index;
  97. u8 opmode;
  98. u8 myaddr[ETH_ALEN];
  99. u8 ath_cap;
  100. __be16 rtsthreshold;
  101. u8 pad;
  102. } __packed;
  103. struct ath9k_htc_target_sta {
  104. u8 macaddr[ETH_ALEN];
  105. u8 bssid[ETH_ALEN];
  106. u8 sta_index;
  107. u8 vif_index;
  108. u8 is_vif_sta;
  109. __be16 flags;
  110. __be16 htcap;
  111. __be16 maxampdu;
  112. u8 pad;
  113. } __packed;
  114. struct ath9k_htc_target_aggr {
  115. u8 sta_index;
  116. u8 tidno;
  117. u8 aggr_enable;
  118. u8 padding;
  119. } __packed;
  120. #define ATH_HTC_RATE_MAX 30
  121. #define WLAN_RC_DS_FLAG 0x01
  122. #define WLAN_RC_40_FLAG 0x02
  123. #define WLAN_RC_SGI_FLAG 0x04
  124. #define WLAN_RC_HT_FLAG 0x08
  125. #define ATH_RC_TX_STBC_FLAG 0x20
  126. struct ath9k_htc_rateset {
  127. u8 rs_nrates;
  128. u8 rs_rates[ATH_HTC_RATE_MAX];
  129. };
  130. struct ath9k_htc_rate {
  131. struct ath9k_htc_rateset legacy_rates;
  132. struct ath9k_htc_rateset ht_rates;
  133. } __packed;
  134. struct ath9k_htc_target_rate {
  135. u8 sta_index;
  136. u8 isnew;
  137. __be32 capflags;
  138. struct ath9k_htc_rate rates;
  139. };
  140. struct ath9k_htc_target_rate_mask {
  141. u8 vif_index;
  142. u8 band;
  143. __be32 mask;
  144. u16 pad;
  145. } __packed;
  146. struct ath9k_htc_target_int_stats {
  147. __be32 rx;
  148. __be32 rxorn;
  149. __be32 rxeol;
  150. __be32 txurn;
  151. __be32 txto;
  152. __be32 cst;
  153. } __packed;
  154. struct ath9k_htc_target_tx_stats {
  155. __be32 xretries;
  156. __be32 fifoerr;
  157. __be32 filtered;
  158. __be32 timer_exp;
  159. __be32 shortretries;
  160. __be32 longretries;
  161. __be32 qnull;
  162. __be32 encap_fail;
  163. __be32 nobuf;
  164. } __packed;
  165. struct ath9k_htc_target_rx_stats {
  166. __be32 nobuf;
  167. __be32 host_send;
  168. __be32 host_done;
  169. } __packed;
  170. #define ATH9K_HTC_MAX_VIF 2
  171. #define ATH9K_HTC_MAX_BCN_VIF 2
  172. #define INC_VIF(_priv, _type) do { \
  173. switch (_type) { \
  174. case NL80211_IFTYPE_STATION: \
  175. _priv->num_sta_vif++; \
  176. break; \
  177. case NL80211_IFTYPE_ADHOC: \
  178. _priv->num_ibss_vif++; \
  179. break; \
  180. case NL80211_IFTYPE_AP: \
  181. _priv->num_ap_vif++; \
  182. break; \
  183. case NL80211_IFTYPE_MESH_POINT: \
  184. _priv->num_mbss_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. case NL80211_IFTYPE_MESH_POINT: \
  202. _priv->num_mbss_vif--; \
  203. break; \
  204. default: \
  205. break; \
  206. } \
  207. } while (0)
  208. struct ath9k_htc_vif {
  209. u8 index;
  210. u16 seq_no;
  211. bool beacon_configured;
  212. int bslot;
  213. __le64 tsfadjust;
  214. };
  215. struct ath9k_vif_iter_data {
  216. const u8 *hw_macaddr;
  217. u8 mask[ETH_ALEN];
  218. };
  219. #define ATH9K_HTC_MAX_STA 8
  220. #define ATH9K_HTC_MAX_TID 8
  221. enum tid_aggr_state {
  222. AGGR_STOP = 0,
  223. AGGR_PROGRESS,
  224. AGGR_START,
  225. AGGR_OPERATIONAL
  226. };
  227. struct ath9k_htc_sta {
  228. u8 index;
  229. enum tid_aggr_state tid_state[ATH9K_HTC_MAX_TID];
  230. };
  231. #define ATH9K_HTC_RXBUF 256
  232. #define HTC_RX_FRAME_HEADER_SIZE 40
  233. struct ath9k_htc_rxbuf {
  234. bool in_process;
  235. struct sk_buff *skb;
  236. struct ath_htc_rx_status rxstatus;
  237. struct list_head list;
  238. };
  239. struct ath9k_htc_rx {
  240. int last_rssi; /* FIXME: per-STA */
  241. struct list_head rxbuf;
  242. spinlock_t rxbuflock;
  243. };
  244. #define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */
  245. #define ATH9K_HTC_TX_TIMEOUT_INTERVAL 3000 /* ms */
  246. #define ATH9K_HTC_TX_RESERVE 10
  247. #define ATH9K_HTC_TX_TIMEOUT_COUNT 40
  248. #define ATH9K_HTC_TX_THRESHOLD (MAX_TX_BUF_NUM - ATH9K_HTC_TX_RESERVE)
  249. #define ATH9K_HTC_OP_TX_QUEUES_STOP BIT(0)
  250. #define ATH9K_HTC_OP_TX_DRAIN BIT(1)
  251. struct ath9k_htc_tx {
  252. u8 flags;
  253. int queued_cnt;
  254. struct sk_buff_head mgmt_ep_queue;
  255. struct sk_buff_head cab_ep_queue;
  256. struct sk_buff_head data_be_queue;
  257. struct sk_buff_head data_bk_queue;
  258. struct sk_buff_head data_vi_queue;
  259. struct sk_buff_head data_vo_queue;
  260. struct sk_buff_head tx_failed;
  261. DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM);
  262. struct timer_list cleanup_timer;
  263. spinlock_t tx_lock;
  264. };
  265. struct ath9k_htc_tx_ctl {
  266. u8 type; /* ATH9K_HTC_* */
  267. u8 epid;
  268. u8 txok;
  269. u8 sta_idx;
  270. unsigned long timestamp;
  271. };
  272. static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)
  273. {
  274. struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
  275. BUILD_BUG_ON(sizeof(struct ath9k_htc_tx_ctl) >
  276. IEEE80211_TX_INFO_DRIVER_DATA_SIZE);
  277. return (struct ath9k_htc_tx_ctl *) &tx_info->driver_data;
  278. }
  279. #ifdef CONFIG_ATH9K_HTC_DEBUGFS
  280. #define TX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c++)
  281. #define TX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c += a)
  282. #define RX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.rx_stats.c++)
  283. #define RX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.rx_stats.c += a)
  284. #define CAB_STAT_INC priv->debug.tx_stats.cab_queued++
  285. #define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)
  286. void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
  287. struct ath_htc_rx_status *rxs);
  288. struct ath_tx_stats {
  289. u32 buf_queued;
  290. u32 buf_completed;
  291. u32 skb_queued;
  292. u32 skb_success;
  293. u32 skb_success_bytes;
  294. u32 skb_failed;
  295. u32 cab_queued;
  296. u32 queue_stats[IEEE80211_NUM_ACS];
  297. };
  298. struct ath_rx_stats {
  299. u32 skb_allocated;
  300. u32 skb_completed;
  301. u32 skb_completed_bytes;
  302. u32 skb_dropped;
  303. u32 err_crc;
  304. u32 err_decrypt_crc;
  305. u32 err_mic;
  306. u32 err_pre_delim;
  307. u32 err_post_delim;
  308. u32 err_decrypt_busy;
  309. u32 err_phy;
  310. u32 err_phy_stats[ATH9K_PHYERR_MAX];
  311. };
  312. struct ath9k_debug {
  313. struct dentry *debugfs_phy;
  314. struct ath_tx_stats tx_stats;
  315. struct ath_rx_stats rx_stats;
  316. };
  317. void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
  318. struct ieee80211_vif *vif,
  319. u32 sset, u8 *data);
  320. int ath9k_htc_get_et_sset_count(struct ieee80211_hw *hw,
  321. struct ieee80211_vif *vif, int sset);
  322. void ath9k_htc_get_et_stats(struct ieee80211_hw *hw,
  323. struct ieee80211_vif *vif,
  324. struct ethtool_stats *stats, u64 *data);
  325. #else
  326. #define TX_STAT_INC(c) do { } while (0)
  327. #define TX_STAT_ADD(c, a) do { } while (0)
  328. #define RX_STAT_INC(c) do { } while (0)
  329. #define RX_STAT_ADD(c, a) do { } while (0)
  330. #define CAB_STAT_INC do { } while (0)
  331. #define TX_QSTAT_INC(c) do { } while (0)
  332. static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
  333. struct ath_htc_rx_status *rxs)
  334. {
  335. }
  336. #endif /* CONFIG_ATH9K_HTC_DEBUGFS */
  337. #define ATH_LED_PIN_DEF 1
  338. #define ATH_LED_PIN_9287 10
  339. #define ATH_LED_PIN_9271 15
  340. #define ATH_LED_PIN_7010 12
  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. #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
  364. void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product);
  365. void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv);
  366. void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv);
  367. #else
  368. static inline void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
  369. {
  370. }
  371. static inline void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv)
  372. {
  373. }
  374. static inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
  375. {
  376. }
  377. #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
  378. #define OP_INVALID BIT(0)
  379. #define OP_SCANNING BIT(1)
  380. #define OP_ENABLE_BEACON BIT(2)
  381. #define OP_BT_PRIORITY_DETECTED BIT(3)
  382. #define OP_BT_SCAN BIT(4)
  383. #define OP_ANI_RUNNING BIT(5)
  384. #define OP_TSF_RESET BIT(6)
  385. struct ath9k_htc_priv {
  386. struct device *dev;
  387. struct ieee80211_hw *hw;
  388. struct ath_hw *ah;
  389. struct htc_target *htc;
  390. struct wmi *wmi;
  391. u16 fw_version_major;
  392. u16 fw_version_minor;
  393. enum htc_endpoint_id wmi_cmd_ep;
  394. enum htc_endpoint_id beacon_ep;
  395. enum htc_endpoint_id cab_ep;
  396. enum htc_endpoint_id uapsd_ep;
  397. enum htc_endpoint_id mgmt_ep;
  398. enum htc_endpoint_id data_be_ep;
  399. enum htc_endpoint_id data_bk_ep;
  400. enum htc_endpoint_id data_vi_ep;
  401. enum htc_endpoint_id data_vo_ep;
  402. u8 vif_slot;
  403. u8 mon_vif_idx;
  404. u8 sta_slot;
  405. u8 vif_sta_pos[ATH9K_HTC_MAX_VIF];
  406. u8 num_ibss_vif;
  407. u8 num_mbss_vif;
  408. u8 num_sta_vif;
  409. u8 num_sta_assoc_vif;
  410. u8 num_ap_vif;
  411. u16 curtxpow;
  412. u16 txpowlimit;
  413. u16 nvifs;
  414. u16 nstations;
  415. bool rearm_ani;
  416. bool reconfig_beacon;
  417. unsigned int rxfilter;
  418. unsigned long op_flags;
  419. struct ath9k_hw_cal_data caldata;
  420. struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
  421. spinlock_t beacon_lock;
  422. struct htc_beacon_config cur_beacon_conf;
  423. struct ath9k_htc_rx rx;
  424. struct ath9k_htc_tx tx;
  425. struct tasklet_struct swba_tasklet;
  426. struct tasklet_struct rx_tasklet;
  427. struct delayed_work ani_work;
  428. struct tasklet_struct tx_failed_tasklet;
  429. struct work_struct ps_work;
  430. struct work_struct fatal_work;
  431. struct mutex htc_pm_lock;
  432. unsigned long ps_usecount;
  433. bool ps_enabled;
  434. bool ps_idle;
  435. #ifdef CONFIG_MAC80211_LEDS
  436. enum led_brightness brightness;
  437. bool led_registered;
  438. char led_name[32];
  439. struct led_classdev led_cdev;
  440. struct work_struct led_work;
  441. #endif
  442. int beaconq;
  443. int cabq;
  444. int hwq_map[IEEE80211_NUM_ACS];
  445. #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
  446. struct ath_btcoex btcoex;
  447. #endif
  448. struct delayed_work coex_period_work;
  449. struct delayed_work duty_cycle_work;
  450. #ifdef CONFIG_ATH9K_HTC_DEBUGFS
  451. struct ath9k_debug debug;
  452. #endif
  453. struct mutex mutex;
  454. };
  455. static inline void ath_read_cachesize(struct ath_common *common, int *csz)
  456. {
  457. common->bus_ops->read_cachesize(common, csz);
  458. }
  459. void ath9k_htc_reset(struct ath9k_htc_priv *priv);
  460. void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,
  461. struct ieee80211_vif *vif);
  462. void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,
  463. struct ieee80211_vif *vif);
  464. void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv,
  465. struct ieee80211_vif *vif);
  466. void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv);
  467. void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,
  468. struct ieee80211_vif *vif);
  469. void ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv);
  470. void ath9k_htc_swba(struct ath9k_htc_priv *priv,
  471. struct wmi_event_swba *swba);
  472. void ath9k_htc_rxep(void *priv, struct sk_buff *skb,
  473. enum htc_endpoint_id ep_id);
  474. void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
  475. bool txok);
  476. void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
  477. enum htc_endpoint_id ep_id, bool txok);
  478. int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
  479. u8 enable_coex);
  480. void ath9k_htc_ani_work(struct work_struct *work);
  481. void ath9k_htc_start_ani(struct ath9k_htc_priv *priv);
  482. void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);
  483. int ath9k_tx_init(struct ath9k_htc_priv *priv);
  484. int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
  485. struct ieee80211_sta *sta,
  486. struct sk_buff *skb, u8 slot, bool is_cab);
  487. void ath9k_tx_cleanup(struct ath9k_htc_priv *priv);
  488. bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype);
  489. int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv);
  490. int get_hw_qnum(u16 queue, int *hwq_map);
  491. int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
  492. struct ath9k_tx_queue_info *qinfo);
  493. void ath9k_htc_check_stop_queues(struct ath9k_htc_priv *priv);
  494. void ath9k_htc_check_wake_queues(struct ath9k_htc_priv *priv);
  495. int ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv);
  496. void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
  497. void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
  498. void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
  499. void ath9k_tx_failed_tasklet(unsigned long data);
  500. void ath9k_htc_tx_cleanup_timer(unsigned long data);
  501. int ath9k_rx_init(struct ath9k_htc_priv *priv);
  502. void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
  503. void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
  504. void ath9k_rx_tasklet(unsigned long data);
  505. u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
  506. void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);
  507. void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
  508. void ath9k_ps_work(struct work_struct *work);
  509. bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
  510. enum ath9k_power_mode mode);
  511. void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
  512. void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
  513. struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);
  514. #ifdef CONFIG_MAC80211_LEDS
  515. void ath9k_init_leds(struct ath9k_htc_priv *priv);
  516. void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
  517. void ath9k_led_work(struct work_struct *work);
  518. #else
  519. static inline void ath9k_init_leds(struct ath9k_htc_priv *priv)
  520. {
  521. }
  522. static inline void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
  523. {
  524. }
  525. static inline void ath9k_led_work(struct work_struct *work)
  526. {
  527. }
  528. #endif
  529. int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
  530. u16 devid, char *product, u32 drv_info);
  531. void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug);
  532. #ifdef CONFIG_PM
  533. void ath9k_htc_suspend(struct htc_target *htc_handle);
  534. int ath9k_htc_resume(struct htc_target *htc_handle);
  535. #endif
  536. #ifdef CONFIG_ATH9K_HTC_DEBUGFS
  537. int ath9k_htc_init_debug(struct ath_hw *ah);
  538. #else
  539. static inline int ath9k_htc_init_debug(struct ath_hw *ah) { return 0; };
  540. #endif /* CONFIG_ATH9K_HTC_DEBUGFS */
  541. #endif /* HTC_H */