acx.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 1998-2009, 2011 Texas Instruments. All rights reserved.
  5. * Copyright (C) 2008-2010 Nokia Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. *
  21. */
  22. #ifndef __WL12XX_ACX_H__
  23. #define __WL12XX_ACX_H__
  24. #include "../wlcore/wlcore.h"
  25. #include "../wlcore/acx.h"
  26. #define WL12XX_ACX_ALL_EVENTS_VECTOR (WL1271_ACX_INTR_WATCHDOG | \
  27. WL1271_ACX_INTR_INIT_COMPLETE | \
  28. WL1271_ACX_INTR_EVENT_A | \
  29. WL1271_ACX_INTR_EVENT_B | \
  30. WL1271_ACX_INTR_CMD_COMPLETE | \
  31. WL1271_ACX_INTR_HW_AVAILABLE | \
  32. WL1271_ACX_INTR_DATA)
  33. #define WL12XX_INTR_MASK (WL1271_ACX_INTR_WATCHDOG | \
  34. WL1271_ACX_INTR_EVENT_A | \
  35. WL1271_ACX_INTR_EVENT_B | \
  36. WL1271_ACX_INTR_HW_AVAILABLE | \
  37. WL1271_ACX_INTR_DATA)
  38. struct wl1271_acx_host_config_bitmap {
  39. struct acx_header header;
  40. __le32 host_cfg_bitmap;
  41. } __packed;
  42. struct wl12xx_acx_tx_statistics {
  43. __le32 internal_desc_overflow;
  44. } __packed;
  45. struct wl12xx_acx_rx_statistics {
  46. __le32 out_of_mem;
  47. __le32 hdr_overflow;
  48. __le32 hw_stuck;
  49. __le32 dropped;
  50. __le32 fcs_err;
  51. __le32 xfr_hint_trig;
  52. __le32 path_reset;
  53. __le32 reset_counter;
  54. } __packed;
  55. struct wl12xx_acx_dma_statistics {
  56. __le32 rx_requested;
  57. __le32 rx_errors;
  58. __le32 tx_requested;
  59. __le32 tx_errors;
  60. } __packed;
  61. struct wl12xx_acx_isr_statistics {
  62. /* host command complete */
  63. __le32 cmd_cmplt;
  64. /* fiqisr() */
  65. __le32 fiqs;
  66. /* (INT_STS_ND & INT_TRIG_RX_HEADER) */
  67. __le32 rx_headers;
  68. /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */
  69. __le32 rx_completes;
  70. /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */
  71. __le32 rx_mem_overflow;
  72. /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */
  73. __le32 rx_rdys;
  74. /* irqisr() */
  75. __le32 irqs;
  76. /* (INT_STS_ND & INT_TRIG_TX_PROC) */
  77. __le32 tx_procs;
  78. /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */
  79. __le32 decrypt_done;
  80. /* (INT_STS_ND & INT_TRIG_DMA0) */
  81. __le32 dma0_done;
  82. /* (INT_STS_ND & INT_TRIG_DMA1) */
  83. __le32 dma1_done;
  84. /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */
  85. __le32 tx_exch_complete;
  86. /* (INT_STS_ND & INT_TRIG_COMMAND) */
  87. __le32 commands;
  88. /* (INT_STS_ND & INT_TRIG_RX_PROC) */
  89. __le32 rx_procs;
  90. /* (INT_STS_ND & INT_TRIG_PM_802) */
  91. __le32 hw_pm_mode_changes;
  92. /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */
  93. __le32 host_acknowledges;
  94. /* (INT_STS_ND & INT_TRIG_PM_PCI) */
  95. __le32 pci_pm;
  96. /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */
  97. __le32 wakeups;
  98. /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
  99. __le32 low_rssi;
  100. } __packed;
  101. struct wl12xx_acx_wep_statistics {
  102. /* WEP address keys configured */
  103. __le32 addr_key_count;
  104. /* default keys configured */
  105. __le32 default_key_count;
  106. __le32 reserved;
  107. /* number of times that WEP key not found on lookup */
  108. __le32 key_not_found;
  109. /* number of times that WEP key decryption failed */
  110. __le32 decrypt_fail;
  111. /* WEP packets decrypted */
  112. __le32 packets;
  113. /* WEP decrypt interrupts */
  114. __le32 interrupt;
  115. } __packed;
  116. #define ACX_MISSED_BEACONS_SPREAD 10
  117. struct wl12xx_acx_pwr_statistics {
  118. /* the amount of enters into power save mode (both PD & ELP) */
  119. __le32 ps_enter;
  120. /* the amount of enters into ELP mode */
  121. __le32 elp_enter;
  122. /* the amount of missing beacon interrupts to the host */
  123. __le32 missing_bcns;
  124. /* the amount of wake on host-access times */
  125. __le32 wake_on_host;
  126. /* the amount of wake on timer-expire */
  127. __le32 wake_on_timer_exp;
  128. /* the number of packets that were transmitted with PS bit set */
  129. __le32 tx_with_ps;
  130. /* the number of packets that were transmitted with PS bit clear */
  131. __le32 tx_without_ps;
  132. /* the number of received beacons */
  133. __le32 rcvd_beacons;
  134. /* the number of entering into PowerOn (power save off) */
  135. __le32 power_save_off;
  136. /* the number of entries into power save mode */
  137. __le16 enable_ps;
  138. /*
  139. * the number of exits from power save, not including failed PS
  140. * transitions
  141. */
  142. __le16 disable_ps;
  143. /*
  144. * the number of times the TSF counter was adjusted because
  145. * of drift
  146. */
  147. __le32 fix_tsf_ps;
  148. /* Gives statistics about the spread continuous missed beacons.
  149. * The 16 LSB are dedicated for the PS mode.
  150. * The 16 MSB are dedicated for the PS mode.
  151. * cont_miss_bcns_spread[0] - single missed beacon.
  152. * cont_miss_bcns_spread[1] - two continuous missed beacons.
  153. * cont_miss_bcns_spread[2] - three continuous missed beacons.
  154. * ...
  155. * cont_miss_bcns_spread[9] - ten and more continuous missed beacons.
  156. */
  157. __le32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD];
  158. /* the number of beacons in awake mode */
  159. __le32 rcvd_awake_beacons;
  160. } __packed;
  161. struct wl12xx_acx_mic_statistics {
  162. __le32 rx_pkts;
  163. __le32 calc_failure;
  164. } __packed;
  165. struct wl12xx_acx_aes_statistics {
  166. __le32 encrypt_fail;
  167. __le32 decrypt_fail;
  168. __le32 encrypt_packets;
  169. __le32 decrypt_packets;
  170. __le32 encrypt_interrupt;
  171. __le32 decrypt_interrupt;
  172. } __packed;
  173. struct wl12xx_acx_event_statistics {
  174. __le32 heart_beat;
  175. __le32 calibration;
  176. __le32 rx_mismatch;
  177. __le32 rx_mem_empty;
  178. __le32 rx_pool;
  179. __le32 oom_late;
  180. __le32 phy_transmit_error;
  181. __le32 tx_stuck;
  182. } __packed;
  183. struct wl12xx_acx_ps_statistics {
  184. __le32 pspoll_timeouts;
  185. __le32 upsd_timeouts;
  186. __le32 upsd_max_sptime;
  187. __le32 upsd_max_apturn;
  188. __le32 pspoll_max_apturn;
  189. __le32 pspoll_utilization;
  190. __le32 upsd_utilization;
  191. } __packed;
  192. struct wl12xx_acx_rxpipe_statistics {
  193. __le32 rx_prep_beacon_drop;
  194. __le32 descr_host_int_trig_rx_data;
  195. __le32 beacon_buffer_thres_host_int_trig_rx_data;
  196. __le32 missed_beacon_host_int_trig_rx_data;
  197. __le32 tx_xfr_host_int_trig_rx_data;
  198. } __packed;
  199. struct wl12xx_acx_statistics {
  200. struct acx_header header;
  201. struct wl12xx_acx_tx_statistics tx;
  202. struct wl12xx_acx_rx_statistics rx;
  203. struct wl12xx_acx_dma_statistics dma;
  204. struct wl12xx_acx_isr_statistics isr;
  205. struct wl12xx_acx_wep_statistics wep;
  206. struct wl12xx_acx_pwr_statistics pwr;
  207. struct wl12xx_acx_aes_statistics aes;
  208. struct wl12xx_acx_mic_statistics mic;
  209. struct wl12xx_acx_event_statistics event;
  210. struct wl12xx_acx_ps_statistics ps;
  211. struct wl12xx_acx_rxpipe_statistics rxpipe;
  212. } __packed;
  213. int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap);
  214. #endif /* __WL12XX_ACX_H__ */