acx.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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_debug_stats {
  71. u32 debug1;
  72. u32 debug2;
  73. u32 debug3;
  74. u32 debug4;
  75. u32 debug5;
  76. u32 debug6;
  77. } __packed;
  78. struct wl18xx_acx_ring_stats {
  79. u32 prepared_descs;
  80. u32 tx_cmplt;
  81. } __packed;
  82. struct wl18xx_acx_tx_stats {
  83. u32 tx_template_prepared;
  84. u32 tx_data_prepared;
  85. u32 tx_template_programmed;
  86. u32 tx_data_programmed;
  87. u32 tx_burst_programmed;
  88. u32 tx_starts;
  89. u32 tx_imm_resp;
  90. u32 tx_start_templates;
  91. u32 tx_start_int_templates;
  92. u32 tx_start_fw_gen;
  93. u32 tx_start_data;
  94. u32 tx_start_null_frame;
  95. u32 tx_exch;
  96. u32 tx_retry_template;
  97. u32 tx_retry_data;
  98. u32 tx_exch_pending;
  99. u32 tx_exch_expiry;
  100. u32 tx_done_template;
  101. u32 tx_done_data;
  102. u32 tx_done_int_template;
  103. u32 tx_frame_checksum;
  104. u32 tx_checksum_result;
  105. u32 frag_called;
  106. u32 frag_mpdu_alloc_failed;
  107. u32 frag_init_called;
  108. u32 frag_in_process_called;
  109. u32 frag_tkip_called;
  110. u32 frag_key_not_found;
  111. u32 frag_need_fragmentation;
  112. u32 frag_bad_mblk_num;
  113. u32 frag_failed;
  114. u32 frag_cache_hit;
  115. u32 frag_cache_miss;
  116. } __packed;
  117. struct wl18xx_acx_rx_stats {
  118. u32 rx_out_of_mem;
  119. u32 rx_hdr_overflow;
  120. u32 rx_dropped_frame;
  121. u32 rx_done_stage;
  122. u32 rx_done;
  123. u32 rx_defrag;
  124. u32 rx_defrag_end;
  125. u32 rx_cmplt;
  126. u32 rx_pre_complt;
  127. u32 rx_cmplt_task;
  128. u32 rx_phy_hdr;
  129. u32 rx_timeout;
  130. u32 rx_frame_checksum;
  131. u32 rx_checksum_result;
  132. u32 defrag_called;
  133. u32 defrag_init_called;
  134. u32 defrag_in_process_called;
  135. u32 defrag_tkip_called;
  136. u32 defrag_need_defrag;
  137. u32 defrag_decrypt_failed;
  138. u32 decrypt_key_not_found;
  139. u32 defrag_need_decrypt;
  140. } __packed;
  141. struct wl18xx_acx_isr_stats {
  142. u32 irqs;
  143. } __packed;
  144. #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
  145. struct wl18xx_acx_pwr_stats {
  146. u32 missing_bcns_cnt;
  147. u32 rcvd_bcns_cnt;
  148. u32 connection_out_of_sync;
  149. u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
  150. u32 rcvd_awake_bcns_cnt;
  151. } __packed;
  152. struct wl18xx_acx_event_stats {
  153. u32 calibration;
  154. u32 rx_mismatch;
  155. u32 rx_mem_empty;
  156. } __packed;
  157. struct wl18xx_acx_ps_poll_stats {
  158. u32 ps_poll_timeouts;
  159. u32 upsd_timeouts;
  160. u32 upsd_max_ap_turn;
  161. u32 ps_poll_max_ap_turn;
  162. u32 ps_poll_utilization;
  163. u32 upsd_utilization;
  164. } __packed;
  165. struct wl18xx_acx_rx_filter_stats {
  166. u32 beacon_filter;
  167. u32 arp_filter;
  168. u32 mc_filter;
  169. u32 dup_filter;
  170. u32 data_filter;
  171. u32 ibss_filter;
  172. u32 protection_filter;
  173. } __packed;
  174. struct wl18xx_acx_rx_rate_stats {
  175. u32 rx_frames_per_rates[50];
  176. } __packed;
  177. #define AGGR_STATS_TX_SIZE_LEN 11
  178. #define AGGR_STATS_RX_SIZE_LEN 11
  179. struct wl18xx_acx_aggr_stats {
  180. u32 tx_size[AGGR_STATS_TX_SIZE_LEN];
  181. u32 rx_size[AGGR_STATS_RX_SIZE_LEN];
  182. } __packed;
  183. struct wl18xx_acx_pipeline_stats {
  184. u32 hs_tx_stat_fifo_int;
  185. u32 hs_rx_stat_fifo_int;
  186. u32 tcp_tx_stat_fifo_int;
  187. u32 tcp_rx_stat_fifo_int;
  188. u32 enc_tx_stat_fifo_int;
  189. u32 enc_rx_stat_fifo_int;
  190. u32 rx_complete_stat_fifo_int;
  191. u32 pre_proc_swi;
  192. u32 post_proc_swi;
  193. u32 sec_frag_swi;
  194. u32 pre_to_defrag_swi;
  195. u32 defrag_to_csum_swi;
  196. u32 csum_to_rx_xfer_swi;
  197. u32 dec_packet_in;
  198. u32 dec_packet_in_fifo_full;
  199. u32 dec_packet_out;
  200. u32 cs_rx_packet_in;
  201. u32 cs_rx_packet_out;
  202. } __packed;
  203. struct wl18xx_acx_mem_stats {
  204. u32 rx_free_mem_blks;
  205. u32 tx_free_mem_blks;
  206. u32 fwlog_free_mem_blks;
  207. u32 fw_gen_free_mem_blks;
  208. } __packed;
  209. struct wl18xx_acx_statistics {
  210. struct acx_header header;
  211. struct wl18xx_acx_ring_stats ring;
  212. struct wl18xx_acx_debug_stats debug;
  213. struct wl18xx_acx_tx_stats tx;
  214. struct wl18xx_acx_rx_stats rx;
  215. struct wl18xx_acx_isr_stats isr;
  216. struct wl18xx_acx_pwr_stats pwr;
  217. struct wl18xx_acx_event_stats event;
  218. struct wl18xx_acx_ps_poll_stats ps_poll;
  219. struct wl18xx_acx_rx_filter_stats rx_filter;
  220. struct wl18xx_acx_rx_rate_stats rx_rate;
  221. struct wl18xx_acx_aggr_stats aggr_size;
  222. struct wl18xx_acx_pipeline_stats pipeline;
  223. struct wl18xx_acx_mem_stats mem;
  224. } __packed;
  225. struct wl18xx_acx_clear_statistics {
  226. struct acx_header header;
  227. };
  228. int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
  229. u32 sdio_blk_size, u32 extra_mem_blks,
  230. u32 len_field_size);
  231. int wl18xx_acx_set_checksum_state(struct wl1271 *wl);
  232. int wl18xx_acx_clear_statistics(struct wl1271 *wl);
  233. #endif /* __WL18XX_ACX_H__ */