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