2 * This file is part of wl18xx
4 * Copyright (C) 2011 Texas Instruments. All rights reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 #ifndef __WL18XX_ACX_H__
23 #define __WL18XX_ACX_H__
25 #include "../wlcore/wlcore.h"
26 #include "../wlcore/acx.h"
29 ACX_NS_IPV6_FILTER
= 0x0050,
30 ACX_PEER_HT_OPERATION_MODE_CFG
= 0x0051,
31 ACX_CSUM_CONFIG
= 0x0052,
32 ACX_SIM_CONFIG
= 0x0053,
33 ACX_CLEAR_STATISTICS
= 0x0054,
34 ACX_AUTO_RX_STREAMING
= 0x0055,
35 ACX_PEER_CAP
= 0x0056,
36 ACX_INTERRUPT_NOTIFY
= 0x0057,
37 ACX_RX_BA_FILTER
= 0x0058,
38 ACX_AP_SLEEP_CFG
= 0x0059,
39 ACX_DYNAMIC_TRACES_CFG
= 0x005A,
42 /* numbers of bits the length field takes (add 1 for the actual number) */
43 #define WL18XX_HOST_IF_LEN_SIZE_FIELD 15
45 #define WL18XX_ACX_EVENTS_VECTOR (WL1271_ACX_INTR_WATCHDOG | \
46 WL1271_ACX_INTR_INIT_COMPLETE | \
47 WL1271_ACX_INTR_EVENT_A | \
48 WL1271_ACX_INTR_EVENT_B | \
49 WL1271_ACX_INTR_CMD_COMPLETE | \
50 WL1271_ACX_INTR_HW_AVAILABLE | \
51 WL1271_ACX_INTR_DATA | \
52 WL1271_ACX_SW_INTR_WATCHDOG)
54 #define WL18XX_INTR_MASK (WL1271_ACX_INTR_WATCHDOG | \
55 WL1271_ACX_INTR_EVENT_A | \
56 WL1271_ACX_INTR_EVENT_B | \
57 WL1271_ACX_INTR_HW_AVAILABLE | \
58 WL1271_ACX_INTR_DATA | \
59 WL1271_ACX_SW_INTR_WATCHDOG)
61 struct wl18xx_acx_host_config_bitmap
{
62 struct acx_header header
;
64 __le32 host_cfg_bitmap
;
66 __le32 host_sdio_block_size
;
68 /* extra mem blocks per frame in TX. */
69 __le32 extra_mem_blocks
;
72 * number of bits of the length field in the first TX word
73 * (up to 15 - for using the entire 16 bits).
75 __le32 length_field_size
;
80 CHECKSUM_OFFLOAD_DISABLED
= 0,
81 CHECKSUM_OFFLOAD_ENABLED
= 1,
82 CHECKSUM_OFFLOAD_FAKE_RX
= 2,
83 CHECKSUM_OFFLOAD_INVALID
= 0xFF
86 struct wl18xx_acx_checksum_state
{
87 struct acx_header header
;
89 /* enum acx_checksum_state */
95 struct wl18xx_acx_error_stats
{
96 u32 error_frame_non_ctrl
;
98 u32 error_frame_during_protection
;
99 u32 null_frame_tx_start
;
100 u32 null_frame_cts_start
;
102 u32 num_frame_cts_nul_flid
;
103 u32 tx_abort_failure
;
104 u32 tx_resume_failure
;
105 u32 rx_cmplt_db_overflow_cnt
;
106 u32 elp_while_rx_exch
;
107 u32 elp_while_tx_exch
;
109 u32 elp_while_nvic_pending
;
110 u32 rx_excessive_frame_len
;
112 u32 tbc_exch_mismatch
;
115 #define NUM_OF_RATES_INDEXES 30
116 struct wl18xx_acx_tx_stats
{
117 u32 tx_prepared_descs
;
119 u32 tx_template_prepared
;
120 u32 tx_data_prepared
;
121 u32 tx_template_programmed
;
122 u32 tx_data_programmed
;
123 u32 tx_burst_programmed
;
126 u32 tx_start_templates
;
127 u32 tx_start_int_templates
;
130 u32 tx_start_null_frame
;
132 u32 tx_retry_template
;
134 u32 tx_retry_per_rate
[NUM_OF_RATES_INDEXES
];
137 u32 tx_done_template
;
139 u32 tx_done_int_template
;
143 u32 frag_mpdu_alloc_failed
;
144 u32 frag_init_called
;
145 u32 frag_in_process_called
;
146 u32 frag_tkip_called
;
147 u32 frag_key_not_found
;
148 u32 frag_need_fragmentation
;
149 u32 frag_bad_mblk_num
;
155 struct wl18xx_acx_rx_stats
{
156 u32 rx_beacon_early_term
;
157 u32 rx_out_of_mpdu_nodes
;
159 u32 rx_dropped_frame
;
172 u32 defrag_init_called
;
173 u32 defrag_in_process_called
;
174 u32 defrag_tkip_called
;
175 u32 defrag_need_defrag
;
176 u32 defrag_decrypt_failed
;
177 u32 decrypt_key_not_found
;
178 u32 defrag_need_decrypt
;
183 struct wl18xx_acx_isr_stats
{
187 #define PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD 10
189 struct wl18xx_acx_pwr_stats
{
190 u32 missing_bcns_cnt
;
192 u32 connection_out_of_sync
;
193 u32 cont_miss_bcns_spread
[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD
];
194 u32 rcvd_awake_bcns_cnt
;
195 u32 sleep_time_count
;
199 u32 ap_sleep_active_conf
;
200 u32 ap_sleep_user_conf
;
201 u32 ap_sleep_counter
;
204 struct wl18xx_acx_rx_filter_stats
{
211 u32 protection_filter
;
212 u32 accum_arp_pend_requests
;
213 u32 max_arp_queue_dep
;
216 struct wl18xx_acx_rx_rate_stats
{
217 u32 rx_frames_per_rates
[50];
220 #define AGGR_STATS_TX_AGG 16
221 #define AGGR_STATS_RX_SIZE_LEN 16
223 struct wl18xx_acx_aggr_stats
{
224 u32 tx_agg_rate
[AGGR_STATS_TX_AGG
];
225 u32 tx_agg_len
[AGGR_STATS_TX_AGG
];
226 u32 rx_size
[AGGR_STATS_RX_SIZE_LEN
];
229 #define PIPE_STATS_HW_FIFO 11
231 struct wl18xx_acx_pipeline_stats
{
232 u32 hs_tx_stat_fifo_int
;
233 u32 hs_rx_stat_fifo_int
;
234 u32 enc_tx_stat_fifo_int
;
235 u32 enc_rx_stat_fifo_int
;
236 u32 rx_complete_stat_fifo_int
;
240 u32 pre_to_defrag_swi
;
241 u32 defrag_to_rx_xfer_swi
;
243 u32 dec_packet_in_fifo_full
;
245 u16 pipeline_fifo_full
[PIPE_STATS_HW_FIFO
];
249 #define DIVERSITY_STATS_NUM_OF_ANT 2
251 struct wl18xx_acx_diversity_stats
{
252 u32 num_of_packets_per_ant
[DIVERSITY_STATS_NUM_OF_ANT
];
253 u32 total_num_of_toggles
;
256 struct wl18xx_acx_thermal_stats
{
262 u16 adc_source_unexpected
;
265 #define WL18XX_NUM_OF_CALIBRATIONS_ERRORS 18
266 struct wl18xx_acx_calib_failure_stats
{
267 u16 fail_count
[WL18XX_NUM_OF_CALIBRATIONS_ERRORS
];
271 struct wl18xx_roaming_stats
{
275 struct wl18xx_dfs_stats
{
276 u32 num_of_radar_detections
;
279 struct wl18xx_acx_statistics
{
280 struct acx_header header
;
282 struct wl18xx_acx_error_stats error
;
283 struct wl18xx_acx_tx_stats tx
;
284 struct wl18xx_acx_rx_stats rx
;
285 struct wl18xx_acx_isr_stats isr
;
286 struct wl18xx_acx_pwr_stats pwr
;
287 struct wl18xx_acx_rx_filter_stats rx_filter
;
288 struct wl18xx_acx_rx_rate_stats rx_rate
;
289 struct wl18xx_acx_aggr_stats aggr_size
;
290 struct wl18xx_acx_pipeline_stats pipeline
;
291 struct wl18xx_acx_diversity_stats diversity
;
292 struct wl18xx_acx_thermal_stats thermal
;
293 struct wl18xx_acx_calib_failure_stats calib
;
294 struct wl18xx_roaming_stats roaming
;
295 struct wl18xx_dfs_stats dfs
;
298 struct wl18xx_acx_clear_statistics
{
299 struct acx_header header
;
302 enum wlcore_bandwidth
{
303 WLCORE_BANDWIDTH_20MHZ
,
304 WLCORE_BANDWIDTH_40MHZ
,
307 struct wlcore_peer_ht_operation_mode
{
308 struct acx_header header
;
311 u8 bandwidth
; /* enum wlcore_bandwidth */
317 * this struct is very similar to wl1271_acx_ht_capabilities, with the
318 * addition of supported rates
320 struct wlcore_acx_peer_cap
{
321 struct acx_header header
;
323 /* bitmask of capability bits supported by the peer */
324 __le32 ht_capabilites
;
326 /* rates supported by the remote peer */
327 __le32 supported_rates
;
329 /* Indicates to which link these capabilities apply. */
333 * This the maximum A-MPDU length supported by the AP. The FW may not
334 * exceed this length when sending A-MPDUs
338 /* This is the minimal spacing required when sending A-MPDUs to the AP*/
339 u8 ampdu_min_spacing
;
345 * ACX_INTERRUPT_NOTIFY
346 * enable/disable fast-link/PSM notification from FW
348 struct wl18xx_acx_interrupt_notify
{
349 struct acx_header header
;
355 * enable/disable RX BA filtering in FW
357 struct wl18xx_acx_rx_ba_filter
{
358 struct acx_header header
;
362 struct acx_ap_sleep_cfg
{
363 struct acx_header header
;
364 /* Duty Cycle (20-80% of staying Awake) for IDLE AP
368 /* Duty Cycle (20-80% of staying Awake) for Connected AP
371 u8 connected_duty_cycle
;
372 /* Maximum stations that are allowed to be connected to AP
375 u8 max_stations_thresh
;
376 /* Timeout till enabling the Sleep Mechanism after data stops
383 * ACX_DYNAMIC_TRACES_CFG
384 * configure the FW dynamic traces
386 struct acx_dynamic_fw_traces_cfg
{
387 struct acx_header header
;
388 __le32 dynamic_fw_traces
;
391 int wl18xx_acx_host_if_cfg_bitmap(struct wl1271
*wl
, u32 host_cfg_bitmap
,
392 u32 sdio_blk_size
, u32 extra_mem_blks
,
394 int wl18xx_acx_set_checksum_state(struct wl1271
*wl
);
395 int wl18xx_acx_clear_statistics(struct wl1271
*wl
);
396 int wl18xx_acx_peer_ht_operation_mode(struct wl1271
*wl
, u8 hlid
, bool wide
);
397 int wl18xx_acx_set_peer_cap(struct wl1271
*wl
,
398 struct ieee80211_sta_ht_cap
*ht_cap
,
399 bool allow_ht_operation
,
400 u32 rate_set
, u8 hlid
);
401 int wl18xx_acx_interrupt_notify_config(struct wl1271
*wl
, bool action
);
402 int wl18xx_acx_rx_ba_filter(struct wl1271
*wl
, bool action
);
403 int wl18xx_acx_ap_sleep(struct wl1271
*wl
);
404 int wl18xx_acx_dynamic_fw_traces(struct wl1271
*wl
);
406 #endif /* __WL18XX_ACX_H__ */