acx.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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. /* numbers of bits the length field takes (add 1 for the actual number) */
  26. #define WL18XX_HOST_IF_LEN_SIZE_FIELD 15
  27. struct wl18xx_acx_host_config_bitmap {
  28. struct acx_header header;
  29. __le32 host_cfg_bitmap;
  30. __le32 host_sdio_block_size;
  31. /* extra mem blocks per frame in TX. */
  32. __le32 extra_mem_blocks;
  33. /*
  34. * number of bits of the length field in the first TX word
  35. * (up to 15 - for using the entire 16 bits).
  36. */
  37. __le32 length_field_size;
  38. } __packed;
  39. enum {
  40. CHECKSUM_OFFLOAD_DISABLED = 0,
  41. CHECKSUM_OFFLOAD_ENABLED = 1,
  42. CHECKSUM_OFFLOAD_FAKE_RX = 2,
  43. CHECKSUM_OFFLOAD_INVALID = 0xFF
  44. };
  45. struct wl18xx_acx_checksum_state {
  46. struct acx_header header;
  47. /* enum acx_checksum_state */
  48. u8 checksum_state;
  49. u8 pad[3];
  50. } __packed;
  51. struct wl18xx_acx_debug_stats {
  52. u32 debug1;
  53. u32 debug2;
  54. u32 debug3;
  55. u32 debug4;
  56. u32 debug5;
  57. u32 debug6;
  58. } __packed;
  59. struct wl18xx_acx_ring_stats {
  60. u32 prepared_descs;
  61. u32 tx_cmplt;
  62. } __packed;
  63. struct wl18xx_acx_tx_stats {
  64. u32 tx_template_prepared;
  65. u32 tx_data_prepared;
  66. u32 tx_template_programmed;
  67. u32 tx_data_programmed;
  68. u32 tx_burst_programmed;
  69. u32 tx_starts;
  70. u32 tx_imm_resp;
  71. u32 tx_start_templates;
  72. u32 tx_start_int_templates;
  73. u32 tx_start_fw_gen;
  74. u32 tx_start_data;
  75. u32 tx_start_null_frame;
  76. u32 tx_exch;
  77. u32 tx_retry_template;
  78. u32 tx_retry_data;
  79. u32 tx_exch_pending;
  80. u32 tx_exch_expiry;
  81. u32 tx_done_template;
  82. u32 tx_done_data;
  83. u32 tx_done_int_template;
  84. u32 tx_frame_checksum;
  85. u32 tx_checksum_result;
  86. u32 frag_called;
  87. u32 frag_mpdu_alloc_failed;
  88. u32 frag_init_called;
  89. u32 frag_in_process_called;
  90. u32 frag_tkip_called;
  91. u32 frag_key_not_found;
  92. u32 frag_need_fragmentation;
  93. u32 frag_bad_mblk_num;
  94. u32 frag_failed;
  95. u32 frag_cache_hit;
  96. u32 frag_cache_miss;
  97. } __packed;
  98. struct wl18xx_acx_rx_stats {
  99. u32 rx_out_of_mem;
  100. u32 rx_hdr_overflow;
  101. u32 rx_dropped_frame;
  102. u32 rx_done_stage;
  103. u32 rx_done;
  104. u32 rx_defrag;
  105. u32 rx_defrag_end;
  106. u32 rx_cmplt;
  107. u32 rx_pre_complt;
  108. u32 rx_cmplt_task;
  109. u32 rx_phy_hdr;
  110. u32 rx_timeout;
  111. u32 rx_frame_checksum;
  112. u32 rx_checksum_result;
  113. u32 defrag_called;
  114. u32 defrag_init_called;
  115. u32 defrag_in_process_called;
  116. u32 defrag_tkip_called;
  117. u32 defrag_need_defrag;
  118. u32 defrag_decrypt_failed;
  119. u32 decrypt_key_not_found;
  120. u32 defrag_need_decrypt;
  121. } __packed;
  122. struct wl18xx_acx_isr_stats {
  123. u32 irqs;
  124. } __packed;
  125. #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
  126. struct wl18xx_acx_pwr_stats {
  127. u32 missing_bcns_cnt;
  128. u32 rcvd_bcns_cnt;
  129. u32 connection_out_of_sync;
  130. u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
  131. u32 rcvd_awake_bcns_cnt;
  132. } __packed;
  133. struct wl18xx_acx_event_stats {
  134. u32 calibration;
  135. u32 rx_mismatch;
  136. u32 rx_mem_empty;
  137. } __packed;
  138. struct wl18xx_acx_ps_poll_stats {
  139. u32 ps_poll_timeouts;
  140. u32 upsd_timeouts;
  141. u32 upsd_max_ap_turn;
  142. u32 ps_poll_max_ap_turn;
  143. u32 ps_poll_utilization;
  144. u32 upsd_utilization;
  145. } __packed;
  146. struct wl18xx_acx_rx_filter_stats {
  147. u32 beacon_filter;
  148. u32 arp_filter;
  149. u32 mc_filter;
  150. u32 dup_filter;
  151. u32 data_filter;
  152. u32 ibss_filter;
  153. u32 protection_filter;
  154. } __packed;
  155. struct wl18xx_acx_rx_rate_stats {
  156. u32 rx_frames_per_rates[50];
  157. } __packed;
  158. #define AGGR_STATS_TX_SIZE_LEN 11
  159. #define AGGR_STATS_RX_SIZE_LEN 11
  160. struct wl18xx_acx_aggr_stats {
  161. u32 tx_size[AGGR_STATS_TX_SIZE_LEN];
  162. u32 rx_size[AGGR_STATS_RX_SIZE_LEN];
  163. } __packed;
  164. struct wl18xx_acx_pipeline_stats {
  165. u32 hs_tx_stat_fifo_int;
  166. u32 hs_rx_stat_fifo_int;
  167. u32 tcp_tx_stat_fifo_int;
  168. u32 tcp_rx_stat_fifo_int;
  169. u32 enc_tx_stat_fifo_int;
  170. u32 enc_rx_stat_fifo_int;
  171. u32 rx_complete_stat_fifo_int;
  172. u32 pre_proc_swi;
  173. u32 post_proc_swi;
  174. u32 sec_frag_swi;
  175. u32 pre_to_defrag_swi;
  176. u32 defrag_to_csum_swi;
  177. u32 csum_to_rx_xfer_swi;
  178. u32 dec_packet_in;
  179. u32 dec_packet_in_fifo_full;
  180. u32 dec_packet_out;
  181. u32 cs_rx_packet_in;
  182. u32 cs_rx_packet_out;
  183. } __packed;
  184. struct wl18xx_acx_mem_stats {
  185. u32 rx_free_mem_blks;
  186. u32 tx_free_mem_blks;
  187. u32 fwlog_free_mem_blks;
  188. u32 fw_gen_free_mem_blks;
  189. } __packed;
  190. struct wl18xx_acx_statistics {
  191. struct acx_header header;
  192. struct wl18xx_acx_ring_stats ring;
  193. struct wl18xx_acx_debug_stats debug;
  194. struct wl18xx_acx_tx_stats tx;
  195. struct wl18xx_acx_rx_stats rx;
  196. struct wl18xx_acx_isr_stats isr;
  197. struct wl18xx_acx_pwr_stats pwr;
  198. struct wl18xx_acx_event_stats event;
  199. struct wl18xx_acx_ps_poll_stats ps_poll;
  200. struct wl18xx_acx_rx_filter_stats rx_filter;
  201. struct wl18xx_acx_rx_rate_stats rx_rate;
  202. struct wl18xx_acx_aggr_stats aggr_size;
  203. struct wl18xx_acx_pipeline_stats pipeline;
  204. struct wl18xx_acx_mem_stats mem;
  205. } __packed;
  206. int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
  207. u32 sdio_blk_size, u32 extra_mem_blks,
  208. u32 len_field_size);
  209. int wl18xx_acx_set_checksum_state(struct wl1271 *wl);
  210. #endif /* __WL18XX_ACX_H__ */