acx.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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_PG1 (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. #define WL18XX_ACX_EVENTS_VECTOR_PG2 (WL18XX_ACX_EVENTS_VECTOR_PG1 | \
  38. WL1271_ACX_SW_INTR_WATCHDOG)
  39. #define WL18XX_INTR_MASK_PG1 (WL1271_ACX_INTR_WATCHDOG | \
  40. WL1271_ACX_INTR_EVENT_A | \
  41. WL1271_ACX_INTR_EVENT_B | \
  42. WL1271_ACX_INTR_HW_AVAILABLE | \
  43. WL1271_ACX_INTR_DATA)
  44. #define WL18XX_INTR_MASK_PG2 (WL18XX_INTR_MASK_PG1 | \
  45. WL1271_ACX_SW_INTR_WATCHDOG)
  46. struct wl18xx_acx_host_config_bitmap {
  47. struct acx_header header;
  48. __le32 host_cfg_bitmap;
  49. __le32 host_sdio_block_size;
  50. /* extra mem blocks per frame in TX. */
  51. __le32 extra_mem_blocks;
  52. /*
  53. * number of bits of the length field in the first TX word
  54. * (up to 15 - for using the entire 16 bits).
  55. */
  56. __le32 length_field_size;
  57. } __packed;
  58. enum {
  59. CHECKSUM_OFFLOAD_DISABLED = 0,
  60. CHECKSUM_OFFLOAD_ENABLED = 1,
  61. CHECKSUM_OFFLOAD_FAKE_RX = 2,
  62. CHECKSUM_OFFLOAD_INVALID = 0xFF
  63. };
  64. struct wl18xx_acx_checksum_state {
  65. struct acx_header header;
  66. /* enum acx_checksum_state */
  67. u8 checksum_state;
  68. u8 pad[3];
  69. } __packed;
  70. struct wl18xx_acx_error_stats {
  71. u32 error_frame;
  72. u32 error_null_Frame_tx_start;
  73. u32 error_numll_frame_cts_start;
  74. u32 error_bar_retry;
  75. u32 error_frame_cts_nul_flid;
  76. } __packed;
  77. struct wl18xx_acx_debug_stats {
  78. u32 debug1;
  79. u32 debug2;
  80. u32 debug3;
  81. u32 debug4;
  82. u32 debug5;
  83. u32 debug6;
  84. } __packed;
  85. struct wl18xx_acx_ring_stats {
  86. u32 prepared_descs;
  87. u32 tx_cmplt;
  88. } __packed;
  89. struct wl18xx_acx_tx_stats {
  90. u32 tx_prepared_descs;
  91. u32 tx_cmplt;
  92. u32 tx_template_prepared;
  93. u32 tx_data_prepared;
  94. u32 tx_template_programmed;
  95. u32 tx_data_programmed;
  96. u32 tx_burst_programmed;
  97. u32 tx_starts;
  98. u32 tx_imm_resp;
  99. u32 tx_start_templates;
  100. u32 tx_start_int_templates;
  101. u32 tx_start_fw_gen;
  102. u32 tx_start_data;
  103. u32 tx_start_null_frame;
  104. u32 tx_exch;
  105. u32 tx_retry_template;
  106. u32 tx_retry_data;
  107. u32 tx_exch_pending;
  108. u32 tx_exch_expiry;
  109. u32 tx_done_template;
  110. u32 tx_done_data;
  111. u32 tx_done_int_template;
  112. u32 tx_frame_checksum;
  113. u32 tx_checksum_result;
  114. u32 frag_called;
  115. u32 frag_mpdu_alloc_failed;
  116. u32 frag_init_called;
  117. u32 frag_in_process_called;
  118. u32 frag_tkip_called;
  119. u32 frag_key_not_found;
  120. u32 frag_need_fragmentation;
  121. u32 frag_bad_mblk_num;
  122. u32 frag_failed;
  123. u32 frag_cache_hit;
  124. u32 frag_cache_miss;
  125. } __packed;
  126. struct wl18xx_acx_rx_stats {
  127. u32 rx_beacon_early_term;
  128. u32 rx_out_of_mpdu_nodes;
  129. u32 rx_hdr_overflow;
  130. u32 rx_dropped_frame;
  131. u32 rx_done_stage;
  132. u32 rx_done;
  133. u32 rx_defrag;
  134. u32 rx_defrag_end;
  135. u32 rx_cmplt;
  136. u32 rx_pre_complt;
  137. u32 rx_cmplt_task;
  138. u32 rx_phy_hdr;
  139. u32 rx_timeout;
  140. u32 rx_timeout_wa;
  141. u32 rx_wa_density_dropped_frame;
  142. u32 rx_wa_ba_not_expected;
  143. u32 rx_frame_checksum;
  144. u32 rx_checksum_result;
  145. u32 defrag_called;
  146. u32 defrag_init_called;
  147. u32 defrag_in_process_called;
  148. u32 defrag_tkip_called;
  149. u32 defrag_need_defrag;
  150. u32 defrag_decrypt_failed;
  151. u32 decrypt_key_not_found;
  152. u32 defrag_need_decrypt;
  153. u32 rx_tkip_replays;
  154. } __packed;
  155. struct wl18xx_acx_isr_stats {
  156. u32 irqs;
  157. } __packed;
  158. #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
  159. struct wl18xx_acx_pwr_stats {
  160. u32 missing_bcns_cnt;
  161. u32 rcvd_bcns_cnt;
  162. u32 connection_out_of_sync;
  163. u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
  164. u32 rcvd_awake_bcns_cnt;
  165. } __packed;
  166. struct wl18xx_acx_event_stats {
  167. u32 calibration;
  168. u32 rx_mismatch;
  169. u32 rx_mem_empty;
  170. } __packed;
  171. struct wl18xx_acx_ps_poll_stats {
  172. u32 ps_poll_timeouts;
  173. u32 upsd_timeouts;
  174. u32 upsd_max_ap_turn;
  175. u32 ps_poll_max_ap_turn;
  176. u32 ps_poll_utilization;
  177. u32 upsd_utilization;
  178. } __packed;
  179. struct wl18xx_acx_rx_filter_stats {
  180. u32 beacon_filter;
  181. u32 arp_filter;
  182. u32 mc_filter;
  183. u32 dup_filter;
  184. u32 data_filter;
  185. u32 ibss_filter;
  186. u32 protection_filter;
  187. u32 accum_arp_pend_requests;
  188. u32 max_arp_queue_dep;
  189. } __packed;
  190. struct wl18xx_acx_rx_rate_stats {
  191. u32 rx_frames_per_rates[50];
  192. } __packed;
  193. #define AGGR_STATS_TX_AGG 16
  194. #define AGGR_STATS_TX_RATE 16
  195. #define AGGR_STATS_RX_SIZE_LEN 16
  196. struct wl18xx_acx_aggr_stats {
  197. u32 tx_agg_vs_rate[AGGR_STATS_TX_AGG * AGGR_STATS_TX_RATE];
  198. u32 rx_size[AGGR_STATS_RX_SIZE_LEN];
  199. } __packed;
  200. #define PIPE_STATS_HW_FIFO 11
  201. struct wl18xx_acx_pipeline_stats {
  202. u32 hs_tx_stat_fifo_int;
  203. u32 hs_rx_stat_fifo_int;
  204. u32 tcp_tx_stat_fifo_int;
  205. u32 tcp_rx_stat_fifo_int;
  206. u32 enc_tx_stat_fifo_int;
  207. u32 enc_rx_stat_fifo_int;
  208. u32 rx_complete_stat_fifo_int;
  209. u32 pre_proc_swi;
  210. u32 post_proc_swi;
  211. u32 sec_frag_swi;
  212. u32 pre_to_defrag_swi;
  213. u32 defrag_to_csum_swi;
  214. u32 csum_to_rx_xfer_swi;
  215. u32 dec_packet_in;
  216. u32 dec_packet_in_fifo_full;
  217. u32 dec_packet_out;
  218. u32 cs_rx_packet_in;
  219. u32 cs_rx_packet_out;
  220. u16 pipeline_fifo_full[PIPE_STATS_HW_FIFO];
  221. } __packed;
  222. struct wl18xx_acx_mem_stats {
  223. u32 rx_free_mem_blks;
  224. u32 tx_free_mem_blks;
  225. u32 fwlog_free_mem_blks;
  226. u32 fw_gen_free_mem_blks;
  227. } __packed;
  228. struct wl18xx_acx_statistics {
  229. struct acx_header header;
  230. struct wl18xx_acx_error_stats error;
  231. struct wl18xx_acx_debug_stats debug;
  232. struct wl18xx_acx_tx_stats tx;
  233. struct wl18xx_acx_rx_stats rx;
  234. struct wl18xx_acx_isr_stats isr;
  235. struct wl18xx_acx_pwr_stats pwr;
  236. struct wl18xx_acx_ps_poll_stats ps_poll;
  237. struct wl18xx_acx_rx_filter_stats rx_filter;
  238. struct wl18xx_acx_rx_rate_stats rx_rate;
  239. struct wl18xx_acx_aggr_stats aggr_size;
  240. struct wl18xx_acx_pipeline_stats pipeline;
  241. struct wl18xx_acx_mem_stats mem;
  242. } __packed;
  243. struct wl18xx_acx_clear_statistics {
  244. struct acx_header header;
  245. };
  246. int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
  247. u32 sdio_blk_size, u32 extra_mem_blks,
  248. u32 len_field_size);
  249. int wl18xx_acx_set_checksum_state(struct wl1271 *wl);
  250. int wl18xx_acx_clear_statistics(struct wl1271 *wl);
  251. #endif /* __WL18XX_ACX_H__ */