Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
0002 /*
0003  * Copyright (C) 2012-2014, 2018, 2020 - 2021 Intel Corporation
0004  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
0005  * Copyright (C) 2016-2017 Intel Deutschland GmbH
0006  */
0007 #ifndef __iwl_fw_api_stats_h__
0008 #define __iwl_fw_api_stats_h__
0009 #include "mac.h"
0010 
0011 struct mvm_statistics_dbg {
0012     __le32 burst_check;
0013     __le32 burst_count;
0014     __le32 wait_for_silence_timeout_cnt;
0015     u8 reserved[12];
0016 } __packed; /* STATISTICS_DEBUG_API_S_VER_2 */
0017 
0018 struct mvm_statistics_div {
0019     __le32 tx_on_a;
0020     __le32 tx_on_b;
0021     __le32 exec_time;
0022     __le32 probe_time;
0023     __le32 rssi_ant;
0024     __le32 reserved2;
0025 } __packed; /* STATISTICS_SLOW_DIV_API_S_VER_2 */
0026 
0027 /**
0028  * struct mvm_statistics_rx_non_phy
0029  * @bogus_cts: CTS received when not expecting CTS
0030  * @bogus_ack: ACK received when not expecting ACK
0031  * @non_channel_beacons: beacons with our bss id but not on our serving channel
0032  * @channel_beacons: beacons with our bss id and in our serving channel
0033  * @num_missed_bcon: number of missed beacons
0034  * @adc_rx_saturation_time: count in 0.8us units the time the ADC was in
0035  *  saturation
0036  * @ina_detection_search_time: total time (in 0.8us) searched for INA
0037  * @beacon_silence_rssi_a: RSSI silence after beacon frame
0038  * @beacon_silence_rssi_b: RSSI silence after beacon frame
0039  * @beacon_silence_rssi_c: RSSI silence after beacon frame
0040  * @interference_data_flag: flag for interference data availability. 1 when data
0041  *  is available.
0042  * @channel_load: counts RX Enable time in uSec
0043  * @beacon_rssi_a: beacon RSSI on antenna A
0044  * @beacon_rssi_b: beacon RSSI on antenna B
0045  * @beacon_rssi_c: beacon RSSI on antenna C
0046  * @beacon_energy_a: beacon energy on antenna A
0047  * @beacon_energy_b: beacon energy on antenna B
0048  * @beacon_energy_c: beacon energy on antenna C
0049  * @num_bt_kills: number of BT "kills" (frame TX aborts)
0050  * @mac_id: mac ID
0051  */
0052 struct mvm_statistics_rx_non_phy {
0053     __le32 bogus_cts;
0054     __le32 bogus_ack;
0055     __le32 non_channel_beacons;
0056     __le32 channel_beacons;
0057     __le32 num_missed_bcon;
0058     __le32 adc_rx_saturation_time;
0059     __le32 ina_detection_search_time;
0060     __le32 beacon_silence_rssi_a;
0061     __le32 beacon_silence_rssi_b;
0062     __le32 beacon_silence_rssi_c;
0063     __le32 interference_data_flag;
0064     __le32 channel_load;
0065     __le32 beacon_rssi_a;
0066     __le32 beacon_rssi_b;
0067     __le32 beacon_rssi_c;
0068     __le32 beacon_energy_a;
0069     __le32 beacon_energy_b;
0070     __le32 beacon_energy_c;
0071     __le32 num_bt_kills;
0072     __le32 mac_id;
0073 } __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_4 */
0074 
0075 struct mvm_statistics_rx_non_phy_v3 {
0076     __le32 bogus_cts;   /* CTS received when not expecting CTS */
0077     __le32 bogus_ack;   /* ACK received when not expecting ACK */
0078     __le32 non_bssid_frames;    /* number of frames with BSSID that
0079                      * doesn't belong to the STA BSSID */
0080     __le32 filtered_frames; /* count frames that were dumped in the
0081                  * filtering process */
0082     __le32 non_channel_beacons; /* beacons with our bss id but not on
0083                      * our serving channel */
0084     __le32 channel_beacons; /* beacons with our bss id and in our
0085                  * serving channel */
0086     __le32 num_missed_bcon; /* number of missed beacons */
0087     __le32 adc_rx_saturation_time;  /* count in 0.8us units the time the
0088                      * ADC was in saturation */
0089     __le32 ina_detection_search_time;/* total time (in 0.8us) searched
0090                       * for INA */
0091     __le32 beacon_silence_rssi_a;   /* RSSI silence after beacon frame */
0092     __le32 beacon_silence_rssi_b;   /* RSSI silence after beacon frame */
0093     __le32 beacon_silence_rssi_c;   /* RSSI silence after beacon frame */
0094     __le32 interference_data_flag;  /* flag for interference data
0095                      * availability. 1 when data is
0096                      * available. */
0097     __le32 channel_load;        /* counts RX Enable time in uSec */
0098     __le32 dsp_false_alarms;    /* DSP false alarm (both OFDM
0099                      * and CCK) counter */
0100     __le32 beacon_rssi_a;
0101     __le32 beacon_rssi_b;
0102     __le32 beacon_rssi_c;
0103     __le32 beacon_energy_a;
0104     __le32 beacon_energy_b;
0105     __le32 beacon_energy_c;
0106     __le32 num_bt_kills;
0107     __le32 mac_id;
0108     __le32 directed_data_mpdu;
0109 } __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_3 */
0110 
0111 struct mvm_statistics_rx_phy {
0112     __le32 unresponded_rts;
0113     __le32 rxe_frame_lmt_overrun;
0114     __le32 sent_ba_rsp_cnt;
0115     __le32 dsp_self_kill;
0116     __le32 reserved;
0117 } __packed; /* STATISTICS_RX_PHY_API_S_VER_3 */
0118 
0119 struct mvm_statistics_rx_phy_v2 {
0120     __le32 ina_cnt;
0121     __le32 fina_cnt;
0122     __le32 plcp_err;
0123     __le32 crc32_err;
0124     __le32 overrun_err;
0125     __le32 early_overrun_err;
0126     __le32 crc32_good;
0127     __le32 false_alarm_cnt;
0128     __le32 fina_sync_err_cnt;
0129     __le32 sfd_timeout;
0130     __le32 fina_timeout;
0131     __le32 unresponded_rts;
0132     __le32 rxe_frame_lmt_overrun;
0133     __le32 sent_ack_cnt;
0134     __le32 sent_cts_cnt;
0135     __le32 sent_ba_rsp_cnt;
0136     __le32 dsp_self_kill;
0137     __le32 mh_format_err;
0138     __le32 re_acq_main_rssi_sum;
0139     __le32 reserved;
0140 } __packed; /* STATISTICS_RX_PHY_API_S_VER_2 */
0141 
0142 struct mvm_statistics_rx_ht_phy_v1 {
0143     __le32 plcp_err;
0144     __le32 overrun_err;
0145     __le32 early_overrun_err;
0146     __le32 crc32_good;
0147     __le32 crc32_err;
0148     __le32 mh_format_err;
0149     __le32 agg_crc32_good;
0150     __le32 agg_mpdu_cnt;
0151     __le32 agg_cnt;
0152     __le32 unsupport_mcs;
0153 } __packed;  /* STATISTICS_HT_RX_PHY_API_S_VER_1 */
0154 
0155 struct mvm_statistics_rx_ht_phy {
0156     __le32 mh_format_err;
0157     __le32 agg_mpdu_cnt;
0158     __le32 agg_cnt;
0159     __le32 unsupport_mcs;
0160 } __packed;  /* STATISTICS_HT_RX_PHY_API_S_VER_2 */
0161 
0162 struct mvm_statistics_tx_non_phy_v3 {
0163     __le32 preamble_cnt;
0164     __le32 rx_detected_cnt;
0165     __le32 bt_prio_defer_cnt;
0166     __le32 bt_prio_kill_cnt;
0167     __le32 few_bytes_cnt;
0168     __le32 cts_timeout;
0169     __le32 ack_timeout;
0170     __le32 expected_ack_cnt;
0171     __le32 actual_ack_cnt;
0172     __le32 dump_msdu_cnt;
0173     __le32 burst_abort_next_frame_mismatch_cnt;
0174     __le32 burst_abort_missing_next_frame_cnt;
0175     __le32 cts_timeout_collision;
0176     __le32 ack_or_ba_timeout_collision;
0177 } __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_3 */
0178 
0179 struct mvm_statistics_tx_non_phy {
0180     __le32 bt_prio_defer_cnt;
0181     __le32 bt_prio_kill_cnt;
0182     __le32 few_bytes_cnt;
0183     __le32 cts_timeout;
0184     __le32 ack_timeout;
0185     __le32 dump_msdu_cnt;
0186     __le32 burst_abort_next_frame_mismatch_cnt;
0187     __le32 burst_abort_missing_next_frame_cnt;
0188     __le32 cts_timeout_collision;
0189     __le32 ack_or_ba_timeout_collision;
0190 } __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_4 */
0191 
0192 #define MAX_CHAINS 3
0193 
0194 struct mvm_statistics_tx_non_phy_agg {
0195     __le32 ba_timeout;
0196     __le32 ba_reschedule_frames;
0197     __le32 scd_query_agg_frame_cnt;
0198     __le32 scd_query_no_agg;
0199     __le32 scd_query_agg;
0200     __le32 scd_query_mismatch;
0201     __le32 frame_not_ready;
0202     __le32 underrun;
0203     __le32 bt_prio_kill;
0204     __le32 rx_ba_rsp_cnt;
0205     __s8 txpower[MAX_CHAINS];
0206     __s8 reserved;
0207     __le32 reserved2;
0208 } __packed; /* STATISTICS_TX_NON_PHY_AGG_API_S_VER_1 */
0209 
0210 struct mvm_statistics_tx_channel_width {
0211     __le32 ext_cca_narrow_ch20[1];
0212     __le32 ext_cca_narrow_ch40[2];
0213     __le32 ext_cca_narrow_ch80[3];
0214     __le32 ext_cca_narrow_ch160[4];
0215     __le32 last_tx_ch_width_indx;
0216     __le32 rx_detected_per_ch_width[4];
0217     __le32 success_per_ch_width[4];
0218     __le32 fail_per_ch_width[4];
0219 }; /* STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
0220 
0221 struct mvm_statistics_tx_v4 {
0222     struct mvm_statistics_tx_non_phy_v3 general;
0223     struct mvm_statistics_tx_non_phy_agg agg;
0224     struct mvm_statistics_tx_channel_width channel_width;
0225 } __packed; /* STATISTICS_TX_API_S_VER_4 */
0226 
0227 struct mvm_statistics_tx {
0228     struct mvm_statistics_tx_non_phy general;
0229     struct mvm_statistics_tx_non_phy_agg agg;
0230     struct mvm_statistics_tx_channel_width channel_width;
0231 } __packed; /* STATISTICS_TX_API_S_VER_5 */
0232 
0233 
0234 struct mvm_statistics_bt_activity {
0235     __le32 hi_priority_tx_req_cnt;
0236     __le32 hi_priority_tx_denied_cnt;
0237     __le32 lo_priority_tx_req_cnt;
0238     __le32 lo_priority_tx_denied_cnt;
0239     __le32 hi_priority_rx_req_cnt;
0240     __le32 hi_priority_rx_denied_cnt;
0241     __le32 lo_priority_rx_req_cnt;
0242     __le32 lo_priority_rx_denied_cnt;
0243 } __packed;  /* STATISTICS_BT_ACTIVITY_API_S_VER_1 */
0244 
0245 struct mvm_statistics_general_common_v19 {
0246     __le32 radio_temperature;
0247     __le32 radio_voltage;
0248     struct mvm_statistics_dbg dbg;
0249     __le32 sleep_time;
0250     __le32 slots_out;
0251     __le32 slots_idle;
0252     __le32 ttl_timestamp;
0253     struct mvm_statistics_div slow_div;
0254     __le32 rx_enable_counter;
0255     /*
0256      * num_of_sos_states:
0257      *  count the number of times we have to re-tune
0258      *  in order to get out of bad PHY status
0259      */
0260     __le32 num_of_sos_states;
0261     __le32 beacon_filtered;
0262     __le32 missed_beacons;
0263     u8 beacon_filter_average_energy;
0264     u8 beacon_filter_reason;
0265     u8 beacon_filter_current_energy;
0266     u8 beacon_filter_reserved;
0267     __le32 beacon_filter_delta_time;
0268     struct mvm_statistics_bt_activity bt_activity;
0269     __le64 rx_time;
0270     __le64 on_time_rf;
0271     __le64 on_time_scan;
0272     __le64 tx_time;
0273 } __packed;
0274 
0275 struct mvm_statistics_general_common {
0276     __le32 radio_temperature;
0277     struct mvm_statistics_dbg dbg;
0278     __le32 sleep_time;
0279     __le32 slots_out;
0280     __le32 slots_idle;
0281     __le32 ttl_timestamp;
0282     struct mvm_statistics_div slow_div;
0283     __le32 rx_enable_counter;
0284     /*
0285      * num_of_sos_states:
0286      *  count the number of times we have to re-tune
0287      *  in order to get out of bad PHY status
0288      */
0289     __le32 num_of_sos_states;
0290     __le32 beacon_filtered;
0291     __le32 missed_beacons;
0292     u8 beacon_filter_average_energy;
0293     u8 beacon_filter_reason;
0294     u8 beacon_filter_current_energy;
0295     u8 beacon_filter_reserved;
0296     __le32 beacon_filter_delta_time;
0297     struct mvm_statistics_bt_activity bt_activity;
0298     __le64 rx_time;
0299     __le64 on_time_rf;
0300     __le64 on_time_scan;
0301     __le64 tx_time;
0302 } __packed; /* STATISTICS_GENERAL_API_S_VER_10 */
0303 
0304 struct mvm_statistics_general_v8 {
0305     struct mvm_statistics_general_common_v19 common;
0306     __le32 beacon_counter[NUM_MAC_INDEX];
0307     u8 beacon_average_energy[NUM_MAC_INDEX];
0308     u8 reserved[4 - (NUM_MAC_INDEX % 4)];
0309 } __packed; /* STATISTICS_GENERAL_API_S_VER_8 */
0310 
0311 struct mvm_statistics_general {
0312     struct mvm_statistics_general_common common;
0313     __le32 beacon_counter[MAC_INDEX_AUX];
0314     u8 beacon_average_energy[MAC_INDEX_AUX];
0315     u8 reserved[8 - MAC_INDEX_AUX];
0316 } __packed; /* STATISTICS_GENERAL_API_S_VER_10 */
0317 
0318 /**
0319  * struct mvm_statistics_load - RX statistics for multi-queue devices
0320  * @air_time: accumulated air time, per mac
0321  * @byte_count: accumulated byte count, per mac
0322  * @pkt_count: accumulated packet count, per mac
0323  * @avg_energy: average RSSI, per station
0324  */
0325 struct mvm_statistics_load {
0326     __le32 air_time[MAC_INDEX_AUX];
0327     __le32 byte_count[MAC_INDEX_AUX];
0328     __le32 pkt_count[MAC_INDEX_AUX];
0329     u8 avg_energy[IWL_MVM_STATION_COUNT_MAX];
0330 } __packed; /* STATISTICS_RX_MAC_STATION_S_VER_3 */
0331 
0332 struct mvm_statistics_load_v1 {
0333     __le32 air_time[NUM_MAC_INDEX];
0334     __le32 byte_count[NUM_MAC_INDEX];
0335     __le32 pkt_count[NUM_MAC_INDEX];
0336     u8 avg_energy[IWL_MVM_STATION_COUNT_MAX];
0337 } __packed; /* STATISTICS_RX_MAC_STATION_S_VER_1 */
0338 
0339 struct mvm_statistics_rx {
0340     struct mvm_statistics_rx_phy ofdm;
0341     struct mvm_statistics_rx_phy cck;
0342     struct mvm_statistics_rx_non_phy general;
0343     struct mvm_statistics_rx_ht_phy ofdm_ht;
0344 } __packed; /* STATISTICS_RX_API_S_VER_4 */
0345 
0346 struct mvm_statistics_rx_v3 {
0347     struct mvm_statistics_rx_phy_v2 ofdm;
0348     struct mvm_statistics_rx_phy_v2 cck;
0349     struct mvm_statistics_rx_non_phy_v3 general;
0350     struct mvm_statistics_rx_ht_phy_v1 ofdm_ht;
0351 } __packed; /* STATISTICS_RX_API_S_VER_3 */
0352 
0353 /*
0354  * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
0355  *
0356  * By default, uCode issues this notification after receiving a beacon
0357  * while associated.  To disable this behavior, set DISABLE_NOTIF flag in the
0358  * STATISTICS_CMD (0x9c), below.
0359  */
0360 
0361 struct iwl_notif_statistics_v10 {
0362     __le32 flag;
0363     struct mvm_statistics_rx_v3 rx;
0364     struct mvm_statistics_tx_v4 tx;
0365     struct mvm_statistics_general_v8 general;
0366 } __packed; /* STATISTICS_NTFY_API_S_VER_10 */
0367 
0368 struct iwl_notif_statistics_v11 {
0369     __le32 flag;
0370     struct mvm_statistics_rx_v3 rx;
0371     struct mvm_statistics_tx_v4 tx;
0372     struct mvm_statistics_general_v8 general;
0373     struct mvm_statistics_load_v1 load_stats;
0374 } __packed; /* STATISTICS_NTFY_API_S_VER_11 */
0375 
0376 struct iwl_notif_statistics {
0377     __le32 flag;
0378     struct mvm_statistics_rx rx;
0379     struct mvm_statistics_tx tx;
0380     struct mvm_statistics_general general;
0381     struct mvm_statistics_load load_stats;
0382 } __packed; /* STATISTICS_NTFY_API_S_VER_13 */
0383 
0384 /**
0385  * enum iwl_statistics_notif_flags - flags used in statistics notification
0386  * @IWL_STATISTICS_REPLY_FLG_CLEAR: statistics were cleared after this report
0387  */
0388 enum iwl_statistics_notif_flags {
0389     IWL_STATISTICS_REPLY_FLG_CLEAR      = 0x1,
0390 };
0391 
0392 /**
0393  * enum iwl_statistics_cmd_flags - flags used in statistics command
0394  * @IWL_STATISTICS_FLG_CLEAR: request to clear statistics after the report
0395  *  that's sent after this command
0396  * @IWL_STATISTICS_FLG_DISABLE_NOTIF: disable unilateral statistics
0397  *  notifications
0398  */
0399 enum iwl_statistics_cmd_flags {
0400     IWL_STATISTICS_FLG_CLEAR        = 0x1,
0401     IWL_STATISTICS_FLG_DISABLE_NOTIF    = 0x2,
0402 };
0403 
0404 /**
0405  * struct iwl_statistics_cmd - statistics config command
0406  * @flags: flags from &enum iwl_statistics_cmd_flags
0407  */
0408 struct iwl_statistics_cmd {
0409     __le32 flags;
0410 } __packed; /* STATISTICS_CMD_API_S_VER_1 */
0411 
0412 #define MAX_BCAST_FILTER_NUM        8
0413 
0414 /**
0415  * enum iwl_fw_statistics_type
0416  *
0417  * @FW_STATISTICS_OPERATIONAL: operational statistics
0418  * @FW_STATISTICS_PHY: phy statistics
0419  * @FW_STATISTICS_MAC: mac statistics
0420  * @FW_STATISTICS_RX: rx statistics
0421  * @FW_STATISTICS_TX: tx statistics
0422  * @FW_STATISTICS_DURATION: duration statistics
0423  * @FW_STATISTICS_HE: he statistics
0424  */
0425 enum iwl_fw_statistics_type {
0426     FW_STATISTICS_OPERATIONAL,
0427     FW_STATISTICS_PHY,
0428     FW_STATISTICS_MAC,
0429     FW_STATISTICS_RX,
0430     FW_STATISTICS_TX,
0431     FW_STATISTICS_DURATION,
0432     FW_STATISTICS_HE,
0433 }; /* FW_STATISTICS_TYPE_API_E_VER_1 */
0434 
0435 #define IWL_STATISTICS_TYPE_MSK 0x7f
0436 /**
0437  * struct iwl_statistics_ntfy_hdr
0438  *
0439  * @type: struct type
0440  * @version: version of the struct
0441  * @size: size in bytes
0442  */
0443 struct iwl_statistics_ntfy_hdr {
0444     u8 type;
0445     u8 version;
0446     __le16 size;
0447 }; /* STATISTICS_NTFY_HDR_API_S_VER_1 */
0448 
0449 /**
0450  * struct iwl_statistics_ntfy_per_mac
0451  *
0452  * @beacon_filter_average_energy: Average energy [-dBm] of the 2
0453  *   antennas.
0454  * @air_time: air time
0455  * @beacon_counter: all beacons (both filtered and not filtered)
0456  * @beacon_average_energy: all beacons (both filtered and not
0457  *   filtered)
0458  * @beacon_rssi_a: beacon RSSI on antenna A
0459  * @beacon_rssi_b: beacon RSSI on antenna B
0460  * @rx_bytes: RX byte count
0461  */
0462 struct iwl_statistics_ntfy_per_mac {
0463     __le32 beacon_filter_average_energy;
0464     __le32 air_time;
0465     __le32 beacon_counter;
0466     __le32 beacon_average_energy;
0467     __le32 beacon_rssi_a;
0468     __le32 beacon_rssi_b;
0469     __le32 rx_bytes;
0470 } __packed; /* STATISTICS_NTFY_PER_MAC_API_S_VER_1 */
0471 
0472 #define IWL_STATS_MAX_BW_INDEX 5
0473 /** struct iwl_statistics_ntfy_per_phy
0474  * @channel_load: channel load
0475  * @channel_load_by_us: device contribution to MCLM
0476  * @channel_load_not_by_us: other devices' contribution to MCLM
0477  * @clt: CLT HW timer (TIM_CH_LOAD2)
0478  * @act: active accumulator SW
0479  * @elp: elapsed time accumulator SW
0480  * @rx_detected_per_ch_width: number of deferred TX per channel width,
0481  *  0 - 20, 1/2/3 - 40/80/160
0482  * @success_per_ch_width: number of frames that got ACK/BACK/CTS
0483  *  per channel BW. note, BACK counted as 1
0484  * @fail_per_ch_width: number of frames that didn't get ACK/BACK/CTS
0485  *  per channel BW. note BACK counted as 1
0486  * @last_tx_ch_width_indx: last txed frame channel width index
0487  */
0488 struct iwl_statistics_ntfy_per_phy {
0489     __le32 channel_load;
0490     __le32 channel_load_by_us;
0491     __le32 channel_load_not_by_us;
0492     __le32 clt;
0493     __le32 act;
0494     __le32 elp;
0495     __le32 rx_detected_per_ch_width[IWL_STATS_MAX_BW_INDEX];
0496     __le32 success_per_ch_width[IWL_STATS_MAX_BW_INDEX];
0497     __le32 fail_per_ch_width[IWL_STATS_MAX_BW_INDEX];
0498     __le32 last_tx_ch_width_indx;
0499 } __packed; /* STATISTICS_NTFY_PER_PHY_API_S_VER_1 */
0500 
0501 /**
0502  * struct iwl_statistics_ntfy_per_sta
0503  *
0504  * @average_energy: in fact it is minus the energy..
0505  */
0506 struct iwl_statistics_ntfy_per_sta {
0507     __le32 average_energy;
0508 } __packed; /* STATISTICS_NTFY_PER_STA_API_S_VER_1 */
0509 
0510 #define IWL_STATS_MAX_PHY_OPERTINAL 3
0511 /**
0512  * struct iwl_statistics_operational_ntfy
0513  *
0514  * @hdr: general statistics header
0515  * @flags: bitmap of possible notification structures
0516  * @per_mac_stats: per mac statistics, &struct iwl_statistics_ntfy_per_mac
0517  * @per_phy_stats: per phy statistics, &struct iwl_statistics_ntfy_per_phy
0518  * @per_sta_stats: per sta statistics, &struct iwl_statistics_ntfy_per_sta
0519  * @rx_time: rx time
0520  * @tx_time: usec the radio is transmitting.
0521  * @on_time_rf: The total time in usec the RF is awake.
0522  * @on_time_scan: usec the radio is awake due to scan.
0523  */
0524 struct iwl_statistics_operational_ntfy {
0525     struct iwl_statistics_ntfy_hdr hdr;
0526     __le32 flags;
0527     struct iwl_statistics_ntfy_per_mac per_mac_stats[MAC_INDEX_AUX];
0528     struct iwl_statistics_ntfy_per_phy per_phy_stats[IWL_STATS_MAX_PHY_OPERTINAL];
0529     struct iwl_statistics_ntfy_per_sta per_sta_stats[IWL_MVM_STATION_COUNT_MAX];
0530     __le64 rx_time;
0531     __le64 tx_time;
0532     __le64 on_time_rf;
0533     __le64 on_time_scan;
0534 } __packed; /* STATISTICS_OPERATIONAL_NTFY_API_S_VER_15 */
0535 
0536 /**
0537  * struct iwl_statistics_operational_ntfy_ver_14
0538  *
0539  * @hdr: general statistics header
0540  * @flags: bitmap of possible notification structures
0541  * @mac_id: mac on which the beacon was received
0542  * @beacon_filter_average_energy: Average energy [-dBm] of the 2
0543  *   antennas.
0544  * @beacon_filter_reason: beacon filter reason
0545  * @radio_temperature: radio temperature
0546  * @air_time: air time
0547  * @beacon_counter: all beacons (both filtered and not filtered)
0548  * @beacon_average_energy: all beacons (both filtered and not
0549  *   filtered)
0550  * @beacon_rssi_a: beacon RSSI on antenna A
0551  * @beacon_rssi_b: beacon RSSI on antenna B
0552  * @rx_bytes: per MAC RX byte count
0553  * @rx_time: rx time
0554  * @tx_time: usec the radio is transmitting.
0555  * @on_time_rf: The total time in usec the RF is awake.
0556  * @on_time_scan: usec the radio is awake due to scan.
0557  * @average_energy: in fact it is minus the energy..
0558  * @reserved: reserved
0559  */
0560 struct iwl_statistics_operational_ntfy_ver_14 {
0561     struct iwl_statistics_ntfy_hdr hdr;
0562     __le32 flags;
0563     __le32 mac_id;
0564     __le32 beacon_filter_average_energy;
0565     __le32 beacon_filter_reason;
0566     __le32 radio_temperature;
0567     __le32 air_time[MAC_INDEX_AUX];
0568     __le32 beacon_counter[MAC_INDEX_AUX];
0569     __le32 beacon_average_energy[MAC_INDEX_AUX];
0570     __le32 beacon_rssi_a;
0571     __le32 beacon_rssi_b;
0572     __le32 rx_bytes[MAC_INDEX_AUX];
0573     __le64 rx_time;
0574     __le64 tx_time;
0575     __le64 on_time_rf;
0576     __le64 on_time_scan;
0577     __le32 average_energy[IWL_MVM_STATION_COUNT_MAX];
0578     __le32 reserved;
0579 } __packed; /* STATISTICS_OPERATIONAL_NTFY_API_S_VER_14 */
0580 
0581 /**
0582  * struct iwl_statistics_phy_ntfy
0583  *
0584  * @hdr: general statistics header
0585  * RX PHY related statistics
0586  * @energy_and_config: ???
0587  * @rssi_band: @31:24 rssiAllBand_B, 23:16 rssiInBand_B, 15:8
0588  *   rssiAllBand_A, 7:0 rssiInBand_A
0589  * @agc_word: @31:16 agcWord_B, 15:0 agcWord_A
0590  * @agc_gain: @19:10 agcGain_B, 9:0 agcGain_A
0591  * @dfe_gain: @19:10 dfeGain_B, 9:0 dfeGain_A
0592  * @snr_calc_main: @18:0 snrCalcMain
0593  * @energy_calc_main: @18:0 energyCalcMain
0594  * @snr_calc_aux: @18:0 snrCalcAux
0595  * @dsp_dc_estim_a: @27:14 dspDcEstimQA, 13:0 dspDcEstimIA
0596  * @dsp_dc_estim_b: @27:14 dspDcEstimQB, 13:0 dspDcEstimIB
0597  * @ina_detec_type_and_ofdm_corr_comb: @31:31 inaDetectCckMrc,
0598  *   30:27 inaDetectType, 26:0 ofdmCorrComb
0599  * @cw_corr_comb: @26:0 cwCorrComb
0600  * @rssi_comb: @25:0 rssiComb
0601  * @auto_corr_cck: @23:12 autoCck, 11:00 crossCck
0602  * @ofdm_fine_freq_and_pina_freq_err: @18:7 ofdmFineFreq, 6:0
0603  *   ofdmPinaFreqErr
0604  * @snrm_evm_main: @31:0 snrmEvmMain
0605  * @snrm_evm_aux: @31:0 snrmEvmAux
0606  * @rx_rate: @31:0 rate
0607  * TX PHY related statistics
0608  * @per_chain_enums_and_dsp_atten_a: @perChainEnumsAndDspAtten
0609  *   (per version)
0610  * @target_power_and_power_meas_a: @31:16 targetPower_A, 15:0
0611  *   powerMeasuredCalc_A
0612  * @tx_config_as_i_and_ac_a: @31:16 txConfigAsI_A, 15:0
0613  *   txConfigAc_A
0614  * @predist_dcq_and_dci_a: @31:16 predist_dci_A, 15:0
0615  *   predist_dcq_A
0616  * @per_chain_enums_and_dsp_atten_b: @perChainEnumsAndDspAtten
0617  *   (per version)
0618  * @target_power_and_power_meas_b: @31:16 targetPower_B, 15:0
0619  *   powerMeasuredCalc_B
0620  * @tx_config_as_i_and_ac_b: @31:16 txConfigAsI_B, 15:0
0621  *   txConfigAc_B
0622  * @predist_dcq_and_dci_b: @31:16 predist_dci_B, 15:0
0623  *   predist_dcq_B
0624  * @tx_rate: @31:0 rate
0625  * @tlc_backoff: @31:0 tlcBackoff
0626  * @mpapd_calib_mode_mpapd_calib_type_a: @31:16
0627  *   mpapdCalibMode_A, 15:0 mpapdCalibType_A
0628  * @psat_and_phy_power_limit_a: @31:16 psat_A, 15:0
0629  *   phyPowerLimit_A
0630  * @sar_and_regulatory_power_limit_a: @31:16 sarPowerLimit_A,
0631  *   15:0 regulatoryPowerLimit_A
0632  * @mpapd_calib_mode_mpapd_calib_type_b: @31:16
0633  *   mpapdCalibMode_B, 15:0 mpapdCalibType_B
0634  * @psat_and_phy_power_limit_b: @31:16 psat_B, 15:0
0635  *   phyPowerLimit_B
0636  * @sar_and_regulatory_power_limit_b: @31:16 sarPowerLimit_B,
0637  *   15:0 regulatoryPowerLimit_B
0638  * @srd_and_driver_power_limits: @31:16 srdPowerLimit, 15:0
0639  *   driverPowerLimit
0640  * @reserved: reserved
0641  */
0642 struct iwl_statistics_phy_ntfy {
0643     struct iwl_statistics_ntfy_hdr hdr;
0644     __le32 energy_and_config;
0645     __le32 rssi_band;
0646     __le32 agc_word;
0647     __le32 agc_gain;
0648     __le32 dfe_gain;
0649     __le32 snr_calc_main;
0650     __le32 energy_calc_main;
0651     __le32 snr_calc_aux;
0652     __le32 dsp_dc_estim_a;
0653     __le32 dsp_dc_estim_b;
0654     __le32 ina_detec_type_and_ofdm_corr_comb;
0655     __le32 cw_corr_comb;
0656     __le32 rssi_comb;
0657     __le32 auto_corr_cck;
0658     __le32 ofdm_fine_freq_and_pina_freq_err;
0659     __le32 snrm_evm_main;
0660     __le32 snrm_evm_aux;
0661     __le32 rx_rate;
0662     __le32 per_chain_enums_and_dsp_atten_a;
0663     __le32 target_power_and_power_meas_a;
0664     __le32 tx_config_as_i_and_ac_a;
0665     __le32 predist_dcq_and_dci_a;
0666     __le32 per_chain_enums_and_dsp_atten_b;
0667     __le32 target_power_and_power_meas_b;
0668     __le32 tx_config_as_i_and_ac_b;
0669     __le32 predist_dcq_and_dci_b;
0670     __le32 tx_rate;
0671     __le32 tlc_backoff;
0672     __le32 mpapd_calib_mode_mpapd_calib_type_a;
0673     __le32 psat_and_phy_power_limit_a;
0674     __le32 sar_and_regulatory_power_limit_a;
0675     __le32 mpapd_calib_mode_mpapd_calib_type_b;
0676     __le32 psat_and_phy_power_limit_b;
0677     __le32 sar_and_regulatory_power_limit_b;
0678     __le32 srd_and_driver_power_limits;
0679     __le32 reserved;
0680 } __packed; /* STATISTICS_PHY_NTFY_API_S_VER_1 */
0681 
0682 /**
0683  * struct iwl_statistics_mac_ntfy
0684  *
0685  * @hdr: general statistics header
0686  * @bcast_filter_passed_per_mac: bcast filter passed per mac
0687  * @bcast_filter_dropped_per_mac: bcast filter dropped per mac
0688  * @bcast_filter_passed_per_filter: bcast filter passed per filter
0689  * @bcast_filter_dropped_per_filter: bcast filter dropped per filter
0690  * @reserved: reserved
0691  */
0692 struct iwl_statistics_mac_ntfy {
0693     struct iwl_statistics_ntfy_hdr hdr;
0694     __le32 bcast_filter_passed_per_mac[NUM_MAC_INDEX_CDB];
0695     __le32 bcast_filter_dropped_per_mac[NUM_MAC_INDEX_CDB];
0696     __le32 bcast_filter_passed_per_filter[MAX_BCAST_FILTER_NUM];
0697     __le32 bcast_filter_dropped_per_filter[MAX_BCAST_FILTER_NUM];
0698     __le32 reserved;
0699 } __packed; /* STATISTICS_MAC_NTFY_API_S_VER_1 */
0700 
0701 /**
0702  * struct iwl_statistics_rx_ntfy
0703  *
0704  * @hdr: general statistics header
0705  * @rx_agg_mpdu_cnt: aggregation frame count (number of
0706  *   delimiters)
0707  * @rx_agg_cnt: number of RX Aggregations
0708  * @unsupported_mcs: number of PLCP headers that have rate which
0709  *   is unsupported by DSP
0710  * @bogus_cts: CTS received when not expecting CTS
0711  * @bogus_ack: ACK received when not expecting ACK
0712  * @rx_byte_count: ???
0713  * @rx_packet_count: ???
0714  * @missed_beacons: ???
0715  * @unresponded_rts: un-responded RTS, due to NAV not zero
0716  * @rxe_frame_limit_overrun: RXE got frame limit overrun
0717  * @sent_ba_rsp_cnt: BA response TX count
0718  * @late_rx_handle: count the number of times the RX path was
0719  *   aborted due to late entry
0720  * @num_bt_kills: ???
0721  * @reserved: reserved
0722  */
0723 struct iwl_statistics_rx_ntfy {
0724     struct iwl_statistics_ntfy_hdr hdr;
0725     __le32 rx_agg_mpdu_cnt;
0726     __le32 rx_agg_cnt;
0727     __le32 unsupported_mcs;
0728     __le32 bogus_cts;
0729     __le32 bogus_ack;
0730     __le32 rx_byte_count[MAC_INDEX_AUX];
0731     __le32 rx_packet_count[MAC_INDEX_AUX];
0732     __le32 missed_beacons;
0733     __le32 unresponded_rts;
0734     __le32 rxe_frame_limit_overrun;
0735     __le32 sent_ba_rsp_cnt;
0736     __le32 late_rx_handle;
0737     __le32 num_bt_kills;
0738     __le32 reserved;
0739 } __packed; /* STATISTICS_RX_NTFY_API_S_VER_1 */
0740 
0741 /**
0742  * struct iwl_statistics_tx_ntfy
0743  *
0744  * @hdr: general statistics header
0745  * @cts_timeout: timeout when waiting for CTS
0746  * @ack_timeout: timeout when waiting for ACK
0747  * @dump_msdu_cnt: number of MSDUs that were dumped due to any
0748  *   reason
0749  * @burst_abort_missing_next_frame_cnt: number of times a burst
0750  *   was aborted due to missing next frame bytes in txfifo
0751  * number of times got timeout when waiting for CTS/ACK/BA and energy was
0752  * detected just after sending the RTS/DATA. this statistics may help getting
0753  * interesting indicators, like the likelihood of collision (so the benefit of
0754  * protection may be estimated Vs. its cost). Or how many of the failures are
0755  * due to collision and how many due to SNR.
0756  * For Link-quality the CTS collision indication is more reliable then the ACK
0757  * collision indication as the RTS frame is short and has more chance that the
0758  * frame/s which caused the collision continue after the RTS was sent.
0759  * @cts_timeout_collision: ???
0760  * ACK/BA failed and energy as detected after DATA
0761  * Note: to get the collision ratio need to:
0762  * ackOrBaTimeoutCollision / (ack_timeout + ba_timeout)
0763  * @ack_or_ba_timeout_collision: ???
0764  * @ba_timeout: timeout when waiting for immediate BA response
0765  * @ba_reschedule_frames: failed to get BA response and
0766  *   rescheduled all the non-ACKed frames
0767  * gives the avarage number of frames inside aggregation
0768  * @scd_query_agg_frame_cnt: ???
0769  * @scd_query_no_agg: scheduler query prevented aggregation
0770  * @scd_query_agg: scheduler query allowed aggregation
0771  * @scd_query_mismatch: scheduler query inaccurate, either too
0772  *   short or too long
0773  * @agg_terminated_underrun: aggregation was terminated due to
0774  *   underrun
0775  * @agg_terminated_bt_prio_kill: aggregation was terminated due
0776  *   to BT
0777  * @tx_kill_on_long_retry: count the tx frames dropped due to
0778  *   long retry limit (DATA frame failed)
0779  * @tx_kill_on_short_retry: count the tx frames dropped due to
0780  *   short retry limit (RTS frame failed)
0781  * TX deffer on energy. This counter is reset on each successful transmit.
0782  * When timer exceed TX deffer limit than will be uCode assert.
0783  * @tx_deffer_counter: ???
0784  * @tx_deffer_base_time: Keep the time of the last successful
0785  *   transmit
0786  * @tx_underrun: TX killed due to underrun
0787  * @bt_defer: TX deferred due to BT priority, so probably TX was
0788  *   not started.
0789  * @tx_kill_on_dsp_timeout: TX killed on DSP problem detected
0790  * @tx_kill_on_immediate_quiet: TX killed due to immediate quiet
0791  * @kill_ba_cnt: number of times sending BA failed
0792  * @kill_ack_cnt: number of times sending ACK failed
0793  * @kill_cts_cnt: number of times sending CTS failed
0794  * @burst_terminated: Count burst or fragmentation termination
0795  *   occurrence
0796  * @late_tx_vec_wr_cnt: ???
0797  * TX is not sent because ucode failed to notify the TRM in SIFS-delta from
0798  * ON_AIR deassertion.
0799  * @late_rx2_tx_cnt: ???
0800  * @scd_query_cnt: count the times SCD query was done to check
0801  *   for TX AGG
0802  * @tx_frames_acked_in_agg: count the number of frames
0803  *   transmitted inside AGG and were successful
0804  * @last_tx_ch_width_indx: ???
0805  * number of deferred TX per channel width, 0 - 20, 1/2/3 - 40/80/160
0806  * @rx_detected_per_ch_width: ???
0807  * @success_per_ch_width: ???
0808  * @fail_per_ch_width: ???
0809  * @reserved: reserved
0810  */
0811 struct iwl_statistics_tx_ntfy {
0812     struct iwl_statistics_ntfy_hdr hdr;
0813     __le32 cts_timeout;
0814     __le32 ack_timeout;
0815     __le32 dump_msdu_cnt;
0816     __le32 burst_abort_missing_next_frame_cnt;
0817     __le32 cts_timeout_collision;
0818     __le32 ack_or_ba_timeout_collision;
0819     __le32 ba_timeout;
0820     __le32 ba_reschedule_frames;
0821     __le32 scd_query_agg_frame_cnt;
0822     __le32 scd_query_no_agg;
0823     __le32 scd_query_agg;
0824     __le32 scd_query_mismatch;
0825     __le32 agg_terminated_underrun;
0826     __le32 agg_terminated_bt_prio_kill;
0827     __le32 tx_kill_on_long_retry;
0828     __le32 tx_kill_on_short_retry;
0829     __le32 tx_deffer_counter;
0830     __le32 tx_deffer_base_time;
0831     __le32 tx_underrun;
0832     __le32 bt_defer;
0833     __le32 tx_kill_on_dsp_timeout;
0834     __le32 tx_kill_on_immediate_quiet;
0835     __le32 kill_ba_cnt;
0836     __le32 kill_ack_cnt;
0837     __le32 kill_cts_cnt;
0838     __le32 burst_terminated;
0839     __le32 late_tx_vec_wr_cnt;
0840     __le32 late_rx2_tx_cnt;
0841     __le32 scd_query_cnt;
0842     __le32 tx_frames_acked_in_agg;
0843     __le32 last_tx_ch_width_indx;
0844     __le32 rx_detected_per_ch_width[4];
0845     __le32 success_per_ch_width[4];
0846     __le32 fail_per_ch_width[4];
0847     __le32 reserved;
0848 } __packed; /* STATISTICS_TX_NTFY_API_S_VER_1 */
0849 
0850 /**
0851  * struct iwl_statistics_duration_ntfy
0852  *
0853  * @hdr: general statistics header
0854  * @cont_burst_chk_cnt: number of times continuation or
0855  *   fragmentation or bursting was checked
0856  * @cont_burst_cnt: number of times continuation or fragmentation
0857  *   or bursting was successful
0858  * @wait_for_silence_timeout_cnt: ???
0859  * @reserved: reserved
0860  */
0861 struct iwl_statistics_duration_ntfy {
0862     struct iwl_statistics_ntfy_hdr hdr;
0863     __le32 cont_burst_chk_cnt;
0864     __le32 cont_burst_cnt;
0865     __le32 wait_for_silence_timeout_cnt;
0866     __le32 reserved;
0867 } __packed; /* STATISTICS_DURATION_NTFY_API_S_VER_1 */
0868 
0869 /**
0870  * struct iwl_statistics_he_ntfy
0871  *
0872  * @hdr: general statistics header
0873  * received HE frames
0874  * @rx_siga_valid_cnt: rx HE SIG-A valid
0875  * @rx_siga_invalid_cnt: rx HE SIG-A invalid
0876  * received HE frames w/ valid Sig-A
0877  * @rx_trig_based_frame_cnt: rx HE-TB (trig-based)
0878  * @rx_su_frame_cnt: rx HE-SU
0879  * @rx_sigb_invalid_cnt: rx (suspected) HE-MU w/ bad SIG-B
0880  * @rx_our_bss_color_cnt: rx valid HE SIG-A w/ our BSS color
0881  * @rx_other_bss_color_cnt: rx valid HE SIG-A w/ other BSS color
0882  * @rx_zero_bss_color_cnt: ???
0883  * received HE-MU frames w/ good Sig-B
0884  * @rx_mu_for_us_cnt: match AID
0885  * @rx_mu_not_for_us_cnt: no matched AID
0886  * received HE-MU frames for us (w/ our AID)
0887  * @rx_mu_nss_ar: 0 - SISO, 1 - MIMO2
0888  * @rx_mu_mimo_cnt: full BW RU, compressed SIG-B
0889  * @rx_mu_ru_bw_ar: MU alloc, MHz: 0 - 2, 1 - 5, 2 - 10, 3 - 20,
0890  *   4 - 40, 5 - 80, 6 - 160
0891  * received trigger frames
0892  * @rx_trig_for_us_cnt: ???
0893  * @rx_trig_not_for_us_cnt: ???
0894  * trigger for us
0895  * @rx_trig_with_cs_req_cnt: ???
0896  * @rx_trig_type_ar: ???
0897  * @rx_trig_in_agg_cnt: ???
0898  * basic trigger for us allocations
0899  * @rx_basic_trig_alloc_nss_ar: ???
0900  * @rx_basic_trig_alloc_mu_mimo_cnt: ???
0901  * @rx_basic_trig_alloc_ru_bw_ar: ???
0902  * @rx_basic_trig_total_byte_cnt: ???
0903  * trig-based TX
0904  * @tx_trig_based_cs_req_fail_cnt: ???
0905  * @tx_trig_based_sifs_ok_cnt: ???
0906  * @tx_trig_based_sifs_fail_cnt: ???
0907  * @tx_trig_based_byte_cnt: ???
0908  * @tx_trig_based_pad_byte_cnt: ???
0909  * @tx_trig_based_frame_cnt: ???
0910  * @tx_trig_based_acked_frame_cnt: ???
0911  * @tx_trig_based_ack_timeout_cnt: ???
0912  * HE-SU TX
0913  * @tx_su_frame_cnt: ???
0914  * EDCA <--> MU-EDCA transitions
0915  * @tx_edca_to_mu_edca_cnt: ???
0916  * @tx_mu_edca_to_edca_by_timeout_cnt: ???
0917  * @tx_mu_edca_to_edca_by_ack_fail_cnt: ???
0918  * @tx_mu_edca_to_edca_by_small_alloc_cnt: ???
0919  * @reserved: reserved
0920  */
0921 struct iwl_statistics_he_ntfy {
0922     struct iwl_statistics_ntfy_hdr hdr;
0923     __le32 rx_siga_valid_cnt;
0924     __le32 rx_siga_invalid_cnt;
0925     __le32 rx_trig_based_frame_cnt;
0926     __le32 rx_su_frame_cnt;
0927     __le32 rx_sigb_invalid_cnt;
0928     __le32 rx_our_bss_color_cnt;
0929     __le32 rx_other_bss_color_cnt;
0930     __le32 rx_zero_bss_color_cnt;
0931     __le32 rx_mu_for_us_cnt;
0932     __le32 rx_mu_not_for_us_cnt;
0933     __le32 rx_mu_nss_ar[2];
0934     __le32 rx_mu_mimo_cnt;
0935     __le32 rx_mu_ru_bw_ar[7];
0936     __le32 rx_trig_for_us_cnt;
0937     __le32 rx_trig_not_for_us_cnt;
0938     __le32 rx_trig_with_cs_req_cnt;
0939     __le32 rx_trig_type_ar[8 + 1];
0940     __le32 rx_trig_in_agg_cnt;
0941     __le32 rx_basic_trig_alloc_nss_ar[2];
0942     __le32 rx_basic_trig_alloc_mu_mimo_cnt;
0943     __le32 rx_basic_trig_alloc_ru_bw_ar[7];
0944     __le32 rx_basic_trig_total_byte_cnt;
0945     __le32 tx_trig_based_cs_req_fail_cnt;
0946     __le32 tx_trig_based_sifs_ok_cnt;
0947     __le32 tx_trig_based_sifs_fail_cnt;
0948     __le32 tx_trig_based_byte_cnt;
0949     __le32 tx_trig_based_pad_byte_cnt;
0950     __le32 tx_trig_based_frame_cnt;
0951     __le32 tx_trig_based_acked_frame_cnt;
0952     __le32 tx_trig_based_ack_timeout_cnt;
0953     __le32 tx_su_frame_cnt;
0954     __le32 tx_edca_to_mu_edca_cnt;
0955     __le32 tx_mu_edca_to_edca_by_timeout_cnt;
0956     __le32 tx_mu_edca_to_edca_by_ack_fail_cnt;
0957     __le32 tx_mu_edca_to_edca_by_small_alloc_cnt;
0958     __le32 reserved;
0959 } __packed; /* STATISTICS_HE_NTFY_API_S_VER_1 */
0960 
0961 #endif /* __iwl_fw_api_stats_h__ */