core.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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 CORE_H
  17. #define CORE_H
  18. #include <linux/etherdevice.h>
  19. #include <linux/rtnetlink.h>
  20. #include <linux/firmware.h>
  21. #include <linux/sched.h>
  22. #include <linux/circ_buf.h>
  23. #include <net/cfg80211.h>
  24. #include "htc.h"
  25. #include "wmi.h"
  26. #include "bmi.h"
  27. #include "target.h"
  28. #define MAX_ATH6KL 1
  29. #define ATH6KL_MAX_RX_BUFFERS 16
  30. #define ATH6KL_BUFFER_SIZE 1664
  31. #define ATH6KL_MAX_AMSDU_RX_BUFFERS 4
  32. #define ATH6KL_AMSDU_REFILL_THRESHOLD 3
  33. #define ATH6KL_AMSDU_BUFFER_SIZE (WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH + 128)
  34. #define MAX_MSDU_SUBFRAME_PAYLOAD_LEN 1508
  35. #define MIN_MSDU_SUBFRAME_PAYLOAD_LEN 46
  36. #define USER_SAVEDKEYS_STAT_INIT 0
  37. #define USER_SAVEDKEYS_STAT_RUN 1
  38. #define ATH6KL_TX_TIMEOUT 10
  39. #define ATH6KL_MAX_ENDPOINTS 4
  40. #define MAX_NODE_NUM 15
  41. /* Extra bytes for htc header alignment */
  42. #define ATH6KL_HTC_ALIGN_BYTES 3
  43. /* MAX_HI_COOKIE_NUM are reserved for high priority traffic */
  44. #define MAX_DEF_COOKIE_NUM 180
  45. #define MAX_HI_COOKIE_NUM 18 /* 10% of MAX_COOKIE_NUM */
  46. #define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NUM)
  47. #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC)
  48. #define DISCON_TIMER_INTVAL 10000 /* in msec */
  49. #define A_DEFAULT_LISTEN_INTERVAL 100
  50. #define A_MAX_WOW_LISTEN_INTERVAL 1000
  51. /* includes also the null byte */
  52. #define ATH6KL_FIRMWARE_MAGIC "QCA-ATH6KL"
  53. enum ath6kl_fw_ie_type {
  54. ATH6KL_FW_IE_FW_VERSION = 0,
  55. ATH6KL_FW_IE_TIMESTAMP = 1,
  56. ATH6KL_FW_IE_OTP_IMAGE = 2,
  57. ATH6KL_FW_IE_FW_IMAGE = 3,
  58. ATH6KL_FW_IE_PATCH_IMAGE = 4,
  59. ATH6KL_FW_IE_RESERVED_RAM_SIZE = 5,
  60. ATH6KL_FW_IE_CAPABILITIES = 6,
  61. };
  62. enum ath6kl_fw_capability {
  63. ATH6KL_FW_CAPABILITY_HOST_P2P = 0,
  64. /* this needs to be last */
  65. ATH6KL_FW_CAPABILITY_MAX,
  66. };
  67. #define ATH6KL_CAPABILITY_LEN (ALIGN(ATH6KL_FW_CAPABILITY_MAX, 32) / 32)
  68. struct ath6kl_fw_ie {
  69. __le32 id;
  70. __le32 len;
  71. u8 data[0];
  72. };
  73. /* AR6003 1.0 definitions */
  74. #define AR6003_REV1_VERSION 0x300002ba
  75. /* AR6003 2.0 definitions */
  76. #define AR6003_REV2_VERSION 0x30000384
  77. #define AR6003_REV2_PATCH_DOWNLOAD_ADDRESS 0x57e910
  78. #define AR6003_REV2_OTP_FILE "ath6k/AR6003/hw2.0/otp.bin.z77"
  79. #define AR6003_REV2_FIRMWARE_FILE "ath6k/AR6003/hw2.0/athwlan.bin.z77"
  80. #define AR6003_REV2_TCMD_FIRMWARE_FILE "ath6k/AR6003/hw2.0/athtcmd_ram.bin"
  81. #define AR6003_REV2_PATCH_FILE "ath6k/AR6003/hw2.0/data.patch.bin"
  82. #define AR6003_REV2_FIRMWARE_2_FILE "ath6k/AR6003/hw2.0/fw-2.bin"
  83. #define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.bin"
  84. #define AR6003_REV2_DEFAULT_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.SD31.bin"
  85. /* AR6003 3.0 definitions */
  86. #define AR6003_REV3_VERSION 0x30000582
  87. #define AR6003_REV3_OTP_FILE "ath6k/AR6003/hw2.1.1/otp.bin"
  88. #define AR6003_REV3_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athwlan.bin"
  89. #define AR6003_REV3_TCMD_FIRMWARE_FILE "ath6k/AR6003/hw2.1.1/athtcmd_ram.bin"
  90. #define AR6003_REV3_PATCH_FILE "ath6k/AR6003/hw2.1.1/data.patch.bin"
  91. #define AR6003_REV3_FIRMWARE_2_FILE "ath6k/AR6003/hw2.1.1/fw-2.bin"
  92. #define AR6003_REV3_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.bin"
  93. #define AR6003_REV3_DEFAULT_BOARD_DATA_FILE \
  94. "ath6k/AR6003/hw2.1.1/bdata.SD31.bin"
  95. /* AR6004 1.0 definitions */
  96. #define AR6004_REV1_VERSION 0x30000623
  97. #define AR6004_REV1_FIRMWARE_FILE "ath6k/AR6004/hw6.1/fw.ram.bin"
  98. #define AR6004_REV1_FIRMWARE_2_FILE "ath6k/AR6004/hw6.1/fw-2.bin"
  99. #define AR6004_REV1_BOARD_DATA_FILE "ath6k/AR6004/hw6.1/bdata.bin"
  100. #define AR6004_REV1_DEFAULT_BOARD_DATA_FILE "ath6k/AR6004/hw6.1/bdata.DB132.bin"
  101. #define AR6004_REV1_EPPING_FIRMWARE_FILE "ath6k/AR6004/hw6.1/endpointping.bin"
  102. /* Per STA data, used in AP mode */
  103. #define STA_PS_AWAKE BIT(0)
  104. #define STA_PS_SLEEP BIT(1)
  105. #define STA_PS_POLLED BIT(2)
  106. /* HTC TX packet tagging definitions */
  107. #define ATH6KL_CONTROL_PKT_TAG HTC_TX_PACKET_TAG_USER_DEFINED
  108. #define ATH6KL_DATA_PKT_TAG (ATH6KL_CONTROL_PKT_TAG + 1)
  109. #define AR6003_CUST_DATA_SIZE 16
  110. #define AGGR_WIN_IDX(x, y) ((x) % (y))
  111. #define AGGR_INCR_IDX(x, y) AGGR_WIN_IDX(((x) + 1), (y))
  112. #define AGGR_DCRM_IDX(x, y) AGGR_WIN_IDX(((x) - 1), (y))
  113. #define ATH6KL_MAX_SEQ_NO 0xFFF
  114. #define ATH6KL_NEXT_SEQ_NO(x) (((x) + 1) & ATH6KL_MAX_SEQ_NO)
  115. #define NUM_OF_TIDS 8
  116. #define AGGR_SZ_DEFAULT 8
  117. #define AGGR_WIN_SZ_MIN 2
  118. #define AGGR_WIN_SZ_MAX 8
  119. #define TID_WINDOW_SZ(_x) ((_x) << 1)
  120. #define AGGR_NUM_OF_FREE_NETBUFS 16
  121. #define AGGR_RX_TIMEOUT 400 /* in ms */
  122. #define WMI_TIMEOUT (2 * HZ)
  123. #define MBOX_YIELD_LIMIT 99
  124. /* configuration lags */
  125. /*
  126. * ATH6KL_CONF_IGNORE_ERP_BARKER: Ignore the barker premable in
  127. * ERP IE of beacon to determine the short premable support when
  128. * sending (Re)Assoc req.
  129. * ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN: Don't send the power
  130. * module state transition failure events which happen during
  131. * scan, to the host.
  132. */
  133. #define ATH6KL_CONF_IGNORE_ERP_BARKER BIT(0)
  134. #define ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN BIT(1)
  135. #define ATH6KL_CONF_ENABLE_11N BIT(2)
  136. #define ATH6KL_CONF_ENABLE_TX_BURST BIT(3)
  137. enum wlan_low_pwr_state {
  138. WLAN_POWER_STATE_ON,
  139. WLAN_POWER_STATE_CUT_PWR,
  140. WLAN_POWER_STATE_DEEP_SLEEP,
  141. WLAN_POWER_STATE_WOW
  142. };
  143. enum sme_state {
  144. SME_DISCONNECTED,
  145. SME_CONNECTING,
  146. SME_CONNECTED
  147. };
  148. struct skb_hold_q {
  149. struct sk_buff *skb;
  150. bool is_amsdu;
  151. u16 seq_no;
  152. };
  153. struct rxtid {
  154. bool aggr;
  155. bool progress;
  156. bool timer_mon;
  157. u16 win_sz;
  158. u16 seq_next;
  159. u32 hold_q_sz;
  160. struct skb_hold_q *hold_q;
  161. struct sk_buff_head q;
  162. spinlock_t lock;
  163. };
  164. struct rxtid_stats {
  165. u32 num_into_aggr;
  166. u32 num_dups;
  167. u32 num_oow;
  168. u32 num_mpdu;
  169. u32 num_amsdu;
  170. u32 num_delivered;
  171. u32 num_timeouts;
  172. u32 num_hole;
  173. u32 num_bar;
  174. };
  175. struct aggr_info {
  176. u8 aggr_sz;
  177. u8 timer_scheduled;
  178. struct timer_list timer;
  179. struct net_device *dev;
  180. struct rxtid rx_tid[NUM_OF_TIDS];
  181. struct sk_buff_head free_q;
  182. struct rxtid_stats stat[NUM_OF_TIDS];
  183. };
  184. struct ath6kl_wep_key {
  185. u8 key_index;
  186. u8 key_len;
  187. u8 key[64];
  188. };
  189. #define ATH6KL_KEY_SEQ_LEN 8
  190. struct ath6kl_key {
  191. u8 key[WLAN_MAX_KEY_LEN];
  192. u8 key_len;
  193. u8 seq[ATH6KL_KEY_SEQ_LEN];
  194. u8 seq_len;
  195. u32 cipher;
  196. };
  197. struct ath6kl_node_mapping {
  198. u8 mac_addr[ETH_ALEN];
  199. u8 ep_id;
  200. u8 tx_pend;
  201. };
  202. struct ath6kl_cookie {
  203. struct sk_buff *skb;
  204. u32 map_no;
  205. struct htc_packet htc_pkt;
  206. struct ath6kl_cookie *arc_list_next;
  207. };
  208. struct ath6kl_sta {
  209. u16 sta_flags;
  210. u8 mac[ETH_ALEN];
  211. u8 aid;
  212. u8 keymgmt;
  213. u8 ucipher;
  214. u8 auth;
  215. u8 wpa_ie[ATH6KL_MAX_IE];
  216. struct sk_buff_head psq;
  217. spinlock_t psq_lock;
  218. };
  219. struct ath6kl_version {
  220. u32 target_ver;
  221. u32 wlan_ver;
  222. u32 abi_ver;
  223. };
  224. struct ath6kl_bmi {
  225. u32 cmd_credits;
  226. bool done_sent;
  227. u8 *cmd_buf;
  228. };
  229. struct target_stats {
  230. u64 tx_pkt;
  231. u64 tx_byte;
  232. u64 tx_ucast_pkt;
  233. u64 tx_ucast_byte;
  234. u64 tx_mcast_pkt;
  235. u64 tx_mcast_byte;
  236. u64 tx_bcast_pkt;
  237. u64 tx_bcast_byte;
  238. u64 tx_rts_success_cnt;
  239. u64 tx_pkt_per_ac[4];
  240. u64 tx_err;
  241. u64 tx_fail_cnt;
  242. u64 tx_retry_cnt;
  243. u64 tx_mult_retry_cnt;
  244. u64 tx_rts_fail_cnt;
  245. u64 rx_pkt;
  246. u64 rx_byte;
  247. u64 rx_ucast_pkt;
  248. u64 rx_ucast_byte;
  249. u64 rx_mcast_pkt;
  250. u64 rx_mcast_byte;
  251. u64 rx_bcast_pkt;
  252. u64 rx_bcast_byte;
  253. u64 rx_frgment_pkt;
  254. u64 rx_err;
  255. u64 rx_crc_err;
  256. u64 rx_key_cache_miss;
  257. u64 rx_decrypt_err;
  258. u64 rx_dupl_frame;
  259. u64 tkip_local_mic_fail;
  260. u64 tkip_cnter_measures_invoked;
  261. u64 tkip_replays;
  262. u64 tkip_fmt_err;
  263. u64 ccmp_fmt_err;
  264. u64 ccmp_replays;
  265. u64 pwr_save_fail_cnt;
  266. u64 cs_bmiss_cnt;
  267. u64 cs_low_rssi_cnt;
  268. u64 cs_connect_cnt;
  269. u64 cs_discon_cnt;
  270. s32 tx_ucast_rate;
  271. s32 rx_ucast_rate;
  272. u32 lq_val;
  273. u32 wow_pkt_dropped;
  274. u16 wow_evt_discarded;
  275. s16 noise_floor_calib;
  276. s16 cs_rssi;
  277. s16 cs_ave_beacon_rssi;
  278. u8 cs_ave_beacon_snr;
  279. u8 cs_last_roam_msec;
  280. u8 cs_snr;
  281. u8 wow_host_pkt_wakeups;
  282. u8 wow_host_evt_wakeups;
  283. u32 arp_received;
  284. u32 arp_matched;
  285. u32 arp_replied;
  286. };
  287. struct ath6kl_mbox_info {
  288. u32 htc_addr;
  289. u32 htc_ext_addr;
  290. u32 htc_ext_sz;
  291. u32 block_size;
  292. u32 gmbox_addr;
  293. u32 gmbox_sz;
  294. };
  295. /*
  296. * 802.11i defines an extended IV for use with non-WEP ciphers.
  297. * When the EXTIV bit is set in the key id byte an additional
  298. * 4 bytes immediately follow the IV for TKIP. For CCMP the
  299. * EXTIV bit is likewise set but the 8 bytes represent the
  300. * CCMP header rather than IV+extended-IV.
  301. */
  302. #define ATH6KL_KEYBUF_SIZE 16
  303. #define ATH6KL_MICBUF_SIZE (8+8) /* space for both tx and rx */
  304. #define ATH6KL_KEY_XMIT 0x01
  305. #define ATH6KL_KEY_RECV 0x02
  306. #define ATH6KL_KEY_DEFAULT 0x80 /* default xmit key */
  307. /* Initial group key for AP mode */
  308. struct ath6kl_req_key {
  309. bool valid;
  310. u8 key_index;
  311. int key_type;
  312. u8 key[WLAN_MAX_KEY_LEN];
  313. u8 key_len;
  314. };
  315. /* Flag info */
  316. #define WMI_ENABLED 0
  317. #define WMI_READY 1
  318. #define CONNECTED 2
  319. #define STATS_UPDATE_PEND 3
  320. #define CONNECT_PEND 4
  321. #define WMM_ENABLED 5
  322. #define NETQ_STOPPED 6
  323. #define WMI_CTRL_EP_FULL 7
  324. #define DTIM_EXPIRED 8
  325. #define DESTROY_IN_PROGRESS 9
  326. #define NETDEV_REGISTERED 10
  327. #define SKIP_SCAN 11
  328. #define WLAN_ENABLED 12
  329. #define TESTMODE 13
  330. struct ath6kl {
  331. struct device *dev;
  332. struct net_device *net_dev;
  333. struct ath6kl_bmi bmi;
  334. const struct ath6kl_hif_ops *hif_ops;
  335. struct wmi *wmi;
  336. int tx_pending[ENDPOINT_MAX];
  337. int total_tx_data_pend;
  338. struct htc_target *htc_target;
  339. void *hif_priv;
  340. spinlock_t lock;
  341. struct semaphore sem;
  342. int ssid_len;
  343. u8 ssid[IEEE80211_MAX_SSID_LEN];
  344. u8 next_mode;
  345. u8 nw_type;
  346. u8 dot11_auth_mode;
  347. u8 auth_mode;
  348. u8 prwise_crypto;
  349. u8 prwise_crypto_len;
  350. u8 grp_crypto;
  351. u8 grp_crypto_len;
  352. u8 def_txkey_index;
  353. struct ath6kl_wep_key wep_key_list[WMI_MAX_KEY_INDEX + 1];
  354. u8 bssid[ETH_ALEN];
  355. u8 req_bssid[ETH_ALEN];
  356. u16 ch_hint;
  357. u16 bss_ch;
  358. u16 listen_intvl_b;
  359. u16 listen_intvl_t;
  360. u8 lrssi_roam_threshold;
  361. struct ath6kl_version version;
  362. u32 target_type;
  363. u8 tx_pwr;
  364. struct net_device_stats net_stats;
  365. struct target_stats target_stats;
  366. struct ath6kl_node_mapping node_map[MAX_NODE_NUM];
  367. u8 ibss_ps_enable;
  368. u8 node_num;
  369. u8 next_ep_id;
  370. struct ath6kl_cookie *cookie_list;
  371. u32 cookie_count;
  372. enum htc_endpoint_id ac2ep_map[WMM_NUM_AC];
  373. bool ac_stream_active[WMM_NUM_AC];
  374. u8 ac_stream_pri_map[WMM_NUM_AC];
  375. u8 hiac_stream_active_pri;
  376. u8 ep2ac_map[ENDPOINT_MAX];
  377. enum htc_endpoint_id ctrl_ep;
  378. struct htc_credit_state_info credit_state_info;
  379. u32 connect_ctrl_flags;
  380. u32 user_key_ctrl;
  381. u8 usr_bss_filter;
  382. struct ath6kl_sta sta_list[AP_MAX_NUM_STA];
  383. u8 sta_list_index;
  384. struct ath6kl_req_key ap_mode_bkey;
  385. struct sk_buff_head mcastpsq;
  386. spinlock_t mcastpsq_lock;
  387. u8 intra_bss;
  388. struct aggr_info *aggr_cntxt;
  389. struct wmi_ap_mode_stat ap_stats;
  390. u8 ap_country_code[3];
  391. struct list_head amsdu_rx_buffer_queue;
  392. struct timer_list disconnect_timer;
  393. u8 rx_meta_ver;
  394. struct wireless_dev *wdev;
  395. struct cfg80211_scan_request *scan_req;
  396. struct ath6kl_key keys[WMI_MAX_KEY_INDEX + 1];
  397. enum sme_state sme_state;
  398. enum wlan_low_pwr_state wlan_pwr_state;
  399. struct wmi_scan_params_cmd sc_params;
  400. #define AR_MCAST_FILTER_MAC_ADDR_SIZE 4
  401. u8 auto_auth_stage;
  402. struct {
  403. void *rx_report;
  404. size_t rx_report_len;
  405. } tm;
  406. struct {
  407. u32 dataset_patch_addr;
  408. u32 app_load_addr;
  409. u32 app_start_override_addr;
  410. u32 board_ext_data_addr;
  411. u32 reserved_ram_size;
  412. } hw;
  413. u16 conf_flags;
  414. wait_queue_head_t event_wq;
  415. struct ath6kl_mbox_info mbox_info;
  416. struct ath6kl_cookie cookie_mem[MAX_COOKIE_NUM];
  417. int reconnect_flag;
  418. unsigned long flag;
  419. u8 *fw_board;
  420. size_t fw_board_len;
  421. u8 *fw_otp;
  422. size_t fw_otp_len;
  423. u8 *fw;
  424. size_t fw_len;
  425. u8 *fw_patch;
  426. size_t fw_patch_len;
  427. unsigned long fw_capabilities[ATH6KL_CAPABILITY_LEN];
  428. struct workqueue_struct *ath6kl_wq;
  429. struct ath6kl_node_table scan_table;
  430. struct dentry *debugfs_phy;
  431. u32 send_action_id;
  432. bool probe_req_report;
  433. u16 next_chan;
  434. bool p2p;
  435. #ifdef CONFIG_ATH6KL_DEBUG
  436. struct {
  437. struct circ_buf fwlog_buf;
  438. spinlock_t fwlog_lock;
  439. void *fwlog_tmp;
  440. u32 fwlog_mask;
  441. unsigned int dbgfs_diag_reg;
  442. u32 diag_reg_addr_wr;
  443. u32 diag_reg_val_wr;
  444. } debug;
  445. #endif /* CONFIG_ATH6KL_DEBUG */
  446. };
  447. static inline void *ath6kl_priv(struct net_device *dev)
  448. {
  449. return wdev_priv(dev->ieee80211_ptr);
  450. }
  451. static inline void ath6kl_deposit_credit_to_ep(struct htc_credit_state_info
  452. *cred_info,
  453. struct htc_endpoint_credit_dist
  454. *ep_dist, int credits)
  455. {
  456. ep_dist->credits += credits;
  457. ep_dist->cred_assngd += credits;
  458. cred_info->cur_free_credits -= credits;
  459. }
  460. static inline u32 ath6kl_get_hi_item_addr(struct ath6kl *ar,
  461. u32 item_offset)
  462. {
  463. u32 addr = 0;
  464. if (ar->target_type == TARGET_TYPE_AR6003)
  465. addr = ATH6KL_AR6003_HI_START_ADDR + item_offset;
  466. else if (ar->target_type == TARGET_TYPE_AR6004)
  467. addr = ATH6KL_AR6004_HI_START_ADDR + item_offset;
  468. return addr;
  469. }
  470. void ath6kl_destroy(struct net_device *dev, unsigned int unregister);
  471. int ath6kl_configure_target(struct ath6kl *ar);
  472. void ath6kl_detect_error(unsigned long ptr);
  473. void disconnect_timer_handler(unsigned long ptr);
  474. void init_netdev(struct net_device *dev);
  475. void ath6kl_cookie_init(struct ath6kl *ar);
  476. void ath6kl_cookie_cleanup(struct ath6kl *ar);
  477. void ath6kl_rx(struct htc_target *target, struct htc_packet *packet);
  478. void ath6kl_tx_complete(void *context, struct list_head *packet_queue);
  479. enum htc_send_full_action ath6kl_tx_queue_full(struct htc_target *target,
  480. struct htc_packet *packet);
  481. void ath6kl_stop_txrx(struct ath6kl *ar);
  482. void ath6kl_cleanup_amsdu_rxbufs(struct ath6kl *ar);
  483. int ath6kl_diag_write32(struct ath6kl *ar, u32 address, __le32 value);
  484. int ath6kl_diag_write(struct ath6kl *ar, u32 address, void *data, u32 length);
  485. int ath6kl_diag_read32(struct ath6kl *ar, u32 address, u32 *value);
  486. int ath6kl_diag_read(struct ath6kl *ar, u32 address, void *data, u32 length);
  487. int ath6kl_read_fwlogs(struct ath6kl *ar);
  488. void ath6kl_init_profile_info(struct ath6kl *ar);
  489. void ath6kl_tx_data_cleanup(struct ath6kl *ar);
  490. void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile,
  491. bool get_dbglogs);
  492. struct ath6kl_cookie *ath6kl_alloc_cookie(struct ath6kl *ar);
  493. void ath6kl_free_cookie(struct ath6kl *ar, struct ath6kl_cookie *cookie);
  494. int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev);
  495. struct aggr_info *aggr_init(struct net_device *dev);
  496. void ath6kl_rx_refill(struct htc_target *target,
  497. enum htc_endpoint_id endpoint);
  498. void ath6kl_refill_amsdu_rxbufs(struct ath6kl *ar, int count);
  499. struct htc_packet *ath6kl_alloc_amsdu_rxbuf(struct htc_target *target,
  500. enum htc_endpoint_id endpoint,
  501. int len);
  502. void aggr_module_destroy(struct aggr_info *aggr_info);
  503. void aggr_reset_state(struct aggr_info *aggr_info);
  504. struct ath6kl_sta *ath6kl_find_sta(struct ath6kl *ar, u8 * node_addr);
  505. struct ath6kl_sta *ath6kl_find_sta_by_aid(struct ath6kl *ar, u8 aid);
  506. void ath6kl_ready_event(void *devt, u8 * datap, u32 sw_ver, u32 abi_ver);
  507. int ath6kl_control_tx(void *devt, struct sk_buff *skb,
  508. enum htc_endpoint_id eid);
  509. void ath6kl_connect_event(struct ath6kl *ar, u16 channel,
  510. u8 *bssid, u16 listen_int,
  511. u16 beacon_int, enum network_type net_type,
  512. u8 beacon_ie_len, u8 assoc_req_len,
  513. u8 assoc_resp_len, u8 *assoc_info);
  514. void ath6kl_connect_ap_mode_bss(struct ath6kl *ar, u16 channel);
  515. void ath6kl_connect_ap_mode_sta(struct ath6kl *ar, u16 aid, u8 *mac_addr,
  516. u8 keymgmt, u8 ucipher, u8 auth,
  517. u8 assoc_req_len, u8 *assoc_info);
  518. void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason,
  519. u8 *bssid, u8 assoc_resp_len,
  520. u8 *assoc_info, u16 prot_reason_status);
  521. void ath6kl_tkip_micerr_event(struct ath6kl *ar, u8 keyid, bool ismcast);
  522. void ath6kl_txpwr_rx_evt(void *devt, u8 tx_pwr);
  523. void ath6kl_scan_complete_evt(struct ath6kl *ar, int status);
  524. void ath6kl_tgt_stats_event(struct ath6kl *ar, u8 *ptr, u32 len);
  525. void ath6kl_indicate_tx_activity(void *devt, u8 traffic_class, bool active);
  526. enum htc_endpoint_id ath6kl_ac2_endpoint_id(void *devt, u8 ac);
  527. void ath6kl_pspoll_event(struct ath6kl *ar, u8 aid);
  528. void ath6kl_dtimexpiry_event(struct ath6kl *ar);
  529. void ath6kl_disconnect(struct ath6kl *ar);
  530. void ath6kl_deep_sleep_enable(struct ath6kl *ar);
  531. void aggr_recv_delba_req_evt(struct ath6kl *ar, u8 tid);
  532. void aggr_recv_addba_req_evt(struct ath6kl *ar, u8 tid, u16 seq_no,
  533. u8 win_sz);
  534. void ath6kl_wakeup_event(void *dev);
  535. void ath6kl_target_failure(struct ath6kl *ar);
  536. void ath6kl_cfg80211_scan_node(struct wiphy *wiphy, struct bss *ni);
  537. #endif /* CORE_H */