1
1
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2
2
/*
3
- * Copyright (C) 2012-2014, 2018, 2020 - 2021 Intel Corporation
3
+ * Copyright (C) 2012-2014, 2018, 2020 - 2021, 2023 Intel Corporation
4
4
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5
5
* Copyright (C) 2016-2017 Intel Deutschland GmbH
6
6
*/
7
7
#ifndef __iwl_fw_api_stats_h__
8
8
#define __iwl_fw_api_stats_h__
9
9
#include "mac.h"
10
+ #include "mac-cfg.h"
10
11
11
12
struct mvm_statistics_dbg {
12
13
__le32 burst_check ;
@@ -411,6 +412,49 @@ struct iwl_statistics_cmd {
411
412
412
413
#define MAX_BCAST_FILTER_NUM 8
413
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
+ */
424
+ enum 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
+ */
440
+ enum 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
+ */
452
+ struct 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
+
414
458
/**
415
459
* enum iwl_fw_statistics_type
416
460
*
@@ -447,7 +491,49 @@ struct iwl_statistics_ntfy_hdr {
447
491
}; /* STATISTICS_NTFY_HDR_API_S_VER_1 */
448
492
449
493
/**
450
- * struct iwl_statistics_ntfy_per_mac
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
+ */
506
+ struct 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
+ */
526
+ struct 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
451
537
*
452
538
* @beacon_filter_average_energy: Average energy [-dBm] of the 2
453
539
* antennas.
@@ -459,7 +545,7 @@ struct iwl_statistics_ntfy_hdr {
459
545
* @beacon_rssi_b: beacon RSSI on antenna B
460
546
* @rx_bytes: RX byte count
461
547
*/
462
- struct iwl_statistics_ntfy_per_mac {
548
+ struct iwl_stats_ntfy_per_mac {
463
549
__le32 beacon_filter_average_energy ;
464
550
__le32 air_time ;
465
551
__le32 beacon_counter ;
@@ -470,7 +556,7 @@ struct iwl_statistics_ntfy_per_mac {
470
556
} __packed ; /* STATISTICS_NTFY_PER_MAC_API_S_VER_1 */
471
557
472
558
#define IWL_STATS_MAX_BW_INDEX 5
473
- /** struct iwl_statistics_ntfy_per_phy
559
+ /** struct iwl_stats_ntfy_per_phy
474
560
* @channel_load: channel load
475
561
* @channel_load_by_us: device contribution to MCLM
476
562
* @channel_load_not_by_us: other devices' contribution to MCLM
@@ -485,7 +571,7 @@ struct iwl_statistics_ntfy_per_mac {
485
571
* per channel BW. note BACK counted as 1
486
572
* @last_tx_ch_width_indx: last txed frame channel width index
487
573
*/
488
- struct iwl_statistics_ntfy_per_phy {
574
+ struct iwl_stats_ntfy_per_phy {
489
575
__le32 channel_load ;
490
576
__le32 channel_load_by_us ;
491
577
__le32 channel_load_not_by_us ;
@@ -499,23 +585,62 @@ struct iwl_statistics_ntfy_per_phy {
499
585
} __packed ; /* STATISTICS_NTFY_PER_PHY_API_S_VER_1 */
500
586
501
587
/**
502
- * struct iwl_statistics_ntfy_per_sta
588
+ * struct iwl_stats_ntfy_per_sta
503
589
*
504
590
* @average_energy: in fact it is minus the energy..
505
591
*/
506
- struct iwl_statistics_ntfy_per_sta {
592
+ struct iwl_stats_ntfy_per_sta {
507
593
__le32 average_energy ;
508
594
} __packed ; /* STATISTICS_NTFY_PER_STA_API_S_VER_1 */
509
595
510
- #define IWL_STATS_MAX_PHY_OPERTINAL 3
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
+ */
607
+ struct 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
+ */
621
+ struct 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
+ */
632
+ struct iwl_system_statistics_end_notif {
633
+ __le32 time_stamp ;
634
+ } __packed ; /* STATISTICS_FW_NTFY_END_API_S_VER_1 */
635
+
511
636
/**
512
637
* struct iwl_statistics_operational_ntfy
513
638
*
514
639
* @hdr: general statistics header
515
640
* @flags: bitmap of possible notification structures
516
- * @per_mac_stats : per mac statistics, &struct iwl_statistics_ntfy_per_mac
517
- * @per_phy_stats : per phy statistics, &struct iwl_statistics_ntfy_per_phy
518
- * @per_sta_stats : per sta statistics, &struct iwl_statistics_ntfy_per_sta
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
519
644
* @rx_time: rx time
520
645
* @tx_time: usec the radio is transmitting.
521
646
* @on_time_rf: The total time in usec the RF is awake.
@@ -524,9 +649,9 @@ struct iwl_statistics_ntfy_per_sta {
524
649
struct iwl_statistics_operational_ntfy {
525
650
struct iwl_statistics_ntfy_hdr hdr ;
526
651
__le32 flags ;
527
- struct iwl_statistics_ntfy_per_mac per_mac_stats [MAC_INDEX_AUX ];
528
- struct iwl_statistics_ntfy_per_phy per_phy_stats [ IWL_STATS_MAX_PHY_OPERTINAL ];
529
- struct iwl_statistics_ntfy_per_sta per_sta_stats [IWL_MVM_STATION_COUNT_MAX ];
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 ];
530
655
__le64 rx_time ;
531
656
__le64 tx_time ;
532
657
__le64 on_time_rf ;
0 commit comments