1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * This file is part of wl18xx
5 * Copyright (C) 2011 Texas Instruments. All rights reserved.
8 #ifndef __WL18XX_ACX_H__
9 #define __WL18XX_ACX_H__
11 #include "../wlcore/wlcore.h"
12 #include "../wlcore/acx.h"
15 ACX_NS_IPV6_FILTER = 0x0050,
16 ACX_PEER_HT_OPERATION_MODE_CFG = 0x0051,
17 ACX_CSUM_CONFIG = 0x0052,
18 ACX_SIM_CONFIG = 0x0053,
19 ACX_CLEAR_STATISTICS = 0x0054,
20 ACX_AUTO_RX_STREAMING = 0x0055,
21 ACX_PEER_CAP = 0x0056,
22 ACX_INTERRUPT_NOTIFY = 0x0057,
23 ACX_RX_BA_FILTER = 0x0058,
24 ACX_AP_SLEEP_CFG = 0x0059,
25 ACX_DYNAMIC_TRACES_CFG = 0x005A,
26 ACX_TIME_SYNC_CFG = 0x005B,
29 /* numbers of bits the length field takes (add 1 for the actual number) */
30 #define WL18XX_HOST_IF_LEN_SIZE_FIELD 15
32 #define WL18XX_ACX_EVENTS_VECTOR (WL1271_ACX_INTR_WATCHDOG | \
33 WL1271_ACX_INTR_INIT_COMPLETE | \
34 WL1271_ACX_INTR_EVENT_A | \
35 WL1271_ACX_INTR_EVENT_B | \
36 WL1271_ACX_INTR_CMD_COMPLETE | \
37 WL1271_ACX_INTR_HW_AVAILABLE | \
38 WL1271_ACX_INTR_DATA | \
39 WL1271_ACX_SW_INTR_WATCHDOG)
41 #define WL18XX_INTR_MASK (WL1271_ACX_INTR_WATCHDOG | \
42 WL1271_ACX_INTR_EVENT_A | \
43 WL1271_ACX_INTR_EVENT_B | \
44 WL1271_ACX_INTR_HW_AVAILABLE | \
45 WL1271_ACX_INTR_DATA | \
46 WL1271_ACX_SW_INTR_WATCHDOG)
48 struct wl18xx_acx_host_config_bitmap {
49 struct acx_header header;
51 __le32 host_cfg_bitmap;
53 __le32 host_sdio_block_size;
55 /* extra mem blocks per frame in TX. */
56 __le32 extra_mem_blocks;
59 * number of bits of the length field in the first TX word
60 * (up to 15 - for using the entire 16 bits).
62 __le32 length_field_size;
67 CHECKSUM_OFFLOAD_DISABLED = 0,
68 CHECKSUM_OFFLOAD_ENABLED = 1,
69 CHECKSUM_OFFLOAD_FAKE_RX = 2,
70 CHECKSUM_OFFLOAD_INVALID = 0xFF
73 struct wl18xx_acx_checksum_state {
74 struct acx_header header;
76 /* enum acx_checksum_state */
82 struct wl18xx_acx_error_stats {
83 u32 error_frame_non_ctrl;
85 u32 error_frame_during_protection;
86 u32 null_frame_tx_start;
87 u32 null_frame_cts_start;
89 u32 num_frame_cts_nul_flid;
91 u32 tx_resume_failure;
92 u32 rx_cmplt_db_overflow_cnt;
93 u32 elp_while_rx_exch;
94 u32 elp_while_tx_exch;
96 u32 elp_while_nvic_pending;
97 u32 rx_excessive_frame_len;
99 u32 tbc_exch_mismatch;
102 #define NUM_OF_RATES_INDEXES 30
103 struct wl18xx_acx_tx_stats {
104 u32 tx_prepared_descs;
106 u32 tx_template_prepared;
107 u32 tx_data_prepared;
108 u32 tx_template_programmed;
109 u32 tx_data_programmed;
110 u32 tx_burst_programmed;
113 u32 tx_start_templates;
114 u32 tx_start_int_templates;
117 u32 tx_start_null_frame;
119 u32 tx_retry_template;
121 u32 tx_retry_per_rate[NUM_OF_RATES_INDEXES];
124 u32 tx_done_template;
126 u32 tx_done_int_template;
130 u32 frag_mpdu_alloc_failed;
131 u32 frag_init_called;
132 u32 frag_in_process_called;
133 u32 frag_tkip_called;
134 u32 frag_key_not_found;
135 u32 frag_need_fragmentation;
136 u32 frag_bad_mblk_num;
142 struct wl18xx_acx_rx_stats {
143 u32 rx_beacon_early_term;
144 u32 rx_out_of_mpdu_nodes;
146 u32 rx_dropped_frame;
159 u32 defrag_init_called;
160 u32 defrag_in_process_called;
161 u32 defrag_tkip_called;
162 u32 defrag_need_defrag;
163 u32 defrag_decrypt_failed;
164 u32 decrypt_key_not_found;
165 u32 defrag_need_decrypt;
170 struct wl18xx_acx_isr_stats {
174 #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
176 struct wl18xx_acx_pwr_stats {
177 u32 missing_bcns_cnt;
179 u32 connection_out_of_sync;
180 u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
181 u32 rcvd_awake_bcns_cnt;
182 u32 sleep_time_count;
186 u32 ap_sleep_active_conf;
187 u32 ap_sleep_user_conf;
188 u32 ap_sleep_counter;
191 struct wl18xx_acx_rx_filter_stats {
198 u32 protection_filter;
199 u32 accum_arp_pend_requests;
200 u32 max_arp_queue_dep;
203 struct wl18xx_acx_rx_rate_stats {
204 u32 rx_frames_per_rates[50];
207 #define AGGR_STATS_TX_AGG 16
208 #define AGGR_STATS_RX_SIZE_LEN 16
210 struct wl18xx_acx_aggr_stats {
211 u32 tx_agg_rate[AGGR_STATS_TX_AGG];
212 u32 tx_agg_len[AGGR_STATS_TX_AGG];
213 u32 rx_size[AGGR_STATS_RX_SIZE_LEN];
216 #define PIPE_STATS_HW_FIFO 11
218 struct wl18xx_acx_pipeline_stats {
219 u32 hs_tx_stat_fifo_int;
220 u32 hs_rx_stat_fifo_int;
221 u32 enc_tx_stat_fifo_int;
222 u32 enc_rx_stat_fifo_int;
223 u32 rx_complete_stat_fifo_int;
227 u32 pre_to_defrag_swi;
228 u32 defrag_to_rx_xfer_swi;
230 u32 dec_packet_in_fifo_full;
232 u16 pipeline_fifo_full[PIPE_STATS_HW_FIFO];
236 #define DIVERSITY_STATS_NUM_OF_ANT 2
238 struct wl18xx_acx_diversity_stats {
239 u32 num_of_packets_per_ant[DIVERSITY_STATS_NUM_OF_ANT];
240 u32 total_num_of_toggles;
243 struct wl18xx_acx_thermal_stats {
249 u16 adc_source_unexpected;
252 #define WL18XX_NUM_OF_CALIBRATIONS_ERRORS 18
253 struct wl18xx_acx_calib_failure_stats {
254 u16 fail_count[WL18XX_NUM_OF_CALIBRATIONS_ERRORS];
258 struct wl18xx_roaming_stats {
262 struct wl18xx_dfs_stats {
263 u32 num_of_radar_detections;
266 struct wl18xx_acx_statistics {
267 struct acx_header header;
269 struct wl18xx_acx_error_stats error;
270 struct wl18xx_acx_tx_stats tx;
271 struct wl18xx_acx_rx_stats rx;
272 struct wl18xx_acx_isr_stats isr;
273 struct wl18xx_acx_pwr_stats pwr;
274 struct wl18xx_acx_rx_filter_stats rx_filter;
275 struct wl18xx_acx_rx_rate_stats rx_rate;
276 struct wl18xx_acx_aggr_stats aggr_size;
277 struct wl18xx_acx_pipeline_stats pipeline;
278 struct wl18xx_acx_diversity_stats diversity;
279 struct wl18xx_acx_thermal_stats thermal;
280 struct wl18xx_acx_calib_failure_stats calib;
281 struct wl18xx_roaming_stats roaming;
282 struct wl18xx_dfs_stats dfs;
285 struct wl18xx_acx_clear_statistics {
286 struct acx_header header;
289 enum wlcore_bandwidth {
290 WLCORE_BANDWIDTH_20MHZ,
291 WLCORE_BANDWIDTH_40MHZ,
294 struct wlcore_peer_ht_operation_mode {
295 struct acx_header header;
298 u8 bandwidth; /* enum wlcore_bandwidth */
304 * this struct is very similar to wl1271_acx_ht_capabilities, with the
305 * addition of supported rates
307 struct wlcore_acx_peer_cap {
308 struct acx_header header;
310 /* bitmask of capability bits supported by the peer */
311 __le32 ht_capabilites;
313 /* rates supported by the remote peer */
314 __le32 supported_rates;
316 /* Indicates to which link these capabilities apply. */
320 * This the maximum A-MPDU length supported by the AP. The FW may not
321 * exceed this length when sending A-MPDUs
325 /* This is the minimal spacing required when sending A-MPDUs to the AP*/
326 u8 ampdu_min_spacing;
332 * ACX_INTERRUPT_NOTIFY
333 * enable/disable fast-link/PSM notification from FW
335 struct wl18xx_acx_interrupt_notify {
336 struct acx_header header;
342 * enable/disable RX BA filtering in FW
344 struct wl18xx_acx_rx_ba_filter {
345 struct acx_header header;
349 struct acx_ap_sleep_cfg {
350 struct acx_header header;
351 /* Duty Cycle (20-80% of staying Awake) for IDLE AP
355 /* Duty Cycle (20-80% of staying Awake) for Connected AP
358 u8 connected_duty_cycle;
359 /* Maximum stations that are allowed to be connected to AP
362 u8 max_stations_thresh;
363 /* Timeout till enabling the Sleep Mechanism after data stops
370 * ACX_DYNAMIC_TRACES_CFG
371 * configure the FW dynamic traces
373 struct acx_dynamic_fw_traces_cfg {
374 struct acx_header header;
375 __le32 dynamic_fw_traces;
380 * configure the time sync parameters
382 struct acx_time_sync_cfg {
383 struct acx_header header;
385 u8 zone_mac_addr[ETH_ALEN];
389 int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
390 u32 sdio_blk_size, u32 extra_mem_blks,
392 int wl18xx_acx_set_checksum_state(struct wl1271 *wl);
393 int wl18xx_acx_clear_statistics(struct wl1271 *wl);
394 int wl18xx_acx_peer_ht_operation_mode(struct wl1271 *wl, u8 hlid, bool wide);
395 int wl18xx_acx_set_peer_cap(struct wl1271 *wl,
396 struct ieee80211_sta_ht_cap *ht_cap,
397 bool allow_ht_operation,
398 u32 rate_set, u8 hlid);
399 int wl18xx_acx_interrupt_notify_config(struct wl1271 *wl, bool action);
400 int wl18xx_acx_rx_ba_filter(struct wl1271 *wl, bool action);
401 int wl18xx_acx_ap_sleep(struct wl1271 *wl);
402 int wl18xx_acx_dynamic_fw_traces(struct wl1271 *wl);
403 int wl18xx_acx_time_sync_cfg(struct wl1271 *wl);
405 #endif /* __WL18XX_ACX_H__ */