acx.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. /*
  2. * This file is part of wl18xx
  3. *
  4. * Copyright (C) 2011 Texas Instruments. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #ifndef __WL18XX_ACX_H__
  22. #define __WL18XX_ACX_H__
  23. #include "../wlcore/wlcore.h"
  24. #include "../wlcore/acx.h"
  25. enum {
  26. ACX_CLEAR_STATISTICS = 0x0047,
  27. };
  28. /* numbers of bits the length field takes (add 1 for the actual number) */
  29. #define WL18XX_HOST_IF_LEN_SIZE_FIELD 15
  30. #define WL18XX_ACX_EVENTS_VECTOR (WL1271_ACX_INTR_WATCHDOG | \
  31. WL1271_ACX_INTR_INIT_COMPLETE | \
  32. WL1271_ACX_INTR_EVENT_A | \
  33. WL1271_ACX_INTR_EVENT_B | \
  34. WL1271_ACX_INTR_CMD_COMPLETE | \
  35. WL1271_ACX_INTR_HW_AVAILABLE | \
  36. WL1271_ACX_INTR_DATA | \
  37. WL1271_ACX_SW_INTR_WATCHDOG)
  38. #define WL18XX_INTR_MASK (WL1271_ACX_INTR_WATCHDOG | \
  39. WL1271_ACX_INTR_EVENT_A | \
  40. WL1271_ACX_INTR_EVENT_B | \
  41. WL1271_ACX_INTR_HW_AVAILABLE | \
  42. WL1271_ACX_INTR_DATA | \
  43. WL1271_ACX_SW_INTR_WATCHDOG)
  44. struct wl18xx_acx_host_config_bitmap {
  45. struct acx_header header;
  46. __le32 host_cfg_bitmap;
  47. __le32 host_sdio_block_size;
  48. /* extra mem blocks per frame in TX. */
  49. __le32 extra_mem_blocks;
  50. /*
  51. * number of bits of the length field in the first TX word
  52. * (up to 15 - for using the entire 16 bits).
  53. */
  54. __le32 length_field_size;
  55. } __packed;
  56. enum {
  57. CHECKSUM_OFFLOAD_DISABLED = 0,
  58. CHECKSUM_OFFLOAD_ENABLED = 1,
  59. CHECKSUM_OFFLOAD_FAKE_RX = 2,
  60. CHECKSUM_OFFLOAD_INVALID = 0xFF
  61. };
  62. struct wl18xx_acx_checksum_state {
  63. struct acx_header header;
  64. /* enum acx_checksum_state */
  65. u8 checksum_state;
  66. u8 pad[3];
  67. } __packed;
  68. struct wl18xx_acx_error_stats {
  69. u32 error_frame;
  70. u32 error_null_Frame_tx_start;
  71. u32 error_numll_frame_cts_start;
  72. u32 error_bar_retry;
  73. u32 error_frame_cts_nul_flid;
  74. } __packed;
  75. struct wl18xx_acx_debug_stats {
  76. u32 debug1;
  77. u32 debug2;
  78. u32 debug3;
  79. u32 debug4;
  80. u32 debug5;
  81. u32 debug6;
  82. } __packed;
  83. struct wl18xx_acx_ring_stats {
  84. u32 prepared_descs;
  85. u32 tx_cmplt;
  86. } __packed;
  87. struct wl18xx_acx_tx_stats {
  88. u32 tx_prepared_descs;
  89. u32 tx_cmplt;
  90. u32 tx_template_prepared;
  91. u32 tx_data_prepared;
  92. u32 tx_template_programmed;
  93. u32 tx_data_programmed;
  94. u32 tx_burst_programmed;
  95. u32 tx_starts;
  96. u32 tx_imm_resp;
  97. u32 tx_start_templates;
  98. u32 tx_start_int_templates;
  99. u32 tx_start_fw_gen;
  100. u32 tx_start_data;
  101. u32 tx_start_null_frame;
  102. u32 tx_exch;
  103. u32 tx_retry_template;
  104. u32 tx_retry_data;
  105. u32 tx_exch_pending;
  106. u32 tx_exch_expiry;
  107. u32 tx_done_template;
  108. u32 tx_done_data;
  109. u32 tx_done_int_template;
  110. u32 tx_frame_checksum;
  111. u32 tx_checksum_result;
  112. u32 frag_called;
  113. u32 frag_mpdu_alloc_failed;
  114. u32 frag_init_called;
  115. u32 frag_in_process_called;
  116. u32 frag_tkip_called;
  117. u32 frag_key_not_found;
  118. u32 frag_need_fragmentation;
  119. u32 frag_bad_mblk_num;
  120. u32 frag_failed;
  121. u32 frag_cache_hit;
  122. u32 frag_cache_miss;
  123. } __packed;
  124. struct wl18xx_acx_rx_stats {
  125. u32 rx_beacon_early_term;
  126. u32 rx_out_of_mpdu_nodes;
  127. u32 rx_hdr_overflow;
  128. u32 rx_dropped_frame;
  129. u32 rx_done_stage;
  130. u32 rx_done;
  131. u32 rx_defrag;
  132. u32 rx_defrag_end;
  133. u32 rx_cmplt;
  134. u32 rx_pre_complt;
  135. u32 rx_cmplt_task;
  136. u32 rx_phy_hdr;
  137. u32 rx_timeout;
  138. u32 rx_timeout_wa;
  139. u32 rx_wa_density_dropped_frame;
  140. u32 rx_wa_ba_not_expected;
  141. u32 rx_frame_checksum;
  142. u32 rx_checksum_result;
  143. u32 defrag_called;
  144. u32 defrag_init_called;
  145. u32 defrag_in_process_called;
  146. u32 defrag_tkip_called;
  147. u32 defrag_need_defrag;
  148. u32 defrag_decrypt_failed;
  149. u32 decrypt_key_not_found;
  150. u32 defrag_need_decrypt;
  151. u32 rx_tkip_replays;
  152. } __packed;
  153. struct wl18xx_acx_isr_stats {
  154. u32 irqs;
  155. } __packed;
  156. #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
  157. struct wl18xx_acx_pwr_stats {
  158. u32 missing_bcns_cnt;
  159. u32 rcvd_bcns_cnt;
  160. u32 connection_out_of_sync;
  161. u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
  162. u32 rcvd_awake_bcns_cnt;
  163. } __packed;
  164. struct wl18xx_acx_event_stats {
  165. u32 calibration;
  166. u32 rx_mismatch;
  167. u32 rx_mem_empty;
  168. } __packed;
  169. struct wl18xx_acx_ps_poll_stats {
  170. u32 ps_poll_timeouts;
  171. u32 upsd_timeouts;
  172. u32 upsd_max_ap_turn;
  173. u32 ps_poll_max_ap_turn;
  174. u32 ps_poll_utilization;
  175. u32 upsd_utilization;
  176. } __packed;
  177. struct wl18xx_acx_rx_filter_stats {
  178. u32 beacon_filter;
  179. u32 arp_filter;
  180. u32 mc_filter;
  181. u32 dup_filter;
  182. u32 data_filter;
  183. u32 ibss_filter;
  184. u32 protection_filter;
  185. u32 accum_arp_pend_requests;
  186. u32 max_arp_queue_dep;
  187. } __packed;
  188. struct wl18xx_acx_rx_rate_stats {
  189. u32 rx_frames_per_rates[50];
  190. } __packed;
  191. #define AGGR_STATS_TX_AGG 16
  192. #define AGGR_STATS_TX_RATE 16
  193. #define AGGR_STATS_RX_SIZE_LEN 16
  194. struct wl18xx_acx_aggr_stats {
  195. u32 tx_agg_vs_rate[AGGR_STATS_TX_AGG * AGGR_STATS_TX_RATE];
  196. u32 rx_size[AGGR_STATS_RX_SIZE_LEN];
  197. } __packed;
  198. #define PIPE_STATS_HW_FIFO 11
  199. struct wl18xx_acx_pipeline_stats {
  200. u32 hs_tx_stat_fifo_int;
  201. u32 hs_rx_stat_fifo_int;
  202. u32 tcp_tx_stat_fifo_int;
  203. u32 tcp_rx_stat_fifo_int;
  204. u32 enc_tx_stat_fifo_int;
  205. u32 enc_rx_stat_fifo_int;
  206. u32 rx_complete_stat_fifo_int;
  207. u32 pre_proc_swi;
  208. u32 post_proc_swi;
  209. u32 sec_frag_swi;
  210. u32 pre_to_defrag_swi;
  211. u32 defrag_to_csum_swi;
  212. u32 csum_to_rx_xfer_swi;
  213. u32 dec_packet_in;
  214. u32 dec_packet_in_fifo_full;
  215. u32 dec_packet_out;
  216. u32 cs_rx_packet_in;
  217. u32 cs_rx_packet_out;
  218. u16 pipeline_fifo_full[PIPE_STATS_HW_FIFO];
  219. } __packed;
  220. struct wl18xx_acx_mem_stats {
  221. u32 rx_free_mem_blks;
  222. u32 tx_free_mem_blks;
  223. u32 fwlog_free_mem_blks;
  224. u32 fw_gen_free_mem_blks;
  225. } __packed;
  226. struct wl18xx_acx_statistics {
  227. struct acx_header header;
  228. struct wl18xx_acx_error_stats error;
  229. struct wl18xx_acx_debug_stats debug;
  230. struct wl18xx_acx_tx_stats tx;
  231. struct wl18xx_acx_rx_stats rx;
  232. struct wl18xx_acx_isr_stats isr;
  233. struct wl18xx_acx_pwr_stats pwr;
  234. struct wl18xx_acx_ps_poll_stats ps_poll;
  235. struct wl18xx_acx_rx_filter_stats rx_filter;
  236. struct wl18xx_acx_rx_rate_stats rx_rate;
  237. struct wl18xx_acx_aggr_stats aggr_size;
  238. struct wl18xx_acx_pipeline_stats pipeline;
  239. struct wl18xx_acx_mem_stats mem;
  240. } __packed;
  241. struct wl18xx_acx_clear_statistics {
  242. struct acx_header header;
  243. };
  244. int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
  245. u32 sdio_blk_size, u32 extra_mem_blks,
  246. u32 len_field_size);
  247. int wl18xx_acx_set_checksum_state(struct wl1271 *wl);
  248. int wl18xx_acx_clear_statistics(struct wl1271 *wl);
  249. #endif /* __WL18XX_ACX_H__ */