acx.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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 tx_procs;
  61. u32 prepared_descs;
  62. u32 tx_xfr;
  63. u32 tx_dma;
  64. u32 tx_cmplt;
  65. u32 rx_procs;
  66. u32 rx_data;
  67. } __packed;
  68. struct wl18xx_acx_tx_stats {
  69. u32 tx_template_prepared;
  70. u32 tx_data_prepared;
  71. u32 tx_template_programmed;
  72. u32 tx_data_programmed;
  73. u32 tx_burst_programmed;
  74. u32 tx_starts;
  75. u32 tx_imm_resp;
  76. u32 tx_start_templates;
  77. u32 tx_start_int_templates;
  78. u32 tx_start_fw_gen;
  79. u32 tx_start_data;
  80. u32 tx_start_null_frame;
  81. u32 tx_exch;
  82. u32 tx_retry_template;
  83. u32 tx_retry_data;
  84. u32 tx_exch_pending;
  85. u32 tx_exch_expiry;
  86. u32 tx_exch_mismatch;
  87. u32 tx_done_template;
  88. u32 tx_done_data;
  89. u32 tx_done_int_template;
  90. u32 tx_pre_xfr;
  91. u32 tx_xfr;
  92. u32 tx_xfr_out_of_mem;
  93. u32 tx_dma_programmed;
  94. u32 tx_dma_done;
  95. } __packed;
  96. struct wl18xx_acx_rx_stats {
  97. u32 rx_out_of_mem;
  98. u32 rx_hdr_overflow;
  99. u32 rx_hw_stuck;
  100. u32 rx_dropped_frame;
  101. u32 rx_complete_dropped_frame;
  102. u32 rx_alloc_frame;
  103. u32 rx_done_queue;
  104. u32 rx_done;
  105. u32 rx_defrag;
  106. u32 rx_defrag_end;
  107. u32 rx_mic;
  108. u32 rx_mic_end;
  109. u32 rx_xfr;
  110. u32 rx_xfr_end;
  111. u32 rx_cmplt;
  112. u32 rx_pre_complt;
  113. u32 rx_cmplt_task;
  114. u32 rx_phy_hdr;
  115. u32 rx_timeout;
  116. } __packed;
  117. struct wl18xx_acx_dma_stats {
  118. u32 rx_dma_errors;
  119. u32 tx_dma_errors;
  120. } __packed;
  121. struct wl18xx_acx_isr_stats {
  122. u32 irqs;
  123. } __packed;
  124. struct wl18xx_acx_wep_stats {
  125. u32 wep_add_key_count;
  126. u32 wep_default_key_count;
  127. u32 wep_key_not_found;
  128. u32 wep_decrypt_fail;
  129. u32 wep_encrypt_fail;
  130. u32 wep_dec_packets;
  131. u32 wep_dec_interrupt;
  132. u32 wep_enc_packets;
  133. u32 wep_enc_interrupts;
  134. } __packed;
  135. #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
  136. struct wl18xx_acx_pwr_stats {
  137. u32 missing_bcns_cnt;
  138. u32 rcvd_bcns_cnt;
  139. u32 connection_out_of_sync;
  140. u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
  141. u32 rcvd_awake_bcns_cnt;
  142. } __packed;
  143. struct wl18xx_acx_mic_stats {
  144. u32 mic_rx_pkts;
  145. u32 mic_calc_failure;
  146. } __packed;
  147. struct wl18xx_acx_aes_stats {
  148. u32 aes_encrypt_fail;
  149. u32 aes_decrypt_fail;
  150. u32 aes_encrypt_packets;
  151. u32 aes_decrypt_packets;
  152. u32 aes_encrypt_interrupt;
  153. u32 aes_decrypt_interrupt;
  154. } __packed;
  155. struct wl18xx_acx_gem_stats {
  156. u32 gem_encrypt_fail;
  157. u32 gem_decrypt_fail;
  158. u32 gem_encrypt_packets;
  159. u32 gem_decrypt_packets;
  160. u32 gem_encrypt_interrupt;
  161. u32 gem_decrypt_interrupt;
  162. } __packed;
  163. struct wl18xx_acx_event_stats {
  164. u32 calibration;
  165. u32 rx_mismatch;
  166. u32 rx_mem_empty;
  167. } __packed;
  168. struct wl18xx_acx_ps_poll_stats {
  169. u32 ps_poll_timeouts;
  170. u32 upsd_timeouts;
  171. u32 upsd_max_ap_turn;
  172. u32 ps_poll_max_ap_turn;
  173. u32 ps_poll_utilization;
  174. u32 upsd_utilization;
  175. } __packed;
  176. struct wl18xx_acx_rx_filter_stats {
  177. u32 beacon_filter;
  178. u32 arp_filter;
  179. u32 mc_filter;
  180. u32 dup_filter;
  181. u32 data_filter;
  182. u32 ibss_filter;
  183. u32 protection_filter;
  184. } __packed;
  185. struct wl18xx_acx_calibration_stats {
  186. u32 init_cal_total;
  187. u32 init_radio_bands_fail;
  188. u32 init_set_params;
  189. u32 init_tx_clpc_fail;
  190. u32 init_rx_iw_mm_fail;
  191. u32 tune_cal_total;
  192. u32 tune_drpw_rtrim_fail;
  193. u32 tune_drpw_pd_buf_fail;
  194. u32 tune_drpw_tx_mix_freq_fail;
  195. u32 tune_drpw_ta_cal;
  196. u32 tune_drpw_rx_if_2_gain;
  197. u32 tune_drpw_rx_dac;
  198. u32 tune_drpw_chan_tune;
  199. u32 tune_drpw_rx_tx_lpf;
  200. u32 tune_drpw_lna_tank;
  201. u32 tune_tx_lo_leak_fail;
  202. u32 tune_tx_iq_mm_fail;
  203. u32 tune_tx_pdet_fail;
  204. u32 tune_tx_ppa_fail;
  205. u32 tune_tx_clpc_fail;
  206. u32 tune_rx_ana_dc_fail;
  207. u32 tune_rx_dig_dc_fail; /* check if this is needed */
  208. u32 tune_rx_iq_mm_fail;
  209. u32 cal_state_fail;
  210. } __packed;
  211. struct wl18xx_acx_statistics {
  212. struct acx_header header;
  213. struct wl18xx_acx_ring_stats ring;
  214. struct wl18xx_acx_debug_stats debug;
  215. struct wl18xx_acx_tx_stats tx;
  216. struct wl18xx_acx_rx_stats rx;
  217. struct wl18xx_acx_dma_stats dma;
  218. struct wl18xx_acx_isr_stats isr;
  219. struct wl18xx_acx_wep_stats wep;
  220. struct wl18xx_acx_pwr_stats pwr;
  221. struct wl18xx_acx_aes_stats aes;
  222. struct wl18xx_acx_mic_stats mic;
  223. struct wl18xx_acx_event_stats event;
  224. struct wl18xx_acx_ps_poll_stats ps_poll;
  225. struct wl18xx_acx_rx_filter_stats rx_filter;
  226. struct wl18xx_acx_calibration_stats calibration;
  227. struct wl18xx_acx_gem_stats gem;
  228. } __packed;
  229. int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
  230. u32 sdio_blk_size, u32 extra_mem_blks,
  231. u32 len_field_size);
  232. int wl18xx_acx_set_checksum_state(struct wl1271 *wl);
  233. #endif /* __WL18XX_ACX_H__ */