acx.h 6.0 KB

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