Loading...
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2012-2014, 2018, 2020 - 2021, 2023 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
6 */
7#ifndef __iwl_fw_api_stats_h__
8#define __iwl_fw_api_stats_h__
9#include "mac.h"
10#include "mac-cfg.h"
11
12struct mvm_statistics_dbg {
13 __le32 burst_check;
14 __le32 burst_count;
15 __le32 wait_for_silence_timeout_cnt;
16 u8 reserved[12];
17} __packed; /* STATISTICS_DEBUG_API_S_VER_2 */
18
19struct mvm_statistics_div {
20 __le32 tx_on_a;
21 __le32 tx_on_b;
22 __le32 exec_time;
23 __le32 probe_time;
24 __le32 rssi_ant;
25 __le32 reserved2;
26} __packed; /* STATISTICS_SLOW_DIV_API_S_VER_2 */
27
28/**
29 * struct mvm_statistics_rx_non_phy
30 * @bogus_cts: CTS received when not expecting CTS
31 * @bogus_ack: ACK received when not expecting ACK
32 * @non_channel_beacons: beacons with our bss id but not on our serving channel
33 * @channel_beacons: beacons with our bss id and in our serving channel
34 * @num_missed_bcon: number of missed beacons
35 * @adc_rx_saturation_time: count in 0.8us units the time the ADC was in
36 * saturation
37 * @ina_detection_search_time: total time (in 0.8us) searched for INA
38 * @beacon_silence_rssi_a: RSSI silence after beacon frame
39 * @beacon_silence_rssi_b: RSSI silence after beacon frame
40 * @beacon_silence_rssi_c: RSSI silence after beacon frame
41 * @interference_data_flag: flag for interference data availability. 1 when data
42 * is available.
43 * @channel_load: counts RX Enable time in uSec
44 * @beacon_rssi_a: beacon RSSI on antenna A
45 * @beacon_rssi_b: beacon RSSI on antenna B
46 * @beacon_rssi_c: beacon RSSI on antenna C
47 * @beacon_energy_a: beacon energy on antenna A
48 * @beacon_energy_b: beacon energy on antenna B
49 * @beacon_energy_c: beacon energy on antenna C
50 * @num_bt_kills: number of BT "kills" (frame TX aborts)
51 * @mac_id: mac ID
52 */
53struct mvm_statistics_rx_non_phy {
54 __le32 bogus_cts;
55 __le32 bogus_ack;
56 __le32 non_channel_beacons;
57 __le32 channel_beacons;
58 __le32 num_missed_bcon;
59 __le32 adc_rx_saturation_time;
60 __le32 ina_detection_search_time;
61 __le32 beacon_silence_rssi_a;
62 __le32 beacon_silence_rssi_b;
63 __le32 beacon_silence_rssi_c;
64 __le32 interference_data_flag;
65 __le32 channel_load;
66 __le32 beacon_rssi_a;
67 __le32 beacon_rssi_b;
68 __le32 beacon_rssi_c;
69 __le32 beacon_energy_a;
70 __le32 beacon_energy_b;
71 __le32 beacon_energy_c;
72 __le32 num_bt_kills;
73 __le32 mac_id;
74} __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_4 */
75
76struct mvm_statistics_rx_non_phy_v3 {
77 __le32 bogus_cts; /* CTS received when not expecting CTS */
78 __le32 bogus_ack; /* ACK received when not expecting ACK */
79 __le32 non_bssid_frames; /* number of frames with BSSID that
80 * doesn't belong to the STA BSSID */
81 __le32 filtered_frames; /* count frames that were dumped in the
82 * filtering process */
83 __le32 non_channel_beacons; /* beacons with our bss id but not on
84 * our serving channel */
85 __le32 channel_beacons; /* beacons with our bss id and in our
86 * serving channel */
87 __le32 num_missed_bcon; /* number of missed beacons */
88 __le32 adc_rx_saturation_time; /* count in 0.8us units the time the
89 * ADC was in saturation */
90 __le32 ina_detection_search_time;/* total time (in 0.8us) searched
91 * for INA */
92 __le32 beacon_silence_rssi_a; /* RSSI silence after beacon frame */
93 __le32 beacon_silence_rssi_b; /* RSSI silence after beacon frame */
94 __le32 beacon_silence_rssi_c; /* RSSI silence after beacon frame */
95 __le32 interference_data_flag; /* flag for interference data
96 * availability. 1 when data is
97 * available. */
98 __le32 channel_load; /* counts RX Enable time in uSec */
99 __le32 dsp_false_alarms; /* DSP false alarm (both OFDM
100 * and CCK) counter */
101 __le32 beacon_rssi_a;
102 __le32 beacon_rssi_b;
103 __le32 beacon_rssi_c;
104 __le32 beacon_energy_a;
105 __le32 beacon_energy_b;
106 __le32 beacon_energy_c;
107 __le32 num_bt_kills;
108 __le32 mac_id;
109 __le32 directed_data_mpdu;
110} __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_3 */
111
112struct mvm_statistics_rx_phy {
113 __le32 unresponded_rts;
114 __le32 rxe_frame_lmt_overrun;
115 __le32 sent_ba_rsp_cnt;
116 __le32 dsp_self_kill;
117 __le32 reserved;
118} __packed; /* STATISTICS_RX_PHY_API_S_VER_3 */
119
120struct mvm_statistics_rx_phy_v2 {
121 __le32 ina_cnt;
122 __le32 fina_cnt;
123 __le32 plcp_err;
124 __le32 crc32_err;
125 __le32 overrun_err;
126 __le32 early_overrun_err;
127 __le32 crc32_good;
128 __le32 false_alarm_cnt;
129 __le32 fina_sync_err_cnt;
130 __le32 sfd_timeout;
131 __le32 fina_timeout;
132 __le32 unresponded_rts;
133 __le32 rxe_frame_lmt_overrun;
134 __le32 sent_ack_cnt;
135 __le32 sent_cts_cnt;
136 __le32 sent_ba_rsp_cnt;
137 __le32 dsp_self_kill;
138 __le32 mh_format_err;
139 __le32 re_acq_main_rssi_sum;
140 __le32 reserved;
141} __packed; /* STATISTICS_RX_PHY_API_S_VER_2 */
142
143struct mvm_statistics_rx_ht_phy_v1 {
144 __le32 plcp_err;
145 __le32 overrun_err;
146 __le32 early_overrun_err;
147 __le32 crc32_good;
148 __le32 crc32_err;
149 __le32 mh_format_err;
150 __le32 agg_crc32_good;
151 __le32 agg_mpdu_cnt;
152 __le32 agg_cnt;
153 __le32 unsupport_mcs;
154} __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_1 */
155
156struct mvm_statistics_rx_ht_phy {
157 __le32 mh_format_err;
158 __le32 agg_mpdu_cnt;
159 __le32 agg_cnt;
160 __le32 unsupport_mcs;
161} __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_2 */
162
163struct mvm_statistics_tx_non_phy_v3 {
164 __le32 preamble_cnt;
165 __le32 rx_detected_cnt;
166 __le32 bt_prio_defer_cnt;
167 __le32 bt_prio_kill_cnt;
168 __le32 few_bytes_cnt;
169 __le32 cts_timeout;
170 __le32 ack_timeout;
171 __le32 expected_ack_cnt;
172 __le32 actual_ack_cnt;
173 __le32 dump_msdu_cnt;
174 __le32 burst_abort_next_frame_mismatch_cnt;
175 __le32 burst_abort_missing_next_frame_cnt;
176 __le32 cts_timeout_collision;
177 __le32 ack_or_ba_timeout_collision;
178} __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_3 */
179
180struct mvm_statistics_tx_non_phy {
181 __le32 bt_prio_defer_cnt;
182 __le32 bt_prio_kill_cnt;
183 __le32 few_bytes_cnt;
184 __le32 cts_timeout;
185 __le32 ack_timeout;
186 __le32 dump_msdu_cnt;
187 __le32 burst_abort_next_frame_mismatch_cnt;
188 __le32 burst_abort_missing_next_frame_cnt;
189 __le32 cts_timeout_collision;
190 __le32 ack_or_ba_timeout_collision;
191} __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_4 */
192
193#define MAX_CHAINS 3
194
195struct mvm_statistics_tx_non_phy_agg {
196 __le32 ba_timeout;
197 __le32 ba_reschedule_frames;
198 __le32 scd_query_agg_frame_cnt;
199 __le32 scd_query_no_agg;
200 __le32 scd_query_agg;
201 __le32 scd_query_mismatch;
202 __le32 frame_not_ready;
203 __le32 underrun;
204 __le32 bt_prio_kill;
205 __le32 rx_ba_rsp_cnt;
206 __s8 txpower[MAX_CHAINS];
207 __s8 reserved;
208 __le32 reserved2;
209} __packed; /* STATISTICS_TX_NON_PHY_AGG_API_S_VER_1 */
210
211struct mvm_statistics_tx_channel_width {
212 __le32 ext_cca_narrow_ch20[1];
213 __le32 ext_cca_narrow_ch40[2];
214 __le32 ext_cca_narrow_ch80[3];
215 __le32 ext_cca_narrow_ch160[4];
216 __le32 last_tx_ch_width_indx;
217 __le32 rx_detected_per_ch_width[4];
218 __le32 success_per_ch_width[4];
219 __le32 fail_per_ch_width[4];
220}; /* STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
221
222struct mvm_statistics_tx_v4 {
223 struct mvm_statistics_tx_non_phy_v3 general;
224 struct mvm_statistics_tx_non_phy_agg agg;
225 struct mvm_statistics_tx_channel_width channel_width;
226} __packed; /* STATISTICS_TX_API_S_VER_4 */
227
228struct mvm_statistics_tx {
229 struct mvm_statistics_tx_non_phy general;
230 struct mvm_statistics_tx_non_phy_agg agg;
231 struct mvm_statistics_tx_channel_width channel_width;
232} __packed; /* STATISTICS_TX_API_S_VER_5 */
233
234
235struct mvm_statistics_bt_activity {
236 __le32 hi_priority_tx_req_cnt;
237 __le32 hi_priority_tx_denied_cnt;
238 __le32 lo_priority_tx_req_cnt;
239 __le32 lo_priority_tx_denied_cnt;
240 __le32 hi_priority_rx_req_cnt;
241 __le32 hi_priority_rx_denied_cnt;
242 __le32 lo_priority_rx_req_cnt;
243 __le32 lo_priority_rx_denied_cnt;
244} __packed; /* STATISTICS_BT_ACTIVITY_API_S_VER_1 */
245
246struct mvm_statistics_general_common_v19 {
247 __le32 radio_temperature;
248 __le32 radio_voltage;
249 struct mvm_statistics_dbg dbg;
250 __le32 sleep_time;
251 __le32 slots_out;
252 __le32 slots_idle;
253 __le32 ttl_timestamp;
254 struct mvm_statistics_div slow_div;
255 __le32 rx_enable_counter;
256 /*
257 * num_of_sos_states:
258 * count the number of times we have to re-tune
259 * in order to get out of bad PHY status
260 */
261 __le32 num_of_sos_states;
262 __le32 beacon_filtered;
263 __le32 missed_beacons;
264 u8 beacon_filter_average_energy;
265 u8 beacon_filter_reason;
266 u8 beacon_filter_current_energy;
267 u8 beacon_filter_reserved;
268 __le32 beacon_filter_delta_time;
269 struct mvm_statistics_bt_activity bt_activity;
270 __le64 rx_time;
271 __le64 on_time_rf;
272 __le64 on_time_scan;
273 __le64 tx_time;
274} __packed;
275
276struct mvm_statistics_general_common {
277 __le32 radio_temperature;
278 struct mvm_statistics_dbg dbg;
279 __le32 sleep_time;
280 __le32 slots_out;
281 __le32 slots_idle;
282 __le32 ttl_timestamp;
283 struct mvm_statistics_div slow_div;
284 __le32 rx_enable_counter;
285 /*
286 * num_of_sos_states:
287 * count the number of times we have to re-tune
288 * in order to get out of bad PHY status
289 */
290 __le32 num_of_sos_states;
291 __le32 beacon_filtered;
292 __le32 missed_beacons;
293 u8 beacon_filter_average_energy;
294 u8 beacon_filter_reason;
295 u8 beacon_filter_current_energy;
296 u8 beacon_filter_reserved;
297 __le32 beacon_filter_delta_time;
298 struct mvm_statistics_bt_activity bt_activity;
299 __le64 rx_time;
300 __le64 on_time_rf;
301 __le64 on_time_scan;
302 __le64 tx_time;
303} __packed; /* STATISTICS_GENERAL_API_S_VER_10 */
304
305struct mvm_statistics_general_v8 {
306 struct mvm_statistics_general_common_v19 common;
307 __le32 beacon_counter[NUM_MAC_INDEX];
308 u8 beacon_average_energy[NUM_MAC_INDEX];
309 u8 reserved[4 - (NUM_MAC_INDEX % 4)];
310} __packed; /* STATISTICS_GENERAL_API_S_VER_8 */
311
312struct mvm_statistics_general {
313 struct mvm_statistics_general_common common;
314 __le32 beacon_counter[MAC_INDEX_AUX];
315 u8 beacon_average_energy[MAC_INDEX_AUX];
316 u8 reserved[8 - MAC_INDEX_AUX];
317} __packed; /* STATISTICS_GENERAL_API_S_VER_10 */
318
319/**
320 * struct mvm_statistics_load - RX statistics for multi-queue devices
321 * @air_time: accumulated air time, per mac
322 * @byte_count: accumulated byte count, per mac
323 * @pkt_count: accumulated packet count, per mac
324 * @avg_energy: average RSSI, per station
325 */
326struct mvm_statistics_load {
327 __le32 air_time[MAC_INDEX_AUX];
328 __le32 byte_count[MAC_INDEX_AUX];
329 __le32 pkt_count[MAC_INDEX_AUX];
330 u8 avg_energy[IWL_MVM_STATION_COUNT_MAX];
331} __packed; /* STATISTICS_RX_MAC_STATION_S_VER_3 */
332
333struct mvm_statistics_load_v1 {
334 __le32 air_time[NUM_MAC_INDEX];
335 __le32 byte_count[NUM_MAC_INDEX];
336 __le32 pkt_count[NUM_MAC_INDEX];
337 u8 avg_energy[IWL_MVM_STATION_COUNT_MAX];
338} __packed; /* STATISTICS_RX_MAC_STATION_S_VER_1 */
339
340struct mvm_statistics_rx {
341 struct mvm_statistics_rx_phy ofdm;
342 struct mvm_statistics_rx_phy cck;
343 struct mvm_statistics_rx_non_phy general;
344 struct mvm_statistics_rx_ht_phy ofdm_ht;
345} __packed; /* STATISTICS_RX_API_S_VER_4 */
346
347struct mvm_statistics_rx_v3 {
348 struct mvm_statistics_rx_phy_v2 ofdm;
349 struct mvm_statistics_rx_phy_v2 cck;
350 struct mvm_statistics_rx_non_phy_v3 general;
351 struct mvm_statistics_rx_ht_phy_v1 ofdm_ht;
352} __packed; /* STATISTICS_RX_API_S_VER_3 */
353
354/*
355 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
356 *
357 * By default, uCode issues this notification after receiving a beacon
358 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
359 * STATISTICS_CMD (0x9c), below.
360 */
361
362struct iwl_notif_statistics_v10 {
363 __le32 flag;
364 struct mvm_statistics_rx_v3 rx;
365 struct mvm_statistics_tx_v4 tx;
366 struct mvm_statistics_general_v8 general;
367} __packed; /* STATISTICS_NTFY_API_S_VER_10 */
368
369struct iwl_notif_statistics_v11 {
370 __le32 flag;
371 struct mvm_statistics_rx_v3 rx;
372 struct mvm_statistics_tx_v4 tx;
373 struct mvm_statistics_general_v8 general;
374 struct mvm_statistics_load_v1 load_stats;
375} __packed; /* STATISTICS_NTFY_API_S_VER_11 */
376
377struct iwl_notif_statistics {
378 __le32 flag;
379 struct mvm_statistics_rx rx;
380 struct mvm_statistics_tx tx;
381 struct mvm_statistics_general general;
382 struct mvm_statistics_load load_stats;
383} __packed; /* STATISTICS_NTFY_API_S_VER_13 */
384
385/**
386 * enum iwl_statistics_notif_flags - flags used in statistics notification
387 * @IWL_STATISTICS_REPLY_FLG_CLEAR: statistics were cleared after this report
388 */
389enum iwl_statistics_notif_flags {
390 IWL_STATISTICS_REPLY_FLG_CLEAR = 0x1,
391};
392
393/**
394 * enum iwl_statistics_cmd_flags - flags used in statistics command
395 * @IWL_STATISTICS_FLG_CLEAR: request to clear statistics after the report
396 * that's sent after this command
397 * @IWL_STATISTICS_FLG_DISABLE_NOTIF: disable unilateral statistics
398 * notifications
399 */
400enum iwl_statistics_cmd_flags {
401 IWL_STATISTICS_FLG_CLEAR = 0x1,
402 IWL_STATISTICS_FLG_DISABLE_NOTIF = 0x2,
403};
404
405/**
406 * struct iwl_statistics_cmd - statistics config command
407 * @flags: flags from &enum iwl_statistics_cmd_flags
408 */
409struct iwl_statistics_cmd {
410 __le32 flags;
411} __packed; /* STATISTICS_CMD_API_S_VER_1 */
412
413#define MAX_BCAST_FILTER_NUM 8
414
415/**
416 * enum iwl_statistics_notify_type_id - type_id used in system statistics
417 * command
418 * @IWL_STATS_NTFY_TYPE_ID_OPER: request legacy statistics
419 * @IWL_STATS_NTFY_TYPE_ID_OPER_PART1: request operational part1 statistics
420 * @IWL_STATS_NTFY_TYPE_ID_OPER_PART2: request operational part2 statistics
421 * @IWL_STATS_NTFY_TYPE_ID_OPER_PART3: request operational part3 statistics
422 * @IWL_STATS_NTFY_TYPE_ID_OPER_PART4: request operational part4 statistics
423 */
424enum iwl_statistics_notify_type_id {
425 IWL_STATS_NTFY_TYPE_ID_OPER = BIT(0),
426 IWL_STATS_NTFY_TYPE_ID_OPER_PART1 = BIT(1),
427 IWL_STATS_NTFY_TYPE_ID_OPER_PART2 = BIT(2),
428 IWL_STATS_NTFY_TYPE_ID_OPER_PART3 = BIT(3),
429 IWL_STATS_NTFY_TYPE_ID_OPER_PART4 = BIT(4),
430};
431
432/**
433 * enum iwl_statistics_cfg_flags - cfg_mask used in system statistics command
434 * @IWL_STATS_CFG_FLG_DISABLE_NTFY_MSK: 0 for enable, 1 for disable
435 * @IWL_STATS_CFG_FLG_ON_DEMAND_NTFY_MSK: 0 for periodic, 1 for on-demand
436 * @IWL_STATS_CFG_FLG_RESET_MSK: 0 for reset statistics after
437 * sending the notification, 1 for do not reset statistics after sending
438 * the notification
439 */
440enum iwl_statistics_cfg_flags {
441 IWL_STATS_CFG_FLG_DISABLE_NTFY_MSK = BIT(0),
442 IWL_STATS_CFG_FLG_ON_DEMAND_NTFY_MSK = BIT(1),
443 IWL_STATS_CFG_FLG_RESET_MSK = BIT(2),
444};
445
446/**
447 * struct iwl_system_statistics_cmd - system statistics command
448 * @cfg_mask: configuration mask, &enum iwl_statistics_cfg_flags
449 * @config_time_sec: time in sec for periodic notification
450 * @type_id_mask: type_id masks, &enum iwl_statistics_notify_type_id
451 */
452struct iwl_system_statistics_cmd {
453 __le32 cfg_mask;
454 __le32 config_time_sec;
455 __le32 type_id_mask;
456} __packed; /* STATISTICS_FW_CMD_API_S_VER_1 */
457
458/**
459 * enum iwl_fw_statistics_type
460 *
461 * @FW_STATISTICS_OPERATIONAL: operational statistics
462 * @FW_STATISTICS_PHY: phy statistics
463 * @FW_STATISTICS_MAC: mac statistics
464 * @FW_STATISTICS_RX: rx statistics
465 * @FW_STATISTICS_TX: tx statistics
466 * @FW_STATISTICS_DURATION: duration statistics
467 * @FW_STATISTICS_HE: he statistics
468 */
469enum iwl_fw_statistics_type {
470 FW_STATISTICS_OPERATIONAL,
471 FW_STATISTICS_PHY,
472 FW_STATISTICS_MAC,
473 FW_STATISTICS_RX,
474 FW_STATISTICS_TX,
475 FW_STATISTICS_DURATION,
476 FW_STATISTICS_HE,
477}; /* FW_STATISTICS_TYPE_API_E_VER_1 */
478
479#define IWL_STATISTICS_TYPE_MSK 0x7f
480/**
481 * struct iwl_statistics_ntfy_hdr
482 *
483 * @type: struct type
484 * @version: version of the struct
485 * @size: size in bytes
486 */
487struct iwl_statistics_ntfy_hdr {
488 u8 type;
489 u8 version;
490 __le16 size;
491}; /* STATISTICS_NTFY_HDR_API_S_VER_1 */
492
493/**
494 * struct iwl_stats_ntfy_per_link
495 *
496 * @beacon_filter_average_energy: Average energy [-dBm] of the 2
497 * antennas.
498 * @air_time: air time
499 * @beacon_counter: all beacons (both filtered and not filtered)
500 * @beacon_average_energy: Average energy [-dBm] of all beacons
501 * (both filtered and not filtered)
502 * @beacon_rssi_a: beacon RSSI on antenna A
503 * @beacon_rssi_b: beacon RSSI on antenna B
504 * @rx_bytes: RX byte count
505 */
506struct iwl_stats_ntfy_per_link {
507 __le32 beacon_filter_average_energy;
508 __le32 air_time;
509 __le32 beacon_counter;
510 __le32 beacon_average_energy;
511 __le32 beacon_rssi_a;
512 __le32 beacon_rssi_b;
513 __le32 rx_bytes;
514} __packed; /* STATISTICS_NTFY_PER_LINK_API_S_VER_1 */
515
516/**
517 * struct iwl_stats_ntfy_part1_per_link
518 *
519 * @rx_time: rx time
520 * @tx_time: tx time
521 * @rx_action: action frames handled by FW
522 * @tx_action: action frames generated and transmitted by FW
523 * @cca_defers: cca defer count
524 * @beacon_filtered: filtered out beacons
525 */
526struct iwl_stats_ntfy_part1_per_link {
527 __le64 rx_time;
528 __le64 tx_time;
529 __le32 rx_action;
530 __le32 tx_action;
531 __le32 cca_defers;
532 __le32 beacon_filtered;
533} __packed; /* STATISTICS_FW_NTFY_OPERATIONAL_PART1_PER_LINK_API_S_VER_1 */
534
535/**
536 * struct iwl_stats_ntfy_per_mac
537 *
538 * @beacon_filter_average_energy: Average energy [-dBm] of the 2
539 * antennas.
540 * @air_time: air time
541 * @beacon_counter: all beacons (both filtered and not filtered)
542 * @beacon_average_energy: all beacons (both filtered and not
543 * filtered)
544 * @beacon_rssi_a: beacon RSSI on antenna A
545 * @beacon_rssi_b: beacon RSSI on antenna B
546 * @rx_bytes: RX byte count
547 */
548struct iwl_stats_ntfy_per_mac {
549 __le32 beacon_filter_average_energy;
550 __le32 air_time;
551 __le32 beacon_counter;
552 __le32 beacon_average_energy;
553 __le32 beacon_rssi_a;
554 __le32 beacon_rssi_b;
555 __le32 rx_bytes;
556} __packed; /* STATISTICS_NTFY_PER_MAC_API_S_VER_1 */
557
558#define IWL_STATS_MAX_BW_INDEX 5
559/** struct iwl_stats_ntfy_per_phy
560 * @channel_load: channel load
561 * @channel_load_by_us: device contribution to MCLM
562 * @channel_load_not_by_us: other devices' contribution to MCLM
563 * @clt: CLT HW timer (TIM_CH_LOAD2)
564 * @act: active accumulator SW
565 * @elp: elapsed time accumulator SW
566 * @rx_detected_per_ch_width: number of deferred TX per channel width,
567 * 0 - 20, 1/2/3 - 40/80/160
568 * @success_per_ch_width: number of frames that got ACK/BACK/CTS
569 * per channel BW. note, BACK counted as 1
570 * @fail_per_ch_width: number of frames that didn't get ACK/BACK/CTS
571 * per channel BW. note BACK counted as 1
572 * @last_tx_ch_width_indx: last txed frame channel width index
573 */
574struct iwl_stats_ntfy_per_phy {
575 __le32 channel_load;
576 __le32 channel_load_by_us;
577 __le32 channel_load_not_by_us;
578 __le32 clt;
579 __le32 act;
580 __le32 elp;
581 __le32 rx_detected_per_ch_width[IWL_STATS_MAX_BW_INDEX];
582 __le32 success_per_ch_width[IWL_STATS_MAX_BW_INDEX];
583 __le32 fail_per_ch_width[IWL_STATS_MAX_BW_INDEX];
584 __le32 last_tx_ch_width_indx;
585} __packed; /* STATISTICS_NTFY_PER_PHY_API_S_VER_1 */
586
587/**
588 * struct iwl_stats_ntfy_per_sta
589 *
590 * @average_energy: in fact it is minus the energy..
591 */
592struct iwl_stats_ntfy_per_sta {
593 __le32 average_energy;
594} __packed; /* STATISTICS_NTFY_PER_STA_API_S_VER_1 */
595
596#define IWL_STATS_MAX_PHY_OPERATIONAL 3
597#define IWL_STATS_MAX_FW_LINKS (IWL_MVM_FW_MAX_LINK_ID + 1)
598
599/**
600 * struct iwl_system_statistics_notif_oper
601 *
602 * @time_stamp: time when the notification is sent from firmware
603 * @per_link: per link statistics, &struct iwl_stats_ntfy_per_link
604 * @per_phy: per phy statistics, &struct iwl_stats_ntfy_per_phy
605 * @per_sta: per sta statistics, &struct iwl_stats_ntfy_per_sta
606 */
607struct iwl_system_statistics_notif_oper {
608 __le32 time_stamp;
609 struct iwl_stats_ntfy_per_link per_link[IWL_STATS_MAX_FW_LINKS];
610 struct iwl_stats_ntfy_per_phy per_phy[IWL_STATS_MAX_PHY_OPERATIONAL];
611 struct iwl_stats_ntfy_per_sta per_sta[IWL_MVM_STATION_COUNT_MAX];
612} __packed; /* STATISTICS_FW_NTFY_OPERATIONAL_API_S_VER_3 */
613
614/**
615 * struct iwl_system_statistics_part1_notif_oper
616 *
617 * @time_stamp: time when the notification is sent from firmware
618 * @per_link: per link statistics &struct iwl_stats_ntfy_part1_per_link
619 * @per_phy_crc_error_stats: per phy crc error statistics
620 */
621struct iwl_system_statistics_part1_notif_oper {
622 __le32 time_stamp;
623 struct iwl_stats_ntfy_part1_per_link per_link[IWL_STATS_MAX_FW_LINKS];
624 __le32 per_phy_crc_error_stats[IWL_STATS_MAX_PHY_OPERATIONAL];
625} __packed; /* STATISTICS_FW_NTFY_OPERATIONAL_PART1_API_S_VER_4 */
626
627/**
628 * struct iwl_system_statistics_end_notif
629 *
630 * @time_stamp: time when the notification is sent from firmware
631 */
632struct iwl_system_statistics_end_notif {
633 __le32 time_stamp;
634} __packed; /* STATISTICS_FW_NTFY_END_API_S_VER_1 */
635
636/**
637 * struct iwl_statistics_operational_ntfy
638 *
639 * @hdr: general statistics header
640 * @flags: bitmap of possible notification structures
641 * @per_mac: per mac statistics, &struct iwl_stats_ntfy_per_mac
642 * @per_phy: per phy statistics, &struct iwl_stats_ntfy_per_phy
643 * @per_sta: per sta statistics, &struct iwl_stats_ntfy_per_sta
644 * @rx_time: rx time
645 * @tx_time: usec the radio is transmitting.
646 * @on_time_rf: The total time in usec the RF is awake.
647 * @on_time_scan: usec the radio is awake due to scan.
648 */
649struct iwl_statistics_operational_ntfy {
650 struct iwl_statistics_ntfy_hdr hdr;
651 __le32 flags;
652 struct iwl_stats_ntfy_per_mac per_mac[MAC_INDEX_AUX];
653 struct iwl_stats_ntfy_per_phy per_phy[IWL_STATS_MAX_PHY_OPERATIONAL];
654 struct iwl_stats_ntfy_per_sta per_sta[IWL_MVM_STATION_COUNT_MAX];
655 __le64 rx_time;
656 __le64 tx_time;
657 __le64 on_time_rf;
658 __le64 on_time_scan;
659} __packed; /* STATISTICS_OPERATIONAL_NTFY_API_S_VER_15 */
660
661/**
662 * struct iwl_statistics_operational_ntfy_ver_14
663 *
664 * @hdr: general statistics header
665 * @flags: bitmap of possible notification structures
666 * @mac_id: mac on which the beacon was received
667 * @beacon_filter_average_energy: Average energy [-dBm] of the 2
668 * antennas.
669 * @beacon_filter_reason: beacon filter reason
670 * @radio_temperature: radio temperature
671 * @air_time: air time
672 * @beacon_counter: all beacons (both filtered and not filtered)
673 * @beacon_average_energy: all beacons (both filtered and not
674 * filtered)
675 * @beacon_rssi_a: beacon RSSI on antenna A
676 * @beacon_rssi_b: beacon RSSI on antenna B
677 * @rx_bytes: per MAC RX byte count
678 * @rx_time: rx time
679 * @tx_time: usec the radio is transmitting.
680 * @on_time_rf: The total time in usec the RF is awake.
681 * @on_time_scan: usec the radio is awake due to scan.
682 * @average_energy: in fact it is minus the energy..
683 * @reserved: reserved
684 */
685struct iwl_statistics_operational_ntfy_ver_14 {
686 struct iwl_statistics_ntfy_hdr hdr;
687 __le32 flags;
688 __le32 mac_id;
689 __le32 beacon_filter_average_energy;
690 __le32 beacon_filter_reason;
691 __le32 radio_temperature;
692 __le32 air_time[MAC_INDEX_AUX];
693 __le32 beacon_counter[MAC_INDEX_AUX];
694 __le32 beacon_average_energy[MAC_INDEX_AUX];
695 __le32 beacon_rssi_a;
696 __le32 beacon_rssi_b;
697 __le32 rx_bytes[MAC_INDEX_AUX];
698 __le64 rx_time;
699 __le64 tx_time;
700 __le64 on_time_rf;
701 __le64 on_time_scan;
702 __le32 average_energy[IWL_MVM_STATION_COUNT_MAX];
703 __le32 reserved;
704} __packed; /* STATISTICS_OPERATIONAL_NTFY_API_S_VER_14 */
705
706/**
707 * struct iwl_statistics_phy_ntfy
708 *
709 * @hdr: general statistics header
710 * RX PHY related statistics
711 * @energy_and_config: ???
712 * @rssi_band: @31:24 rssiAllBand_B, 23:16 rssiInBand_B, 15:8
713 * rssiAllBand_A, 7:0 rssiInBand_A
714 * @agc_word: @31:16 agcWord_B, 15:0 agcWord_A
715 * @agc_gain: @19:10 agcGain_B, 9:0 agcGain_A
716 * @dfe_gain: @19:10 dfeGain_B, 9:0 dfeGain_A
717 * @snr_calc_main: @18:0 snrCalcMain
718 * @energy_calc_main: @18:0 energyCalcMain
719 * @snr_calc_aux: @18:0 snrCalcAux
720 * @dsp_dc_estim_a: @27:14 dspDcEstimQA, 13:0 dspDcEstimIA
721 * @dsp_dc_estim_b: @27:14 dspDcEstimQB, 13:0 dspDcEstimIB
722 * @ina_detec_type_and_ofdm_corr_comb: @31:31 inaDetectCckMrc,
723 * 30:27 inaDetectType, 26:0 ofdmCorrComb
724 * @cw_corr_comb: @26:0 cwCorrComb
725 * @rssi_comb: @25:0 rssiComb
726 * @auto_corr_cck: @23:12 autoCck, 11:00 crossCck
727 * @ofdm_fine_freq_and_pina_freq_err: @18:7 ofdmFineFreq, 6:0
728 * ofdmPinaFreqErr
729 * @snrm_evm_main: @31:0 snrmEvmMain
730 * @snrm_evm_aux: @31:0 snrmEvmAux
731 * @rx_rate: @31:0 rate
732 * TX PHY related statistics
733 * @per_chain_enums_and_dsp_atten_a: @perChainEnumsAndDspAtten
734 * (per version)
735 * @target_power_and_power_meas_a: @31:16 targetPower_A, 15:0
736 * powerMeasuredCalc_A
737 * @tx_config_as_i_and_ac_a: @31:16 txConfigAsI_A, 15:0
738 * txConfigAc_A
739 * @predist_dcq_and_dci_a: @31:16 predist_dci_A, 15:0
740 * predist_dcq_A
741 * @per_chain_enums_and_dsp_atten_b: @perChainEnumsAndDspAtten
742 * (per version)
743 * @target_power_and_power_meas_b: @31:16 targetPower_B, 15:0
744 * powerMeasuredCalc_B
745 * @tx_config_as_i_and_ac_b: @31:16 txConfigAsI_B, 15:0
746 * txConfigAc_B
747 * @predist_dcq_and_dci_b: @31:16 predist_dci_B, 15:0
748 * predist_dcq_B
749 * @tx_rate: @31:0 rate
750 * @tlc_backoff: @31:0 tlcBackoff
751 * @mpapd_calib_mode_mpapd_calib_type_a: @31:16
752 * mpapdCalibMode_A, 15:0 mpapdCalibType_A
753 * @psat_and_phy_power_limit_a: @31:16 psat_A, 15:0
754 * phyPowerLimit_A
755 * @sar_and_regulatory_power_limit_a: @31:16 sarPowerLimit_A,
756 * 15:0 regulatoryPowerLimit_A
757 * @mpapd_calib_mode_mpapd_calib_type_b: @31:16
758 * mpapdCalibMode_B, 15:0 mpapdCalibType_B
759 * @psat_and_phy_power_limit_b: @31:16 psat_B, 15:0
760 * phyPowerLimit_B
761 * @sar_and_regulatory_power_limit_b: @31:16 sarPowerLimit_B,
762 * 15:0 regulatoryPowerLimit_B
763 * @srd_and_driver_power_limits: @31:16 srdPowerLimit, 15:0
764 * driverPowerLimit
765 * @reserved: reserved
766 */
767struct iwl_statistics_phy_ntfy {
768 struct iwl_statistics_ntfy_hdr hdr;
769 __le32 energy_and_config;
770 __le32 rssi_band;
771 __le32 agc_word;
772 __le32 agc_gain;
773 __le32 dfe_gain;
774 __le32 snr_calc_main;
775 __le32 energy_calc_main;
776 __le32 snr_calc_aux;
777 __le32 dsp_dc_estim_a;
778 __le32 dsp_dc_estim_b;
779 __le32 ina_detec_type_and_ofdm_corr_comb;
780 __le32 cw_corr_comb;
781 __le32 rssi_comb;
782 __le32 auto_corr_cck;
783 __le32 ofdm_fine_freq_and_pina_freq_err;
784 __le32 snrm_evm_main;
785 __le32 snrm_evm_aux;
786 __le32 rx_rate;
787 __le32 per_chain_enums_and_dsp_atten_a;
788 __le32 target_power_and_power_meas_a;
789 __le32 tx_config_as_i_and_ac_a;
790 __le32 predist_dcq_and_dci_a;
791 __le32 per_chain_enums_and_dsp_atten_b;
792 __le32 target_power_and_power_meas_b;
793 __le32 tx_config_as_i_and_ac_b;
794 __le32 predist_dcq_and_dci_b;
795 __le32 tx_rate;
796 __le32 tlc_backoff;
797 __le32 mpapd_calib_mode_mpapd_calib_type_a;
798 __le32 psat_and_phy_power_limit_a;
799 __le32 sar_and_regulatory_power_limit_a;
800 __le32 mpapd_calib_mode_mpapd_calib_type_b;
801 __le32 psat_and_phy_power_limit_b;
802 __le32 sar_and_regulatory_power_limit_b;
803 __le32 srd_and_driver_power_limits;
804 __le32 reserved;
805} __packed; /* STATISTICS_PHY_NTFY_API_S_VER_1 */
806
807/**
808 * struct iwl_statistics_mac_ntfy
809 *
810 * @hdr: general statistics header
811 * @bcast_filter_passed_per_mac: bcast filter passed per mac
812 * @bcast_filter_dropped_per_mac: bcast filter dropped per mac
813 * @bcast_filter_passed_per_filter: bcast filter passed per filter
814 * @bcast_filter_dropped_per_filter: bcast filter dropped per filter
815 * @reserved: reserved
816 */
817struct iwl_statistics_mac_ntfy {
818 struct iwl_statistics_ntfy_hdr hdr;
819 __le32 bcast_filter_passed_per_mac[NUM_MAC_INDEX_CDB];
820 __le32 bcast_filter_dropped_per_mac[NUM_MAC_INDEX_CDB];
821 __le32 bcast_filter_passed_per_filter[MAX_BCAST_FILTER_NUM];
822 __le32 bcast_filter_dropped_per_filter[MAX_BCAST_FILTER_NUM];
823 __le32 reserved;
824} __packed; /* STATISTICS_MAC_NTFY_API_S_VER_1 */
825
826/**
827 * struct iwl_statistics_rx_ntfy
828 *
829 * @hdr: general statistics header
830 * @rx_agg_mpdu_cnt: aggregation frame count (number of
831 * delimiters)
832 * @rx_agg_cnt: number of RX Aggregations
833 * @unsupported_mcs: number of PLCP headers that have rate which
834 * is unsupported by DSP
835 * @bogus_cts: CTS received when not expecting CTS
836 * @bogus_ack: ACK received when not expecting ACK
837 * @rx_byte_count: ???
838 * @rx_packet_count: ???
839 * @missed_beacons: ???
840 * @unresponded_rts: un-responded RTS, due to NAV not zero
841 * @rxe_frame_limit_overrun: RXE got frame limit overrun
842 * @sent_ba_rsp_cnt: BA response TX count
843 * @late_rx_handle: count the number of times the RX path was
844 * aborted due to late entry
845 * @num_bt_kills: ???
846 * @reserved: reserved
847 */
848struct iwl_statistics_rx_ntfy {
849 struct iwl_statistics_ntfy_hdr hdr;
850 __le32 rx_agg_mpdu_cnt;
851 __le32 rx_agg_cnt;
852 __le32 unsupported_mcs;
853 __le32 bogus_cts;
854 __le32 bogus_ack;
855 __le32 rx_byte_count[MAC_INDEX_AUX];
856 __le32 rx_packet_count[MAC_INDEX_AUX];
857 __le32 missed_beacons;
858 __le32 unresponded_rts;
859 __le32 rxe_frame_limit_overrun;
860 __le32 sent_ba_rsp_cnt;
861 __le32 late_rx_handle;
862 __le32 num_bt_kills;
863 __le32 reserved;
864} __packed; /* STATISTICS_RX_NTFY_API_S_VER_1 */
865
866/**
867 * struct iwl_statistics_tx_ntfy
868 *
869 * @hdr: general statistics header
870 * @cts_timeout: timeout when waiting for CTS
871 * @ack_timeout: timeout when waiting for ACK
872 * @dump_msdu_cnt: number of MSDUs that were dumped due to any
873 * reason
874 * @burst_abort_missing_next_frame_cnt: number of times a burst
875 * was aborted due to missing next frame bytes in txfifo
876 * number of times got timeout when waiting for CTS/ACK/BA and energy was
877 * detected just after sending the RTS/DATA. this statistics may help getting
878 * interesting indicators, like the likelihood of collision (so the benefit of
879 * protection may be estimated Vs. its cost). Or how many of the failures are
880 * due to collision and how many due to SNR.
881 * For Link-quality the CTS collision indication is more reliable then the ACK
882 * collision indication as the RTS frame is short and has more chance that the
883 * frame/s which caused the collision continue after the RTS was sent.
884 * @cts_timeout_collision: ???
885 * ACK/BA failed and energy as detected after DATA
886 * Note: to get the collision ratio need to:
887 * ackOrBaTimeoutCollision / (ack_timeout + ba_timeout)
888 * @ack_or_ba_timeout_collision: ???
889 * @ba_timeout: timeout when waiting for immediate BA response
890 * @ba_reschedule_frames: failed to get BA response and
891 * rescheduled all the non-ACKed frames
892 * gives the avarage number of frames inside aggregation
893 * @scd_query_agg_frame_cnt: ???
894 * @scd_query_no_agg: scheduler query prevented aggregation
895 * @scd_query_agg: scheduler query allowed aggregation
896 * @scd_query_mismatch: scheduler query inaccurate, either too
897 * short or too long
898 * @agg_terminated_underrun: aggregation was terminated due to
899 * underrun
900 * @agg_terminated_bt_prio_kill: aggregation was terminated due
901 * to BT
902 * @tx_kill_on_long_retry: count the tx frames dropped due to
903 * long retry limit (DATA frame failed)
904 * @tx_kill_on_short_retry: count the tx frames dropped due to
905 * short retry limit (RTS frame failed)
906 * TX deffer on energy. This counter is reset on each successful transmit.
907 * When timer exceed TX deffer limit than will be uCode assert.
908 * @tx_deffer_counter: ???
909 * @tx_deffer_base_time: Keep the time of the last successful
910 * transmit
911 * @tx_underrun: TX killed due to underrun
912 * @bt_defer: TX deferred due to BT priority, so probably TX was
913 * not started.
914 * @tx_kill_on_dsp_timeout: TX killed on DSP problem detected
915 * @tx_kill_on_immediate_quiet: TX killed due to immediate quiet
916 * @kill_ba_cnt: number of times sending BA failed
917 * @kill_ack_cnt: number of times sending ACK failed
918 * @kill_cts_cnt: number of times sending CTS failed
919 * @burst_terminated: Count burst or fragmentation termination
920 * occurrence
921 * @late_tx_vec_wr_cnt: ???
922 * TX is not sent because ucode failed to notify the TRM in SIFS-delta from
923 * ON_AIR deassertion.
924 * @late_rx2_tx_cnt: ???
925 * @scd_query_cnt: count the times SCD query was done to check
926 * for TX AGG
927 * @tx_frames_acked_in_agg: count the number of frames
928 * transmitted inside AGG and were successful
929 * @last_tx_ch_width_indx: ???
930 * number of deferred TX per channel width, 0 - 20, 1/2/3 - 40/80/160
931 * @rx_detected_per_ch_width: ???
932 * @success_per_ch_width: ???
933 * @fail_per_ch_width: ???
934 * @reserved: reserved
935 */
936struct iwl_statistics_tx_ntfy {
937 struct iwl_statistics_ntfy_hdr hdr;
938 __le32 cts_timeout;
939 __le32 ack_timeout;
940 __le32 dump_msdu_cnt;
941 __le32 burst_abort_missing_next_frame_cnt;
942 __le32 cts_timeout_collision;
943 __le32 ack_or_ba_timeout_collision;
944 __le32 ba_timeout;
945 __le32 ba_reschedule_frames;
946 __le32 scd_query_agg_frame_cnt;
947 __le32 scd_query_no_agg;
948 __le32 scd_query_agg;
949 __le32 scd_query_mismatch;
950 __le32 agg_terminated_underrun;
951 __le32 agg_terminated_bt_prio_kill;
952 __le32 tx_kill_on_long_retry;
953 __le32 tx_kill_on_short_retry;
954 __le32 tx_deffer_counter;
955 __le32 tx_deffer_base_time;
956 __le32 tx_underrun;
957 __le32 bt_defer;
958 __le32 tx_kill_on_dsp_timeout;
959 __le32 tx_kill_on_immediate_quiet;
960 __le32 kill_ba_cnt;
961 __le32 kill_ack_cnt;
962 __le32 kill_cts_cnt;
963 __le32 burst_terminated;
964 __le32 late_tx_vec_wr_cnt;
965 __le32 late_rx2_tx_cnt;
966 __le32 scd_query_cnt;
967 __le32 tx_frames_acked_in_agg;
968 __le32 last_tx_ch_width_indx;
969 __le32 rx_detected_per_ch_width[4];
970 __le32 success_per_ch_width[4];
971 __le32 fail_per_ch_width[4];
972 __le32 reserved;
973} __packed; /* STATISTICS_TX_NTFY_API_S_VER_1 */
974
975/**
976 * struct iwl_statistics_duration_ntfy
977 *
978 * @hdr: general statistics header
979 * @cont_burst_chk_cnt: number of times continuation or
980 * fragmentation or bursting was checked
981 * @cont_burst_cnt: number of times continuation or fragmentation
982 * or bursting was successful
983 * @wait_for_silence_timeout_cnt: ???
984 * @reserved: reserved
985 */
986struct iwl_statistics_duration_ntfy {
987 struct iwl_statistics_ntfy_hdr hdr;
988 __le32 cont_burst_chk_cnt;
989 __le32 cont_burst_cnt;
990 __le32 wait_for_silence_timeout_cnt;
991 __le32 reserved;
992} __packed; /* STATISTICS_DURATION_NTFY_API_S_VER_1 */
993
994/**
995 * struct iwl_statistics_he_ntfy
996 *
997 * @hdr: general statistics header
998 * received HE frames
999 * @rx_siga_valid_cnt: rx HE SIG-A valid
1000 * @rx_siga_invalid_cnt: rx HE SIG-A invalid
1001 * received HE frames w/ valid Sig-A
1002 * @rx_trig_based_frame_cnt: rx HE-TB (trig-based)
1003 * @rx_su_frame_cnt: rx HE-SU
1004 * @rx_sigb_invalid_cnt: rx (suspected) HE-MU w/ bad SIG-B
1005 * @rx_our_bss_color_cnt: rx valid HE SIG-A w/ our BSS color
1006 * @rx_other_bss_color_cnt: rx valid HE SIG-A w/ other BSS color
1007 * @rx_zero_bss_color_cnt: ???
1008 * received HE-MU frames w/ good Sig-B
1009 * @rx_mu_for_us_cnt: match AID
1010 * @rx_mu_not_for_us_cnt: no matched AID
1011 * received HE-MU frames for us (w/ our AID)
1012 * @rx_mu_nss_ar: 0 - SISO, 1 - MIMO2
1013 * @rx_mu_mimo_cnt: full BW RU, compressed SIG-B
1014 * @rx_mu_ru_bw_ar: MU alloc, MHz: 0 - 2, 1 - 5, 2 - 10, 3 - 20,
1015 * 4 - 40, 5 - 80, 6 - 160
1016 * received trigger frames
1017 * @rx_trig_for_us_cnt: ???
1018 * @rx_trig_not_for_us_cnt: ???
1019 * trigger for us
1020 * @rx_trig_with_cs_req_cnt: ???
1021 * @rx_trig_type_ar: ???
1022 * @rx_trig_in_agg_cnt: ???
1023 * basic trigger for us allocations
1024 * @rx_basic_trig_alloc_nss_ar: ???
1025 * @rx_basic_trig_alloc_mu_mimo_cnt: ???
1026 * @rx_basic_trig_alloc_ru_bw_ar: ???
1027 * @rx_basic_trig_total_byte_cnt: ???
1028 * trig-based TX
1029 * @tx_trig_based_cs_req_fail_cnt: ???
1030 * @tx_trig_based_sifs_ok_cnt: ???
1031 * @tx_trig_based_sifs_fail_cnt: ???
1032 * @tx_trig_based_byte_cnt: ???
1033 * @tx_trig_based_pad_byte_cnt: ???
1034 * @tx_trig_based_frame_cnt: ???
1035 * @tx_trig_based_acked_frame_cnt: ???
1036 * @tx_trig_based_ack_timeout_cnt: ???
1037 * HE-SU TX
1038 * @tx_su_frame_cnt: ???
1039 * EDCA <--> MU-EDCA transitions
1040 * @tx_edca_to_mu_edca_cnt: ???
1041 * @tx_mu_edca_to_edca_by_timeout_cnt: ???
1042 * @tx_mu_edca_to_edca_by_ack_fail_cnt: ???
1043 * @tx_mu_edca_to_edca_by_small_alloc_cnt: ???
1044 * @reserved: reserved
1045 */
1046struct iwl_statistics_he_ntfy {
1047 struct iwl_statistics_ntfy_hdr hdr;
1048 __le32 rx_siga_valid_cnt;
1049 __le32 rx_siga_invalid_cnt;
1050 __le32 rx_trig_based_frame_cnt;
1051 __le32 rx_su_frame_cnt;
1052 __le32 rx_sigb_invalid_cnt;
1053 __le32 rx_our_bss_color_cnt;
1054 __le32 rx_other_bss_color_cnt;
1055 __le32 rx_zero_bss_color_cnt;
1056 __le32 rx_mu_for_us_cnt;
1057 __le32 rx_mu_not_for_us_cnt;
1058 __le32 rx_mu_nss_ar[2];
1059 __le32 rx_mu_mimo_cnt;
1060 __le32 rx_mu_ru_bw_ar[7];
1061 __le32 rx_trig_for_us_cnt;
1062 __le32 rx_trig_not_for_us_cnt;
1063 __le32 rx_trig_with_cs_req_cnt;
1064 __le32 rx_trig_type_ar[8 + 1];
1065 __le32 rx_trig_in_agg_cnt;
1066 __le32 rx_basic_trig_alloc_nss_ar[2];
1067 __le32 rx_basic_trig_alloc_mu_mimo_cnt;
1068 __le32 rx_basic_trig_alloc_ru_bw_ar[7];
1069 __le32 rx_basic_trig_total_byte_cnt;
1070 __le32 tx_trig_based_cs_req_fail_cnt;
1071 __le32 tx_trig_based_sifs_ok_cnt;
1072 __le32 tx_trig_based_sifs_fail_cnt;
1073 __le32 tx_trig_based_byte_cnt;
1074 __le32 tx_trig_based_pad_byte_cnt;
1075 __le32 tx_trig_based_frame_cnt;
1076 __le32 tx_trig_based_acked_frame_cnt;
1077 __le32 tx_trig_based_ack_timeout_cnt;
1078 __le32 tx_su_frame_cnt;
1079 __le32 tx_edca_to_mu_edca_cnt;
1080 __le32 tx_mu_edca_to_edca_by_timeout_cnt;
1081 __le32 tx_mu_edca_to_edca_by_ack_fail_cnt;
1082 __le32 tx_mu_edca_to_edca_by_small_alloc_cnt;
1083 __le32 reserved;
1084} __packed; /* STATISTICS_HE_NTFY_API_S_VER_1 */
1085
1086#endif /* __iwl_fw_api_stats_h__ */
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2012-2014, 2018, 2020 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
6 */
7#ifndef __iwl_fw_api_stats_h__
8#define __iwl_fw_api_stats_h__
9#include "mac.h"
10
11struct mvm_statistics_dbg {
12 __le32 burst_check;
13 __le32 burst_count;
14 __le32 wait_for_silence_timeout_cnt;
15 u8 reserved[12];
16} __packed; /* STATISTICS_DEBUG_API_S_VER_2 */
17
18struct mvm_statistics_div {
19 __le32 tx_on_a;
20 __le32 tx_on_b;
21 __le32 exec_time;
22 __le32 probe_time;
23 __le32 rssi_ant;
24 __le32 reserved2;
25} __packed; /* STATISTICS_SLOW_DIV_API_S_VER_2 */
26
27/**
28 * struct mvm_statistics_rx_non_phy
29 * @bogus_cts: CTS received when not expecting CTS
30 * @bogus_ack: ACK received when not expecting ACK
31 * @non_channel_beacons: beacons with our bss id but not on our serving channel
32 * @channel_beacons: beacons with our bss id and in our serving channel
33 * @num_missed_bcon: number of missed beacons
34 * @adc_rx_saturation_time: count in 0.8us units the time the ADC was in
35 * saturation
36 * @ina_detection_search_time: total time (in 0.8us) searched for INA
37 * @beacon_silence_rssi_a: RSSI silence after beacon frame
38 * @beacon_silence_rssi_b: RSSI silence after beacon frame
39 * @beacon_silence_rssi_c: RSSI silence after beacon frame
40 * @interference_data_flag: flag for interference data availability. 1 when data
41 * is available.
42 * @channel_load: counts RX Enable time in uSec
43 * @beacon_rssi_a: beacon RSSI on antenna A
44 * @beacon_rssi_b: beacon RSSI on antenna B
45 * @beacon_rssi_c: beacon RSSI on antenna C
46 * @beacon_energy_a: beacon energy on antenna A
47 * @beacon_energy_b: beacon energy on antenna B
48 * @beacon_energy_c: beacon energy on antenna C
49 * @num_bt_kills: number of BT "kills" (frame TX aborts)
50 * @mac_id: mac ID
51 */
52struct mvm_statistics_rx_non_phy {
53 __le32 bogus_cts;
54 __le32 bogus_ack;
55 __le32 non_channel_beacons;
56 __le32 channel_beacons;
57 __le32 num_missed_bcon;
58 __le32 adc_rx_saturation_time;
59 __le32 ina_detection_search_time;
60 __le32 beacon_silence_rssi_a;
61 __le32 beacon_silence_rssi_b;
62 __le32 beacon_silence_rssi_c;
63 __le32 interference_data_flag;
64 __le32 channel_load;
65 __le32 beacon_rssi_a;
66 __le32 beacon_rssi_b;
67 __le32 beacon_rssi_c;
68 __le32 beacon_energy_a;
69 __le32 beacon_energy_b;
70 __le32 beacon_energy_c;
71 __le32 num_bt_kills;
72 __le32 mac_id;
73} __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_4 */
74
75struct mvm_statistics_rx_non_phy_v3 {
76 __le32 bogus_cts; /* CTS received when not expecting CTS */
77 __le32 bogus_ack; /* ACK received when not expecting ACK */
78 __le32 non_bssid_frames; /* number of frames with BSSID that
79 * doesn't belong to the STA BSSID */
80 __le32 filtered_frames; /* count frames that were dumped in the
81 * filtering process */
82 __le32 non_channel_beacons; /* beacons with our bss id but not on
83 * our serving channel */
84 __le32 channel_beacons; /* beacons with our bss id and in our
85 * serving channel */
86 __le32 num_missed_bcon; /* number of missed beacons */
87 __le32 adc_rx_saturation_time; /* count in 0.8us units the time the
88 * ADC was in saturation */
89 __le32 ina_detection_search_time;/* total time (in 0.8us) searched
90 * for INA */
91 __le32 beacon_silence_rssi_a; /* RSSI silence after beacon frame */
92 __le32 beacon_silence_rssi_b; /* RSSI silence after beacon frame */
93 __le32 beacon_silence_rssi_c; /* RSSI silence after beacon frame */
94 __le32 interference_data_flag; /* flag for interference data
95 * availability. 1 when data is
96 * available. */
97 __le32 channel_load; /* counts RX Enable time in uSec */
98 __le32 dsp_false_alarms; /* DSP false alarm (both OFDM
99 * and CCK) counter */
100 __le32 beacon_rssi_a;
101 __le32 beacon_rssi_b;
102 __le32 beacon_rssi_c;
103 __le32 beacon_energy_a;
104 __le32 beacon_energy_b;
105 __le32 beacon_energy_c;
106 __le32 num_bt_kills;
107 __le32 mac_id;
108 __le32 directed_data_mpdu;
109} __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_3 */
110
111struct mvm_statistics_rx_phy {
112 __le32 unresponded_rts;
113 __le32 rxe_frame_lmt_overrun;
114 __le32 sent_ba_rsp_cnt;
115 __le32 dsp_self_kill;
116 __le32 reserved;
117} __packed; /* STATISTICS_RX_PHY_API_S_VER_3 */
118
119struct mvm_statistics_rx_phy_v2 {
120 __le32 ina_cnt;
121 __le32 fina_cnt;
122 __le32 plcp_err;
123 __le32 crc32_err;
124 __le32 overrun_err;
125 __le32 early_overrun_err;
126 __le32 crc32_good;
127 __le32 false_alarm_cnt;
128 __le32 fina_sync_err_cnt;
129 __le32 sfd_timeout;
130 __le32 fina_timeout;
131 __le32 unresponded_rts;
132 __le32 rxe_frame_lmt_overrun;
133 __le32 sent_ack_cnt;
134 __le32 sent_cts_cnt;
135 __le32 sent_ba_rsp_cnt;
136 __le32 dsp_self_kill;
137 __le32 mh_format_err;
138 __le32 re_acq_main_rssi_sum;
139 __le32 reserved;
140} __packed; /* STATISTICS_RX_PHY_API_S_VER_2 */
141
142struct mvm_statistics_rx_ht_phy_v1 {
143 __le32 plcp_err;
144 __le32 overrun_err;
145 __le32 early_overrun_err;
146 __le32 crc32_good;
147 __le32 crc32_err;
148 __le32 mh_format_err;
149 __le32 agg_crc32_good;
150 __le32 agg_mpdu_cnt;
151 __le32 agg_cnt;
152 __le32 unsupport_mcs;
153} __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_1 */
154
155struct mvm_statistics_rx_ht_phy {
156 __le32 mh_format_err;
157 __le32 agg_mpdu_cnt;
158 __le32 agg_cnt;
159 __le32 unsupport_mcs;
160} __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_2 */
161
162struct mvm_statistics_tx_non_phy_v3 {
163 __le32 preamble_cnt;
164 __le32 rx_detected_cnt;
165 __le32 bt_prio_defer_cnt;
166 __le32 bt_prio_kill_cnt;
167 __le32 few_bytes_cnt;
168 __le32 cts_timeout;
169 __le32 ack_timeout;
170 __le32 expected_ack_cnt;
171 __le32 actual_ack_cnt;
172 __le32 dump_msdu_cnt;
173 __le32 burst_abort_next_frame_mismatch_cnt;
174 __le32 burst_abort_missing_next_frame_cnt;
175 __le32 cts_timeout_collision;
176 __le32 ack_or_ba_timeout_collision;
177} __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_3 */
178
179struct mvm_statistics_tx_non_phy {
180 __le32 bt_prio_defer_cnt;
181 __le32 bt_prio_kill_cnt;
182 __le32 few_bytes_cnt;
183 __le32 cts_timeout;
184 __le32 ack_timeout;
185 __le32 dump_msdu_cnt;
186 __le32 burst_abort_next_frame_mismatch_cnt;
187 __le32 burst_abort_missing_next_frame_cnt;
188 __le32 cts_timeout_collision;
189 __le32 ack_or_ba_timeout_collision;
190} __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_4 */
191
192#define MAX_CHAINS 3
193
194struct mvm_statistics_tx_non_phy_agg {
195 __le32 ba_timeout;
196 __le32 ba_reschedule_frames;
197 __le32 scd_query_agg_frame_cnt;
198 __le32 scd_query_no_agg;
199 __le32 scd_query_agg;
200 __le32 scd_query_mismatch;
201 __le32 frame_not_ready;
202 __le32 underrun;
203 __le32 bt_prio_kill;
204 __le32 rx_ba_rsp_cnt;
205 __s8 txpower[MAX_CHAINS];
206 __s8 reserved;
207 __le32 reserved2;
208} __packed; /* STATISTICS_TX_NON_PHY_AGG_API_S_VER_1 */
209
210struct mvm_statistics_tx_channel_width {
211 __le32 ext_cca_narrow_ch20[1];
212 __le32 ext_cca_narrow_ch40[2];
213 __le32 ext_cca_narrow_ch80[3];
214 __le32 ext_cca_narrow_ch160[4];
215 __le32 last_tx_ch_width_indx;
216 __le32 rx_detected_per_ch_width[4];
217 __le32 success_per_ch_width[4];
218 __le32 fail_per_ch_width[4];
219}; /* STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
220
221struct mvm_statistics_tx_v4 {
222 struct mvm_statistics_tx_non_phy_v3 general;
223 struct mvm_statistics_tx_non_phy_agg agg;
224 struct mvm_statistics_tx_channel_width channel_width;
225} __packed; /* STATISTICS_TX_API_S_VER_4 */
226
227struct mvm_statistics_tx {
228 struct mvm_statistics_tx_non_phy general;
229 struct mvm_statistics_tx_non_phy_agg agg;
230 struct mvm_statistics_tx_channel_width channel_width;
231} __packed; /* STATISTICS_TX_API_S_VER_5 */
232
233
234struct mvm_statistics_bt_activity {
235 __le32 hi_priority_tx_req_cnt;
236 __le32 hi_priority_tx_denied_cnt;
237 __le32 lo_priority_tx_req_cnt;
238 __le32 lo_priority_tx_denied_cnt;
239 __le32 hi_priority_rx_req_cnt;
240 __le32 hi_priority_rx_denied_cnt;
241 __le32 lo_priority_rx_req_cnt;
242 __le32 lo_priority_rx_denied_cnt;
243} __packed; /* STATISTICS_BT_ACTIVITY_API_S_VER_1 */
244
245struct mvm_statistics_general_common_v19 {
246 __le32 radio_temperature;
247 __le32 radio_voltage;
248 struct mvm_statistics_dbg dbg;
249 __le32 sleep_time;
250 __le32 slots_out;
251 __le32 slots_idle;
252 __le32 ttl_timestamp;
253 struct mvm_statistics_div slow_div;
254 __le32 rx_enable_counter;
255 /*
256 * num_of_sos_states:
257 * count the number of times we have to re-tune
258 * in order to get out of bad PHY status
259 */
260 __le32 num_of_sos_states;
261 __le32 beacon_filtered;
262 __le32 missed_beacons;
263 u8 beacon_filter_average_energy;
264 u8 beacon_filter_reason;
265 u8 beacon_filter_current_energy;
266 u8 beacon_filter_reserved;
267 __le32 beacon_filter_delta_time;
268 struct mvm_statistics_bt_activity bt_activity;
269 __le64 rx_time;
270 __le64 on_time_rf;
271 __le64 on_time_scan;
272 __le64 tx_time;
273} __packed;
274
275struct mvm_statistics_general_common {
276 __le32 radio_temperature;
277 struct mvm_statistics_dbg dbg;
278 __le32 sleep_time;
279 __le32 slots_out;
280 __le32 slots_idle;
281 __le32 ttl_timestamp;
282 struct mvm_statistics_div slow_div;
283 __le32 rx_enable_counter;
284 /*
285 * num_of_sos_states:
286 * count the number of times we have to re-tune
287 * in order to get out of bad PHY status
288 */
289 __le32 num_of_sos_states;
290 __le32 beacon_filtered;
291 __le32 missed_beacons;
292 u8 beacon_filter_average_energy;
293 u8 beacon_filter_reason;
294 u8 beacon_filter_current_energy;
295 u8 beacon_filter_reserved;
296 __le32 beacon_filter_delta_time;
297 struct mvm_statistics_bt_activity bt_activity;
298 __le64 rx_time;
299 __le64 on_time_rf;
300 __le64 on_time_scan;
301 __le64 tx_time;
302} __packed; /* STATISTICS_GENERAL_API_S_VER_10 */
303
304struct mvm_statistics_general_v8 {
305 struct mvm_statistics_general_common_v19 common;
306 __le32 beacon_counter[NUM_MAC_INDEX];
307 u8 beacon_average_energy[NUM_MAC_INDEX];
308 u8 reserved[4 - (NUM_MAC_INDEX % 4)];
309} __packed; /* STATISTICS_GENERAL_API_S_VER_8 */
310
311struct mvm_statistics_general {
312 struct mvm_statistics_general_common common;
313 __le32 beacon_counter[MAC_INDEX_AUX];
314 u8 beacon_average_energy[MAC_INDEX_AUX];
315 u8 reserved[8 - MAC_INDEX_AUX];
316} __packed; /* STATISTICS_GENERAL_API_S_VER_10 */
317
318/**
319 * struct mvm_statistics_load - RX statistics for multi-queue devices
320 * @air_time: accumulated air time, per mac
321 * @byte_count: accumulated byte count, per mac
322 * @pkt_count: accumulated packet count, per mac
323 * @avg_energy: average RSSI, per station
324 */
325struct mvm_statistics_load {
326 __le32 air_time[MAC_INDEX_AUX];
327 __le32 byte_count[MAC_INDEX_AUX];
328 __le32 pkt_count[MAC_INDEX_AUX];
329 u8 avg_energy[IWL_MVM_STATION_COUNT_MAX];
330} __packed; /* STATISTICS_RX_MAC_STATION_S_VER_3 */
331
332struct mvm_statistics_load_v1 {
333 __le32 air_time[NUM_MAC_INDEX];
334 __le32 byte_count[NUM_MAC_INDEX];
335 __le32 pkt_count[NUM_MAC_INDEX];
336 u8 avg_energy[IWL_MVM_STATION_COUNT_MAX];
337} __packed; /* STATISTICS_RX_MAC_STATION_S_VER_1 */
338
339struct mvm_statistics_rx {
340 struct mvm_statistics_rx_phy ofdm;
341 struct mvm_statistics_rx_phy cck;
342 struct mvm_statistics_rx_non_phy general;
343 struct mvm_statistics_rx_ht_phy ofdm_ht;
344} __packed; /* STATISTICS_RX_API_S_VER_4 */
345
346struct mvm_statistics_rx_v3 {
347 struct mvm_statistics_rx_phy_v2 ofdm;
348 struct mvm_statistics_rx_phy_v2 cck;
349 struct mvm_statistics_rx_non_phy_v3 general;
350 struct mvm_statistics_rx_ht_phy_v1 ofdm_ht;
351} __packed; /* STATISTICS_RX_API_S_VER_3 */
352
353/*
354 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
355 *
356 * By default, uCode issues this notification after receiving a beacon
357 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
358 * STATISTICS_CMD (0x9c), below.
359 */
360
361struct iwl_notif_statistics_v10 {
362 __le32 flag;
363 struct mvm_statistics_rx_v3 rx;
364 struct mvm_statistics_tx_v4 tx;
365 struct mvm_statistics_general_v8 general;
366} __packed; /* STATISTICS_NTFY_API_S_VER_10 */
367
368struct iwl_notif_statistics_v11 {
369 __le32 flag;
370 struct mvm_statistics_rx_v3 rx;
371 struct mvm_statistics_tx_v4 tx;
372 struct mvm_statistics_general_v8 general;
373 struct mvm_statistics_load_v1 load_stats;
374} __packed; /* STATISTICS_NTFY_API_S_VER_11 */
375
376struct iwl_notif_statistics {
377 __le32 flag;
378 struct mvm_statistics_rx rx;
379 struct mvm_statistics_tx tx;
380 struct mvm_statistics_general general;
381 struct mvm_statistics_load load_stats;
382} __packed; /* STATISTICS_NTFY_API_S_VER_13 */
383
384/**
385 * enum iwl_statistics_notif_flags - flags used in statistics notification
386 * @IWL_STATISTICS_REPLY_FLG_CLEAR: statistics were cleared after this report
387 */
388enum iwl_statistics_notif_flags {
389 IWL_STATISTICS_REPLY_FLG_CLEAR = 0x1,
390};
391
392/**
393 * enum iwl_statistics_cmd_flags - flags used in statistics command
394 * @IWL_STATISTICS_FLG_CLEAR: request to clear statistics after the report
395 * that's sent after this command
396 * @IWL_STATISTICS_FLG_DISABLE_NOTIF: disable unilateral statistics
397 * notifications
398 */
399enum iwl_statistics_cmd_flags {
400 IWL_STATISTICS_FLG_CLEAR = 0x1,
401 IWL_STATISTICS_FLG_DISABLE_NOTIF = 0x2,
402};
403
404/**
405 * struct iwl_statistics_cmd - statistics config command
406 * @flags: flags from &enum iwl_statistics_cmd_flags
407 */
408struct iwl_statistics_cmd {
409 __le32 flags;
410} __packed; /* STATISTICS_CMD_API_S_VER_1 */
411
412#define MAX_BCAST_FILTER_NUM 8
413
414/**
415 * enum iwl_fw_statistics_type
416 *
417 * @FW_STATISTICS_OPERATIONAL: operational statistics
418 * @FW_STATISTICS_PHY: phy statistics
419 * @FW_STATISTICS_MAC: mac statistics
420 * @FW_STATISTICS_RX: rx statistics
421 * @FW_STATISTICS_TX: tx statistics
422 * @FW_STATISTICS_DURATION: duration statistics
423 * @FW_STATISTICS_HE: he statistics
424 */
425enum iwl_fw_statistics_type {
426 FW_STATISTICS_OPERATIONAL,
427 FW_STATISTICS_PHY,
428 FW_STATISTICS_MAC,
429 FW_STATISTICS_RX,
430 FW_STATISTICS_TX,
431 FW_STATISTICS_DURATION,
432 FW_STATISTICS_HE,
433}; /* FW_STATISTICS_TYPE_API_E_VER_1 */
434
435/**
436 * struct iwl_statistics_ntfy_hdr
437 *
438 * @type: struct type
439 * @version: version of the struct
440 * @size: size in bytes
441 */
442struct iwl_statistics_ntfy_hdr {
443 u8 type;
444 u8 version;
445 __le16 size;
446}; /* STATISTICS_NTFY_HDR_API_S_VER_1 */
447
448/**
449 * struct iwl_statistics_operational_ntfy
450 *
451 * @hdr: general statistics header
452 * @flags: bitmap of possible notification structures
453 * @mac_id: mac on which the beacon was received
454 * @beacon_filter_average_energy: Average energy [-dBm] of the 2
455 * antennas.
456 * @beacon_filter_reason: beacon filter reason
457 * @radio_temperature: radio temperature
458 * @air_time: air time
459 * @beacon_counter: all beacons (both filtered and not filtered)
460 * @beacon_average_energy: all beacons (both filtered and not
461 * filtered)
462 * @beacon_rssi_a: beacon RSSI on antenna A
463 * @beacon_rssi_b: beacon RSSI on antenna B
464 * @rx_bytes: per MAC RX byte count
465 * @rx_time: rx time
466 * @tx_time: usec the radio is transmitting.
467 * @on_time_rf: The total time in usec the RF is awake.
468 * @on_time_scan: usec the radio is awake due to scan.
469 * @average_energy: in fact it is minus the energy..
470 * @reserved: reserved
471 */
472struct iwl_statistics_operational_ntfy {
473 struct iwl_statistics_ntfy_hdr hdr;
474 __le32 flags;
475 __le32 mac_id;
476 __le32 beacon_filter_average_energy;
477 __le32 beacon_filter_reason;
478 __le32 radio_temperature;
479 __le32 air_time[MAC_INDEX_AUX];
480 __le32 beacon_counter[MAC_INDEX_AUX];
481 __le32 beacon_average_energy[MAC_INDEX_AUX];
482 __le32 beacon_rssi_a;
483 __le32 beacon_rssi_b;
484 __le32 rx_bytes[MAC_INDEX_AUX];
485 __le64 rx_time;
486 __le64 tx_time;
487 __le64 on_time_rf;
488 __le64 on_time_scan;
489 __le32 average_energy[IWL_MVM_STATION_COUNT_MAX];
490 __le32 reserved;
491} __packed; /* STATISTICS_OPERATIONAL_NTFY_API_S_VER_14 */
492
493/**
494 * struct iwl_statistics_phy_ntfy
495 *
496 * @hdr: general statistics header
497 * RX PHY related statistics
498 * @energy_and_config: ???
499 * @rssi_band: @31:24 rssiAllBand_B, 23:16 rssiInBand_B, 15:8
500 * rssiAllBand_A, 7:0 rssiInBand_A
501 * @agc_word: @31:16 agcWord_B, 15:0 agcWord_A
502 * @agc_gain: @19:10 agcGain_B, 9:0 agcGain_A
503 * @dfe_gain: @19:10 dfeGain_B, 9:0 dfeGain_A
504 * @snr_calc_main: @18:0 snrCalcMain
505 * @energy_calc_main: @18:0 energyCalcMain
506 * @snr_calc_aux: @18:0 snrCalcAux
507 * @dsp_dc_estim_a: @27:14 dspDcEstimQA, 13:0 dspDcEstimIA
508 * @dsp_dc_estim_b: @27:14 dspDcEstimQB, 13:0 dspDcEstimIB
509 * @ina_detec_type_and_ofdm_corr_comb: @31:31 inaDetectCckMrc,
510 * 30:27 inaDetectType, 26:0 ofdmCorrComb
511 * @cw_corr_comb: @26:0 cwCorrComb
512 * @rssi_comb: @25:0 rssiComb
513 * @auto_corr_cck: @23:12 autoCck, 11:00 crossCck
514 * @ofdm_fine_freq_and_pina_freq_err: @18:7 ofdmFineFreq, 6:0
515 * ofdmPinaFreqErr
516 * @snrm_evm_main: @31:0 snrmEvmMain
517 * @snrm_evm_aux: @31:0 snrmEvmAux
518 * @rx_rate: @31:0 rate
519 * TX PHY related statistics
520 * @per_chain_enums_and_dsp_atten_a: @perChainEnumsAndDspAtten
521 * (per version)
522 * @target_power_and_power_meas_a: @31:16 targetPower_A, 15:0
523 * powerMeasuredCalc_A
524 * @tx_config_as_i_and_ac_a: @31:16 txConfigAsI_A, 15:0
525 * txConfigAc_A
526 * @predist_dcq_and_dci_a: @31:16 predist_dci_A, 15:0
527 * predist_dcq_A
528 * @per_chain_enums_and_dsp_atten_b: @perChainEnumsAndDspAtten
529 * (per version)
530 * @target_power_and_power_meas_b: @31:16 targetPower_B, 15:0
531 * powerMeasuredCalc_B
532 * @tx_config_as_i_and_ac_b: @31:16 txConfigAsI_B, 15:0
533 * txConfigAc_B
534 * @predist_dcq_and_dci_b: @31:16 predist_dci_B, 15:0
535 * predist_dcq_B
536 * @tx_rate: @31:0 rate
537 * @tlc_backoff: @31:0 tlcBackoff
538 * @mpapd_calib_mode_mpapd_calib_type_a: @31:16
539 * mpapdCalibMode_A, 15:0 mpapdCalibType_A
540 * @psat_and_phy_power_limit_a: @31:16 psat_A, 15:0
541 * phyPowerLimit_A
542 * @sar_and_regulatory_power_limit_a: @31:16 sarPowerLimit_A,
543 * 15:0 regulatoryPowerLimit_A
544 * @mpapd_calib_mode_mpapd_calib_type_b: @31:16
545 * mpapdCalibMode_B, 15:0 mpapdCalibType_B
546 * @psat_and_phy_power_limit_b: @31:16 psat_B, 15:0
547 * phyPowerLimit_B
548 * @sar_and_regulatory_power_limit_b: @31:16 sarPowerLimit_B,
549 * 15:0 regulatoryPowerLimit_B
550 * @srd_and_driver_power_limits: @31:16 srdPowerLimit, 15:0
551 * driverPowerLimit
552 * @reserved: reserved
553 */
554struct iwl_statistics_phy_ntfy {
555 struct iwl_statistics_ntfy_hdr hdr;
556 __le32 energy_and_config;
557 __le32 rssi_band;
558 __le32 agc_word;
559 __le32 agc_gain;
560 __le32 dfe_gain;
561 __le32 snr_calc_main;
562 __le32 energy_calc_main;
563 __le32 snr_calc_aux;
564 __le32 dsp_dc_estim_a;
565 __le32 dsp_dc_estim_b;
566 __le32 ina_detec_type_and_ofdm_corr_comb;
567 __le32 cw_corr_comb;
568 __le32 rssi_comb;
569 __le32 auto_corr_cck;
570 __le32 ofdm_fine_freq_and_pina_freq_err;
571 __le32 snrm_evm_main;
572 __le32 snrm_evm_aux;
573 __le32 rx_rate;
574 __le32 per_chain_enums_and_dsp_atten_a;
575 __le32 target_power_and_power_meas_a;
576 __le32 tx_config_as_i_and_ac_a;
577 __le32 predist_dcq_and_dci_a;
578 __le32 per_chain_enums_and_dsp_atten_b;
579 __le32 target_power_and_power_meas_b;
580 __le32 tx_config_as_i_and_ac_b;
581 __le32 predist_dcq_and_dci_b;
582 __le32 tx_rate;
583 __le32 tlc_backoff;
584 __le32 mpapd_calib_mode_mpapd_calib_type_a;
585 __le32 psat_and_phy_power_limit_a;
586 __le32 sar_and_regulatory_power_limit_a;
587 __le32 mpapd_calib_mode_mpapd_calib_type_b;
588 __le32 psat_and_phy_power_limit_b;
589 __le32 sar_and_regulatory_power_limit_b;
590 __le32 srd_and_driver_power_limits;
591 __le32 reserved;
592} __packed; /* STATISTICS_PHY_NTFY_API_S_VER_1 */
593
594/**
595 * struct iwl_statistics_mac_ntfy
596 *
597 * @hdr: general statistics header
598 * @bcast_filter_passed_per_mac: bcast filter passed per mac
599 * @bcast_filter_dropped_per_mac: bcast filter dropped per mac
600 * @bcast_filter_passed_per_filter: bcast filter passed per filter
601 * @bcast_filter_dropped_per_filter: bcast filter dropped per filter
602 * @reserved: reserved
603 */
604struct iwl_statistics_mac_ntfy {
605 struct iwl_statistics_ntfy_hdr hdr;
606 __le32 bcast_filter_passed_per_mac[NUM_MAC_INDEX_CDB];
607 __le32 bcast_filter_dropped_per_mac[NUM_MAC_INDEX_CDB];
608 __le32 bcast_filter_passed_per_filter[MAX_BCAST_FILTER_NUM];
609 __le32 bcast_filter_dropped_per_filter[MAX_BCAST_FILTER_NUM];
610 __le32 reserved;
611} __packed; /* STATISTICS_MAC_NTFY_API_S_VER_1 */
612
613/**
614 * struct iwl_statistics_rx_ntfy
615 *
616 * @hdr: general statistics header
617 * @rx_agg_mpdu_cnt: aggregation frame count (number of
618 * delimiters)
619 * @rx_agg_cnt: number of RX Aggregations
620 * @unsupported_mcs: number of PLCP headers that have rate which
621 * is unsupported by DSP
622 * @bogus_cts: CTS received when not expecting CTS
623 * @bogus_ack: ACK received when not expecting ACK
624 * @rx_byte_count: ???
625 * @rx_packet_count: ???
626 * @missed_beacons: ???
627 * @unresponded_rts: un-responded RTS, due to NAV not zero
628 * @rxe_frame_limit_overrun: RXE got frame limit overrun
629 * @sent_ba_rsp_cnt: BA response TX count
630 * @late_rx_handle: count the number of times the RX path was
631 * aborted due to late entry
632 * @num_bt_kills: ???
633 * @reserved: reserved
634 */
635struct iwl_statistics_rx_ntfy {
636 struct iwl_statistics_ntfy_hdr hdr;
637 __le32 rx_agg_mpdu_cnt;
638 __le32 rx_agg_cnt;
639 __le32 unsupported_mcs;
640 __le32 bogus_cts;
641 __le32 bogus_ack;
642 __le32 rx_byte_count[MAC_INDEX_AUX];
643 __le32 rx_packet_count[MAC_INDEX_AUX];
644 __le32 missed_beacons;
645 __le32 unresponded_rts;
646 __le32 rxe_frame_limit_overrun;
647 __le32 sent_ba_rsp_cnt;
648 __le32 late_rx_handle;
649 __le32 num_bt_kills;
650 __le32 reserved;
651} __packed; /* STATISTICS_RX_NTFY_API_S_VER_1 */
652
653/**
654 * struct iwl_statistics_tx_ntfy
655 *
656 * @hdr: general statistics header
657 * @cts_timeout: timeout when waiting for CTS
658 * @ack_timeout: timeout when waiting for ACK
659 * @dump_msdu_cnt: number of MSDUs that were dumped due to any
660 * reason
661 * @burst_abort_missing_next_frame_cnt: number of times a burst
662 * was aborted due to missing next frame bytes in txfifo
663 * number of times got timeout when waiting for CTS/ACK/BA and energy was
664 * detected just after sending the RTS/DATA. this statistics may help getting
665 * interesting indicators, like the likelihood of collision (so the benefit of
666 * protection may be estimated Vs. its cost). Or how many of the failures are
667 * due to collision and how many due to SNR.
668 * For Link-quality the CTS collision indication is more reliable then the ACK
669 * collision indication as the RTS frame is short and has more chance that the
670 * frame/s which caused the collision continue after the RTS was sent.
671 * @cts_timeout_collision: ???
672 * ACK/BA failed and energy as detected after DATA
673 * Note: to get the collision ratio need to:
674 * ackOrBaTimeoutCollision / (ack_timeout + ba_timeout)
675 * @ack_or_ba_timeout_collision: ???
676 * @ba_timeout: timeout when waiting for immediate BA response
677 * @ba_reschedule_frames: failed to get BA response and
678 * rescheduled all the non-ACKed frames
679 * gives the avarage number of frames inside aggregation
680 * @scd_query_agg_frame_cnt: ???
681 * @scd_query_no_agg: scheduler query prevented aggregation
682 * @scd_query_agg: scheduler query allowed aggregation
683 * @scd_query_mismatch: scheduler query inaccurate, either too
684 * short or too long
685 * @agg_terminated_underrun: aggregation was terminated due to
686 * underrun
687 * @agg_terminated_bt_prio_kill: aggregation was terminated due
688 * to BT
689 * @tx_kill_on_long_retry: count the tx frames dropped due to
690 * long retry limit (DATA frame failed)
691 * @tx_kill_on_short_retry: count the tx frames dropped due to
692 * short retry limit (RTS frame failed)
693 * TX deffer on energy. This counter is reset on each successful transmit.
694 * When timer exceed TX deffer limit than will be uCode assert.
695 * @tx_deffer_counter: ???
696 * @tx_deffer_base_time: Keep the time of the last successful
697 * transmit
698 * @tx_underrun: TX killed due to underrun
699 * @bt_defer: TX deferred due to BT priority, so probably TX was
700 * not started.
701 * @tx_kill_on_dsp_timeout: TX killed on DSP problem detected
702 * @tx_kill_on_immediate_quiet: TX killed due to immediate quiet
703 * @kill_ba_cnt: number of times sending BA failed
704 * @kill_ack_cnt: number of times sending ACK failed
705 * @kill_cts_cnt: number of times sending CTS failed
706 * @burst_terminated: Count burst or fragmentation termination
707 * occurrence
708 * @late_tx_vec_wr_cnt: ???
709 * TX is not sent because ucode failed to notify the TRM in SIFS-delta from
710 * ON_AIR deassertion.
711 * @late_rx2_tx_cnt: ???
712 * @scd_query_cnt: count the times SCD query was done to check
713 * for TX AGG
714 * @tx_frames_acked_in_agg: count the number of frames
715 * transmitted inside AGG and were successful
716 * @last_tx_ch_width_indx: ???
717 * number of deferred TX per channel width, 0 - 20, 1/2/3 - 40/80/160
718 * @rx_detected_per_ch_width: ???
719 * @success_per_ch_width: ???
720 * @fail_per_ch_width: ???
721 * @reserved: reserved
722 */
723struct iwl_statistics_tx_ntfy {
724 struct iwl_statistics_ntfy_hdr hdr;
725 __le32 cts_timeout;
726 __le32 ack_timeout;
727 __le32 dump_msdu_cnt;
728 __le32 burst_abort_missing_next_frame_cnt;
729 __le32 cts_timeout_collision;
730 __le32 ack_or_ba_timeout_collision;
731 __le32 ba_timeout;
732 __le32 ba_reschedule_frames;
733 __le32 scd_query_agg_frame_cnt;
734 __le32 scd_query_no_agg;
735 __le32 scd_query_agg;
736 __le32 scd_query_mismatch;
737 __le32 agg_terminated_underrun;
738 __le32 agg_terminated_bt_prio_kill;
739 __le32 tx_kill_on_long_retry;
740 __le32 tx_kill_on_short_retry;
741 __le32 tx_deffer_counter;
742 __le32 tx_deffer_base_time;
743 __le32 tx_underrun;
744 __le32 bt_defer;
745 __le32 tx_kill_on_dsp_timeout;
746 __le32 tx_kill_on_immediate_quiet;
747 __le32 kill_ba_cnt;
748 __le32 kill_ack_cnt;
749 __le32 kill_cts_cnt;
750 __le32 burst_terminated;
751 __le32 late_tx_vec_wr_cnt;
752 __le32 late_rx2_tx_cnt;
753 __le32 scd_query_cnt;
754 __le32 tx_frames_acked_in_agg;
755 __le32 last_tx_ch_width_indx;
756 __le32 rx_detected_per_ch_width[4];
757 __le32 success_per_ch_width[4];
758 __le32 fail_per_ch_width[4];
759 __le32 reserved;
760} __packed; /* STATISTICS_TX_NTFY_API_S_VER_1 */
761
762/**
763 * struct iwl_statistics_duration_ntfy
764 *
765 * @hdr: general statistics header
766 * @cont_burst_chk_cnt: number of times continuation or
767 * fragmentation or bursting was checked
768 * @cont_burst_cnt: number of times continuation or fragmentation
769 * or bursting was successful
770 * @wait_for_silence_timeout_cnt: ???
771 * @reserved: reserved
772 */
773struct iwl_statistics_duration_ntfy {
774 struct iwl_statistics_ntfy_hdr hdr;
775 __le32 cont_burst_chk_cnt;
776 __le32 cont_burst_cnt;
777 __le32 wait_for_silence_timeout_cnt;
778 __le32 reserved;
779} __packed; /* STATISTICS_DURATION_NTFY_API_S_VER_1 */
780
781/**
782 * struct iwl_statistics_he_ntfy
783 *
784 * @hdr: general statistics header
785 * received HE frames
786 * @rx_siga_valid_cnt: rx HE SIG-A valid
787 * @rx_siga_invalid_cnt: rx HE SIG-A invalid
788 * received HE frames w/ valid Sig-A
789 * @rx_trig_based_frame_cnt: rx HE-TB (trig-based)
790 * @rx_su_frame_cnt: rx HE-SU
791 * @rx_sigb_invalid_cnt: rx (suspected) HE-MU w/ bad SIG-B
792 * @rx_our_bss_color_cnt: rx valid HE SIG-A w/ our BSS color
793 * @rx_other_bss_color_cnt: rx valid HE SIG-A w/ other BSS color
794 * @rx_zero_bss_color_cnt: ???
795 * received HE-MU frames w/ good Sig-B
796 * @rx_mu_for_us_cnt: match AID
797 * @rx_mu_not_for_us_cnt: no matched AID
798 * received HE-MU frames for us (w/ our AID)
799 * @rx_mu_nss_ar: 0 - SISO, 1 - MIMO2
800 * @rx_mu_mimo_cnt: full BW RU, compressed SIG-B
801 * @rx_mu_ru_bw_ar: MU alloc, MHz: 0 - 2, 1 - 5, 2 - 10, 3 - 20,
802 * 4 - 40, 5 - 80, 6 - 160
803 * received trigger frames
804 * @rx_trig_for_us_cnt: ???
805 * @rx_trig_not_for_us_cnt: ???
806 * trigger for us
807 * @rx_trig_with_cs_req_cnt: ???
808 * @rx_trig_type_ar: ???
809 * @rx_trig_in_agg_cnt: ???
810 * basic trigger for us allocations
811 * @rx_basic_trig_alloc_nss_ar: ???
812 * @rx_basic_trig_alloc_mu_mimo_cnt: ???
813 * @rx_basic_trig_alloc_ru_bw_ar: ???
814 * @rx_basic_trig_total_byte_cnt: ???
815 * trig-based TX
816 * @tx_trig_based_cs_req_fail_cnt: ???
817 * @tx_trig_based_sifs_ok_cnt: ???
818 * @tx_trig_based_sifs_fail_cnt: ???
819 * @tx_trig_based_byte_cnt: ???
820 * @tx_trig_based_pad_byte_cnt: ???
821 * @tx_trig_based_frame_cnt: ???
822 * @tx_trig_based_acked_frame_cnt: ???
823 * @tx_trig_based_ack_timeout_cnt: ???
824 * HE-SU TX
825 * @tx_su_frame_cnt: ???
826 * EDCA <--> MU-EDCA transitions
827 * @tx_edca_to_mu_edca_cnt: ???
828 * @tx_mu_edca_to_edca_by_timeout_cnt: ???
829 * @tx_mu_edca_to_edca_by_ack_fail_cnt: ???
830 * @tx_mu_edca_to_edca_by_small_alloc_cnt: ???
831 * @reserved: reserved
832 */
833struct iwl_statistics_he_ntfy {
834 struct iwl_statistics_ntfy_hdr hdr;
835 __le32 rx_siga_valid_cnt;
836 __le32 rx_siga_invalid_cnt;
837 __le32 rx_trig_based_frame_cnt;
838 __le32 rx_su_frame_cnt;
839 __le32 rx_sigb_invalid_cnt;
840 __le32 rx_our_bss_color_cnt;
841 __le32 rx_other_bss_color_cnt;
842 __le32 rx_zero_bss_color_cnt;
843 __le32 rx_mu_for_us_cnt;
844 __le32 rx_mu_not_for_us_cnt;
845 __le32 rx_mu_nss_ar[2];
846 __le32 rx_mu_mimo_cnt;
847 __le32 rx_mu_ru_bw_ar[7];
848 __le32 rx_trig_for_us_cnt;
849 __le32 rx_trig_not_for_us_cnt;
850 __le32 rx_trig_with_cs_req_cnt;
851 __le32 rx_trig_type_ar[8 + 1];
852 __le32 rx_trig_in_agg_cnt;
853 __le32 rx_basic_trig_alloc_nss_ar[2];
854 __le32 rx_basic_trig_alloc_mu_mimo_cnt;
855 __le32 rx_basic_trig_alloc_ru_bw_ar[7];
856 __le32 rx_basic_trig_total_byte_cnt;
857 __le32 tx_trig_based_cs_req_fail_cnt;
858 __le32 tx_trig_based_sifs_ok_cnt;
859 __le32 tx_trig_based_sifs_fail_cnt;
860 __le32 tx_trig_based_byte_cnt;
861 __le32 tx_trig_based_pad_byte_cnt;
862 __le32 tx_trig_based_frame_cnt;
863 __le32 tx_trig_based_acked_frame_cnt;
864 __le32 tx_trig_based_ack_timeout_cnt;
865 __le32 tx_su_frame_cnt;
866 __le32 tx_edca_to_mu_edca_cnt;
867 __le32 tx_mu_edca_to_edca_by_timeout_cnt;
868 __le32 tx_mu_edca_to_edca_by_ack_fail_cnt;
869 __le32 tx_mu_edca_to_edca_by_small_alloc_cnt;
870 __le32 reserved;
871} __packed; /* STATISTICS_HE_NTFY_API_S_VER_1 */
872
873#endif /* __iwl_fw_api_stats_h__ */