htc.h 16 KB

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