htc.h 15 KB

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