1
2
3
4
5
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;
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;
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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;
74
75struct mvm_statistics_rx_non_phy_v3 {
76 __le32 bogus_cts;
77 __le32 bogus_ack;
78 __le32 non_bssid_frames;
79
80 __le32 filtered_frames;
81
82 __le32 non_channel_beacons;
83
84 __le32 channel_beacons;
85
86 __le32 num_missed_bcon;
87 __le32 adc_rx_saturation_time;
88
89 __le32 ina_detection_search_time;
90
91 __le32 beacon_silence_rssi_a;
92 __le32 beacon_silence_rssi_b;
93 __le32 beacon_silence_rssi_c;
94 __le32 interference_data_flag;
95
96
97 __le32 channel_load;
98 __le32 dsp_false_alarms;
99
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;
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;
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;
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;
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;
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;
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;
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;
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};
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;
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;
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;
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
257
258
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
286
287
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;
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;
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;
317
318
319
320
321
322
323
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;
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;
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;
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;
352
353
354
355
356
357
358
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;
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;
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;
383
384
385
386
387
388enum iwl_statistics_notif_flags {
389 IWL_STATISTICS_REPLY_FLG_CLEAR = 0x1,
390};
391
392
393
394
395
396
397
398
399enum iwl_statistics_cmd_flags {
400 IWL_STATISTICS_FLG_CLEAR = 0x1,
401 IWL_STATISTICS_FLG_DISABLE_NOTIF = 0x2,
402};
403
404
405
406
407
408struct iwl_statistics_cmd {
409 __le32 flags;
410} __packed;
411
412#define MAX_BCAST_FILTER_NUM 8
413
414
415
416
417
418
419
420
421
422
423
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};
434
435
436
437
438
439
440
441
442struct iwl_statistics_ntfy_hdr {
443 u8 type;
444 u8 version;
445 __le16 size;
446};
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
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;
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
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;
593
594
595
596
597
598
599
600
601
602
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;
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
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;
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
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;
761
762
763
764
765
766
767
768
769
770
771
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;
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
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;
872
873#endif
874