1*2b27bdccSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 29d68d1eeSLuciano Coelho /* 39d68d1eeSLuciano Coelho * This file is part of wl12xx 49d68d1eeSLuciano Coelho * 59d68d1eeSLuciano Coelho * Copyright (C) 1998-2009, 2011 Texas Instruments. All rights reserved. 69d68d1eeSLuciano Coelho * Copyright (C) 2008-2010 Nokia Corporation 79d68d1eeSLuciano Coelho */ 89d68d1eeSLuciano Coelho 99d68d1eeSLuciano Coelho #ifndef __WL12XX_ACX_H__ 109d68d1eeSLuciano Coelho #define __WL12XX_ACX_H__ 119d68d1eeSLuciano Coelho 129d68d1eeSLuciano Coelho #include "../wlcore/wlcore.h" 1310b1e8a2SLuciano Coelho #include "../wlcore/acx.h" 149d68d1eeSLuciano Coelho 15f5755fe9SIdo Reis #define WL12XX_ACX_ALL_EVENTS_VECTOR (WL1271_ACX_INTR_WATCHDOG | \ 16f5755fe9SIdo Reis WL1271_ACX_INTR_INIT_COMPLETE | \ 17f5755fe9SIdo Reis WL1271_ACX_INTR_EVENT_A | \ 18f5755fe9SIdo Reis WL1271_ACX_INTR_EVENT_B | \ 19f5755fe9SIdo Reis WL1271_ACX_INTR_CMD_COMPLETE | \ 20f5755fe9SIdo Reis WL1271_ACX_INTR_HW_AVAILABLE | \ 21f5755fe9SIdo Reis WL1271_ACX_INTR_DATA) 22f5755fe9SIdo Reis 23f5755fe9SIdo Reis #define WL12XX_INTR_MASK (WL1271_ACX_INTR_WATCHDOG | \ 24f5755fe9SIdo Reis WL1271_ACX_INTR_EVENT_A | \ 25f5755fe9SIdo Reis WL1271_ACX_INTR_EVENT_B | \ 26f5755fe9SIdo Reis WL1271_ACX_INTR_HW_AVAILABLE | \ 27f5755fe9SIdo Reis WL1271_ACX_INTR_DATA) 28f5755fe9SIdo Reis 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 3510b1e8a2SLuciano Coelho struct wl12xx_acx_tx_statistics { 3610b1e8a2SLuciano Coelho __le32 internal_desc_overflow; 3710b1e8a2SLuciano Coelho } __packed; 3810b1e8a2SLuciano Coelho 3910b1e8a2SLuciano Coelho struct wl12xx_acx_rx_statistics { 4010b1e8a2SLuciano Coelho __le32 out_of_mem; 4110b1e8a2SLuciano Coelho __le32 hdr_overflow; 4210b1e8a2SLuciano Coelho __le32 hw_stuck; 4310b1e8a2SLuciano Coelho __le32 dropped; 4410b1e8a2SLuciano Coelho __le32 fcs_err; 4510b1e8a2SLuciano Coelho __le32 xfr_hint_trig; 4610b1e8a2SLuciano Coelho __le32 path_reset; 4710b1e8a2SLuciano Coelho __le32 reset_counter; 4810b1e8a2SLuciano Coelho } __packed; 4910b1e8a2SLuciano Coelho 5010b1e8a2SLuciano Coelho struct wl12xx_acx_dma_statistics { 5110b1e8a2SLuciano Coelho __le32 rx_requested; 5210b1e8a2SLuciano Coelho __le32 rx_errors; 5310b1e8a2SLuciano Coelho __le32 tx_requested; 5410b1e8a2SLuciano Coelho __le32 tx_errors; 5510b1e8a2SLuciano Coelho } __packed; 5610b1e8a2SLuciano Coelho 5710b1e8a2SLuciano Coelho struct wl12xx_acx_isr_statistics { 5810b1e8a2SLuciano Coelho /* host command complete */ 5910b1e8a2SLuciano Coelho __le32 cmd_cmplt; 6010b1e8a2SLuciano Coelho 6110b1e8a2SLuciano Coelho /* fiqisr() */ 6210b1e8a2SLuciano Coelho __le32 fiqs; 6310b1e8a2SLuciano Coelho 6410b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_RX_HEADER) */ 6510b1e8a2SLuciano Coelho __le32 rx_headers; 6610b1e8a2SLuciano Coelho 6710b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */ 6810b1e8a2SLuciano Coelho __le32 rx_completes; 6910b1e8a2SLuciano Coelho 7010b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */ 7110b1e8a2SLuciano Coelho __le32 rx_mem_overflow; 7210b1e8a2SLuciano Coelho 7310b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */ 7410b1e8a2SLuciano Coelho __le32 rx_rdys; 7510b1e8a2SLuciano Coelho 7610b1e8a2SLuciano Coelho /* irqisr() */ 7710b1e8a2SLuciano Coelho __le32 irqs; 7810b1e8a2SLuciano Coelho 7910b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_TX_PROC) */ 8010b1e8a2SLuciano Coelho __le32 tx_procs; 8110b1e8a2SLuciano Coelho 8210b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */ 8310b1e8a2SLuciano Coelho __le32 decrypt_done; 8410b1e8a2SLuciano Coelho 8510b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_DMA0) */ 8610b1e8a2SLuciano Coelho __le32 dma0_done; 8710b1e8a2SLuciano Coelho 8810b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_DMA1) */ 8910b1e8a2SLuciano Coelho __le32 dma1_done; 9010b1e8a2SLuciano Coelho 9110b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */ 9210b1e8a2SLuciano Coelho __le32 tx_exch_complete; 9310b1e8a2SLuciano Coelho 9410b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_COMMAND) */ 9510b1e8a2SLuciano Coelho __le32 commands; 9610b1e8a2SLuciano Coelho 9710b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_RX_PROC) */ 9810b1e8a2SLuciano Coelho __le32 rx_procs; 9910b1e8a2SLuciano Coelho 10010b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_PM_802) */ 10110b1e8a2SLuciano Coelho __le32 hw_pm_mode_changes; 10210b1e8a2SLuciano Coelho 10310b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */ 10410b1e8a2SLuciano Coelho __le32 host_acknowledges; 10510b1e8a2SLuciano Coelho 10610b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_PM_PCI) */ 10710b1e8a2SLuciano Coelho __le32 pci_pm; 10810b1e8a2SLuciano Coelho 10910b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */ 11010b1e8a2SLuciano Coelho __le32 wakeups; 11110b1e8a2SLuciano Coelho 11210b1e8a2SLuciano Coelho /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */ 11310b1e8a2SLuciano Coelho __le32 low_rssi; 11410b1e8a2SLuciano Coelho } __packed; 11510b1e8a2SLuciano Coelho 11610b1e8a2SLuciano Coelho struct wl12xx_acx_wep_statistics { 11710b1e8a2SLuciano Coelho /* WEP address keys configured */ 11810b1e8a2SLuciano Coelho __le32 addr_key_count; 11910b1e8a2SLuciano Coelho 12010b1e8a2SLuciano Coelho /* default keys configured */ 12110b1e8a2SLuciano Coelho __le32 default_key_count; 12210b1e8a2SLuciano Coelho 12310b1e8a2SLuciano Coelho __le32 reserved; 12410b1e8a2SLuciano Coelho 12510b1e8a2SLuciano Coelho /* number of times that WEP key not found on lookup */ 12610b1e8a2SLuciano Coelho __le32 key_not_found; 12710b1e8a2SLuciano Coelho 12810b1e8a2SLuciano Coelho /* number of times that WEP key decryption failed */ 12910b1e8a2SLuciano Coelho __le32 decrypt_fail; 13010b1e8a2SLuciano Coelho 13110b1e8a2SLuciano Coelho /* WEP packets decrypted */ 13210b1e8a2SLuciano Coelho __le32 packets; 13310b1e8a2SLuciano Coelho 13410b1e8a2SLuciano Coelho /* WEP decrypt interrupts */ 13510b1e8a2SLuciano Coelho __le32 interrupt; 13610b1e8a2SLuciano Coelho } __packed; 13710b1e8a2SLuciano Coelho 13810b1e8a2SLuciano Coelho #define ACX_MISSED_BEACONS_SPREAD 10 13910b1e8a2SLuciano Coelho 14010b1e8a2SLuciano Coelho struct wl12xx_acx_pwr_statistics { 14110b1e8a2SLuciano Coelho /* the amount of enters into power save mode (both PD & ELP) */ 14210b1e8a2SLuciano Coelho __le32 ps_enter; 14310b1e8a2SLuciano Coelho 14410b1e8a2SLuciano Coelho /* the amount of enters into ELP mode */ 14510b1e8a2SLuciano Coelho __le32 elp_enter; 14610b1e8a2SLuciano Coelho 14710b1e8a2SLuciano Coelho /* the amount of missing beacon interrupts to the host */ 14810b1e8a2SLuciano Coelho __le32 missing_bcns; 14910b1e8a2SLuciano Coelho 15010b1e8a2SLuciano Coelho /* the amount of wake on host-access times */ 15110b1e8a2SLuciano Coelho __le32 wake_on_host; 15210b1e8a2SLuciano Coelho 15310b1e8a2SLuciano Coelho /* the amount of wake on timer-expire */ 15410b1e8a2SLuciano Coelho __le32 wake_on_timer_exp; 15510b1e8a2SLuciano Coelho 15610b1e8a2SLuciano Coelho /* the number of packets that were transmitted with PS bit set */ 15710b1e8a2SLuciano Coelho __le32 tx_with_ps; 15810b1e8a2SLuciano Coelho 15910b1e8a2SLuciano Coelho /* the number of packets that were transmitted with PS bit clear */ 16010b1e8a2SLuciano Coelho __le32 tx_without_ps; 16110b1e8a2SLuciano Coelho 16210b1e8a2SLuciano Coelho /* the number of received beacons */ 16310b1e8a2SLuciano Coelho __le32 rcvd_beacons; 16410b1e8a2SLuciano Coelho 16510b1e8a2SLuciano Coelho /* the number of entering into PowerOn (power save off) */ 16610b1e8a2SLuciano Coelho __le32 power_save_off; 16710b1e8a2SLuciano Coelho 16810b1e8a2SLuciano Coelho /* the number of entries into power save mode */ 16910b1e8a2SLuciano Coelho __le16 enable_ps; 17010b1e8a2SLuciano Coelho 17110b1e8a2SLuciano Coelho /* 17210b1e8a2SLuciano Coelho * the number of exits from power save, not including failed PS 17310b1e8a2SLuciano Coelho * transitions 17410b1e8a2SLuciano Coelho */ 17510b1e8a2SLuciano Coelho __le16 disable_ps; 17610b1e8a2SLuciano Coelho 17710b1e8a2SLuciano Coelho /* 17810b1e8a2SLuciano Coelho * the number of times the TSF counter was adjusted because 17910b1e8a2SLuciano Coelho * of drift 18010b1e8a2SLuciano Coelho */ 18110b1e8a2SLuciano Coelho __le32 fix_tsf_ps; 18210b1e8a2SLuciano Coelho 18310b1e8a2SLuciano Coelho /* Gives statistics about the spread continuous missed beacons. 18410b1e8a2SLuciano Coelho * The 16 LSB are dedicated for the PS mode. 18510b1e8a2SLuciano Coelho * The 16 MSB are dedicated for the PS mode. 18610b1e8a2SLuciano Coelho * cont_miss_bcns_spread[0] - single missed beacon. 18710b1e8a2SLuciano Coelho * cont_miss_bcns_spread[1] - two continuous missed beacons. 18810b1e8a2SLuciano Coelho * cont_miss_bcns_spread[2] - three continuous missed beacons. 18910b1e8a2SLuciano Coelho * ... 19010b1e8a2SLuciano Coelho * cont_miss_bcns_spread[9] - ten and more continuous missed beacons. 19110b1e8a2SLuciano Coelho */ 19210b1e8a2SLuciano Coelho __le32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD]; 19310b1e8a2SLuciano Coelho 19410b1e8a2SLuciano Coelho /* the number of beacons in awake mode */ 19510b1e8a2SLuciano Coelho __le32 rcvd_awake_beacons; 19610b1e8a2SLuciano Coelho } __packed; 19710b1e8a2SLuciano Coelho 19810b1e8a2SLuciano Coelho struct wl12xx_acx_mic_statistics { 19910b1e8a2SLuciano Coelho __le32 rx_pkts; 20010b1e8a2SLuciano Coelho __le32 calc_failure; 20110b1e8a2SLuciano Coelho } __packed; 20210b1e8a2SLuciano Coelho 20310b1e8a2SLuciano Coelho struct wl12xx_acx_aes_statistics { 20410b1e8a2SLuciano Coelho __le32 encrypt_fail; 20510b1e8a2SLuciano Coelho __le32 decrypt_fail; 20610b1e8a2SLuciano Coelho __le32 encrypt_packets; 20710b1e8a2SLuciano Coelho __le32 decrypt_packets; 20810b1e8a2SLuciano Coelho __le32 encrypt_interrupt; 20910b1e8a2SLuciano Coelho __le32 decrypt_interrupt; 21010b1e8a2SLuciano Coelho } __packed; 21110b1e8a2SLuciano Coelho 21210b1e8a2SLuciano Coelho struct wl12xx_acx_event_statistics { 21310b1e8a2SLuciano Coelho __le32 heart_beat; 21410b1e8a2SLuciano Coelho __le32 calibration; 21510b1e8a2SLuciano Coelho __le32 rx_mismatch; 21610b1e8a2SLuciano Coelho __le32 rx_mem_empty; 21710b1e8a2SLuciano Coelho __le32 rx_pool; 21810b1e8a2SLuciano Coelho __le32 oom_late; 21910b1e8a2SLuciano Coelho __le32 phy_transmit_error; 22010b1e8a2SLuciano Coelho __le32 tx_stuck; 22110b1e8a2SLuciano Coelho } __packed; 22210b1e8a2SLuciano Coelho 22310b1e8a2SLuciano Coelho struct wl12xx_acx_ps_statistics { 22410b1e8a2SLuciano Coelho __le32 pspoll_timeouts; 22510b1e8a2SLuciano Coelho __le32 upsd_timeouts; 22610b1e8a2SLuciano Coelho __le32 upsd_max_sptime; 22710b1e8a2SLuciano Coelho __le32 upsd_max_apturn; 22810b1e8a2SLuciano Coelho __le32 pspoll_max_apturn; 22910b1e8a2SLuciano Coelho __le32 pspoll_utilization; 23010b1e8a2SLuciano Coelho __le32 upsd_utilization; 23110b1e8a2SLuciano Coelho } __packed; 23210b1e8a2SLuciano Coelho 23310b1e8a2SLuciano Coelho struct wl12xx_acx_rxpipe_statistics { 23410b1e8a2SLuciano Coelho __le32 rx_prep_beacon_drop; 23510b1e8a2SLuciano Coelho __le32 descr_host_int_trig_rx_data; 23610b1e8a2SLuciano Coelho __le32 beacon_buffer_thres_host_int_trig_rx_data; 23710b1e8a2SLuciano Coelho __le32 missed_beacon_host_int_trig_rx_data; 23810b1e8a2SLuciano Coelho __le32 tx_xfr_host_int_trig_rx_data; 23910b1e8a2SLuciano Coelho } __packed; 24010b1e8a2SLuciano Coelho 24110b1e8a2SLuciano Coelho struct wl12xx_acx_statistics { 24210b1e8a2SLuciano Coelho struct acx_header header; 24310b1e8a2SLuciano Coelho 24410b1e8a2SLuciano Coelho struct wl12xx_acx_tx_statistics tx; 24510b1e8a2SLuciano Coelho struct wl12xx_acx_rx_statistics rx; 24610b1e8a2SLuciano Coelho struct wl12xx_acx_dma_statistics dma; 24710b1e8a2SLuciano Coelho struct wl12xx_acx_isr_statistics isr; 24810b1e8a2SLuciano Coelho struct wl12xx_acx_wep_statistics wep; 24910b1e8a2SLuciano Coelho struct wl12xx_acx_pwr_statistics pwr; 25010b1e8a2SLuciano Coelho struct wl12xx_acx_aes_statistics aes; 25110b1e8a2SLuciano Coelho struct wl12xx_acx_mic_statistics mic; 25210b1e8a2SLuciano Coelho struct wl12xx_acx_event_statistics event; 25310b1e8a2SLuciano Coelho struct wl12xx_acx_ps_statistics ps; 25410b1e8a2SLuciano Coelho struct wl12xx_acx_rxpipe_statistics rxpipe; 25510b1e8a2SLuciano Coelho } __packed; 25610b1e8a2SLuciano 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