Loading fw/htt.h +119 −2 Original line number Diff line number Diff line /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Loading Loading @@ -174,9 +174,10 @@ * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def */ #define HTT_CURRENT_VERSION_MAJOR 3 #define HTT_CURRENT_VERSION_MINOR 59 #define HTT_CURRENT_VERSION_MINOR 60 #define HTT_NUM_TX_FRAG_DESC 1024 Loading Loading @@ -5603,6 +5604,7 @@ enum htt_t2h_msg_type { HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20, HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21, HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22, HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23, HTT_T2H_MSG_TYPE_TEST, /* keep this last */ Loading Loading @@ -10331,6 +10333,27 @@ enum htt_dbg_ext_stats_status { (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \ HTT_T2H_PPDU_STATS_PPDU_ID_S) /* htt_t2h_ppdu_stats_ind_hdr_t * This struct contains the fields within the header of the * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific * stats info. * This struct assumes little-endian layout, and thus is only * suitable for use within processors known to be little-endian * (such as the target). * In contrast, the above macros provide endian-portable methods * to get and set the bitfields within this PPDU_STATS_IND header. */ typedef struct { A_UINT32 msg_type: 8, /* bits 7:0 */ mac_id: 2, /* bits 9:8 */ pdev_id: 2, /* bits 11:10 */ reserved1: 4, /* bits 15:12 */ payload_size: 16; /* bits 31:16 */ A_UINT32 ppdu_id; A_UINT32 timestamp_us; A_UINT32 reserved2; } htt_t2h_ppdu_stats_ind_hdr_t; /** * @brief target -> host extended statistics upload * Loading Loading @@ -11144,4 +11167,98 @@ PREPACK struct htt_cfr_dump_compl_ind { (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \ HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S) /** * @brief target -> host peer (PPDU) stats message * HTT_T2H_MSG_TYPE_PEER_STATS_IND * @details * This message is generated by FW when FW is sending stats to host * about one or more PPDUs that the FW has transmitted to one or more peers. * This message is sent autonomously by the target rather than upon request * by the host. * The following field definitions describe the format of the HTT target * to host peer stats indication message. * * The HTT_T2H PPDU_STATS_IND message has a header followed by one * or more PPDU stats records. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV. * If the details of N PPDUS are sent in one PEER_STATS_IND message, * then the message would start with the * header, followed by N htt_tx_ppdu_stats_info structures, as depicted * below. * * |31 16|15|14|13 11|10 9|8|7 0| * |-------------------------------------------------------------| * | reserved |MSG_TYPE | * |-------------------------------------------------------------| * rec 0 | TLV header | * rec 0 |-------------------------------------------------------------| * rec 0 | ppdu successful bytes | * rec 0 |-------------------------------------------------------------| * rec 0 | ppdu retry bytes | * rec 0 |-------------------------------------------------------------| * rec 0 | ppdu failed bytes | * rec 0 |-------------------------------------------------------------| * rec 0 | peer id | S|SG| BW | BA |A|rate code| * rec 0 |-------------------------------------------------------------| * rec 0 | retried MSDUs | successful MSDUs | * rec 0 |-------------------------------------------------------------| * rec 0 | TX duration | failed MSDUs | * rec 0 |-------------------------------------------------------------| * ... * |-------------------------------------------------------------| * rec N | TLV header | * rec N |-------------------------------------------------------------| * rec N | ppdu successful bytes | * rec N |-------------------------------------------------------------| * rec N | ppdu retry bytes | * rec N |-------------------------------------------------------------| * rec N | ppdu failed bytes | * rec N |-------------------------------------------------------------| * rec N | peer id | S|SG| BW | BA |A|rate code| * rec N |-------------------------------------------------------------| * rec N | retried MSDUs | successful MSDUs | * rec N |-------------------------------------------------------------| * rec N | TX duration | failed MSDUs | * rec N |-------------------------------------------------------------| * * where: * A = is A-MPDU flag * BA = block-ack failure flags * BW = bandwidth spec * SG = SGI enabled spec * S = skipped rate ctrl * One htt_tx_ppdu_stats_info instance will have stats for one PPDU * * Header * ------ * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND * dword0 - b'8:31 - reserved : Reserved for future use * * payload include below peer_stats information * -------------------------------------------- * @TLV : HTT_PPDU_STATS_INFO_TLV * @tx_success_bytes : total successful bytes in the PPDU. * @tx_retry_bytes : total retried bytes in the PPDU. * @tx_failed_bytes : total failed bytes in the PPDU. * @tx_ratecode : rate code used for the PPDU. * @is_ampdu : Indicates PPDU is AMPDU or not. * @ba_ack_failed : BA/ACK failed for this PPDU * b00 -> BA received * b01 -> BA failed once * b10 -> BA failed twice, when HW retry is enabled. * @bw : BW * b00 -> 20 MHz * b01 -> 40 MHz * b10 -> 80 MHz * b11 -> 160 MHz (or 80+80) * @sg : SGI enabled * @s : skipped ratectrl * @peer_id : peer id * @tx_success_msdus : successful MSDUs * @tx_retry_msdus : retried MSDUs * @tx_failed_msdus : MSDUs dropped in FW after max retry * @tx_duration : Tx duration for the PPDU (microsecond units) */ #endif fw/htt_ppdu_stats.h +123 −10 Original line number Diff line number Diff line /* * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -114,6 +114,19 @@ typedef enum htt_ppdu_stats_tlv_tag htt_ppdu_stats_tlv_tag_t; ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)); \ } while (0) #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M 0x00008000 #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S 15 #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_GET(_var) \ (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M) >> \ HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S) #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_SET(_var, _val) \ do { \ HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR, _val); \ ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)); \ } while (0) #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M 0xffff0000 #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S 16 Loading Loading @@ -193,13 +206,23 @@ PREPACK struct htt_tx_ppdu_stats_info { 3: 160 MHz or 80+80 MHz */ bw: 3, sgi: 1, reserved0: 1, skipped_rate_ctrl: 1, peer_id: 16; A_UINT32 tx_success_msdus: 16, tx_retry_msdus: 16; A_UINT32 tx_failed_msdus: 16, /* united in us */ tx_duration: 16; /* * 1 in bit 0 of valid_bitmap represents that bitmap itself is valid. * If the bitmap is valid (i.e. bit 0 is set), then check the other bits * of bitmap to know which fields within htt_tx_ppdu_stats_info are valid. * If bit 1 is set, tx_success_bytes is valid * If bit 2 is set, tx_retry_bytes is valid * ... * If bit 14 is set, tx_duration is valid */ A_UINT32 valid_bitmap; } POSTPACK; typedef struct { Loading @@ -211,15 +234,39 @@ typedef struct { * tx_ppdu_stats_info is variable length, with length = * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info) */ A_UINT32 tx_ppdu_stats_info[1/*number_of_ppdu_stats*/]; struct htt_tx_ppdu_stats_info tx_ppdu_stats_info[1/*number_of_ppdu_stats*/]; } htt_ppdu_stats_usr_common_array_tlv_v; typedef struct { htt_tlv_hdr_t tlv_hdr; #define HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT \ struct { \ htt_tlv_hdr_t tlv_hdr; \ /* Refer bmi_msg.h */ \ A_UINT32 target_type; \ } /* Refer bmi_msg.h */ A_UINT32 target_type; A_UINT32 hw[1]; /* Variable length, refer to struct scheduler_cmd_status */ typedef HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT htt_ppdu_stats_sch_cmd_tlv_hdr_t; typedef struct { /* * Use a union to allow the HW-independent header portion of this struct * to be accessed either within a hdr struct, or directly within the * htt_ppdu_stats_sch_cmd_tlv_v struct. * For example, the target_type field can be accessed either as * htt_ppdu_stats_sch_cmd_tlv_v.target_type * or * htt_ppdu_stats_sch_cmd_tlv_v.hdr.target_type */ union { htt_ppdu_stats_sch_cmd_tlv_hdr_t hdr; HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT; }; /* * The hw portion of this struct contains a scheduler_command_status * struct, whose definition is different for different target HW types. * The target_type field within the header can, if set correctly, * clarify which definition of scheduler_command_status is being used. */ A_UINT32 hw[1]; } htt_ppdu_stats_sch_cmd_tlv_v; #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M 0x0000ffff Loading Loading @@ -345,6 +392,33 @@ enum HTT_PPDU_STATS_BW { }; typedef enum HTT_PPDU_STATS_BW HTT_PPDU_STATS_BW; enum HTT_PPDU_STATS_SEQ_TYPE { HTT_SEQTYPE_UNSPECIFIED = 0, HTT_SEQTYPE_SU = 1, HTT_SEQTYPE_AC_MU_MIMO = 2, HTT_SEQTYPE_AX_MU_MIMO = 3, HTT_SEQTYPE_MU_OFDMA = 4, HTT_SEQTYPE_UL_TRIG = 5, HTT_SEQTYPE_BURST_BCN = 6, HTT_SEQTYPE_UL_BSR_RESP = 7, HTT_SEQTYPE_UL_BSR_TRIG = 8, HTT_SEQTYPE_UL_RESP = 9, }; typedef enum HTT_PPDU_STATS_SEQ_TYPE HTT_PPDU_STATS_SEQ_TYPE; #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M 0x00ff0000 #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S 16 #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_GET(_var) \ (((_var) & HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M) >> \ HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S) #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_SET(_var, _val) \ do { \ HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE, _val); \ ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)); \ } while (0) #define HTT_PPDU_STATS_COMMON_TLV_BW_M 0x000f0000 #define HTT_PPDU_STATS_COMMON_TLV_BW_S 16 Loading Loading @@ -403,15 +477,18 @@ typedef struct { /* BIT [ 7 : 0] :- frame_type - HTT_STATS_FTYPE * BIT [ 15: 8] :- queue_type - HTT_TX_QUEUE_TYPE * BIT [ 19: 16] :- bw - HTT_PPDU_STATS_BW * BIT [ 31: 20] :- reserved * BIT [ 27: 20] :- ppdu_seq_type - HTT_PPDU_STATS_SEQ_TYPE * BIT [ 31: 28] :- reserved */ union { A_UINT32 bw__queue_type__frame_type; A_UINT32 ppdu_seq_type__bw__queue_type__frame_type; struct { A_UINT32 frame_type: 8, queue_type: 8, bw: 4, reserved0: 12; ppdu_seq_type: 8, reserved0: 4; }; }; A_UINT32 chain_mask; Loading @@ -429,6 +506,42 @@ typedef struct { chan_mhz: 16; }; }; /* * The cca_delta_time_us reports the time the tx PPDU in question * was waiting in the HW tx queue for the clear channel assessment * to indicate that the transmission could start. * If this CCA delta time is zero or small, this indicates that the * air interface was unused prior to the transmission, and thus it's * improbable that there was a collision with some other transceiver's * transmission. * In contrast, a large CCA delta time means that this transceiver had * to wait a long time for the air interface to be available; it's * possible that other transceivers were also waiting for the air * interface to become available, and if the other waiting transceiver's * CW backoff aligned with this one, to have a transmit collision. */ A_UINT32 cca_delta_time_us; /* * The rxfrm_delta_time_us reports the time the tx PPDU in question * was waiting in the HW tx queue while there was an ongoing rx, * either because the rx was already ongoing at the time the tx PPDU * was enqueued, or because the rx (i.e. the peer's tx) won the air * interface contention over the local vdev's tx. */ A_UINT32 rxfrm_delta_time_us; /* * The txfrm_delta_time_us reports the time from when the tx PPDU * in question was enqueued into the HW tx queue until the time the * tx completion interrupt for the PPDU occurred. * Thus, the txfrm_delta_time_us incorporates any time the tx PPDU * had to wait for the air interface to become available, the PPDU * duration, the block ack reception, and the tx completion interrupt * latency. */ A_UINT32 txfrm_delta_time_us; } htt_ppdu_stats_common_tlv; #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M 0x000000ff Loading fw/htt_stats.h +41 −7 Original line number Diff line number Diff line /* * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -393,11 +393,25 @@ typedef enum { } while (0) typedef struct { union { /* BIT [11 : 0] :- tag * BIT [23 : 12] :- length * BIT [31 : 24] :- reserved */ A_UINT32 tag__length; /* * The following struct is not endian-portable. * It is suitable for use within the target, which is known to be * little-endian. * The host should use the above endian-portable macros to access * the tag and length bitfields in an endian-neutral manner. */ struct { A_UINT32 tag: 12, /* BIT [11 : 0] */ length: 12, /* BIT [23 : 12] */ reserved: 8; /* BIT [31 : 24] */ }; }; } htt_tlv_hdr_t; #define HTT_STATS_MAX_STRING_SZ32 4 Loading Loading @@ -1120,6 +1134,16 @@ typedef struct _htt_rx_peer_rate_stats_tlv { A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */ A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */ A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */ A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS];/* dBm unit */ /* per_chain_rssi_pkt_type: * This field shows what type of rx frame the per-chain RSSI was computed * on, by recording the frame type and sub-type as bit-fields within this * field: * BIT [3 : 0] :- IEEE80211_FC0_TYPE * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE * BIT [31 : 8] :- Reserved */ A_UINT32 per_chain_rssi_pkt_type; } htt_rx_peer_rate_stats_tlv; typedef enum { Loading Loading @@ -2944,6 +2968,16 @@ typedef struct { * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB) */ A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* dBm units */ /* per_chain_rssi_pkt_type: * This field shows what type of rx frame the per-chain RSSI was computed * on, by recording the frame type and sub-type as bit-fields within this * field: * BIT [3 : 0] :- IEEE80211_FC0_TYPE * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE * BIT [31 : 8] :- Reserved */ A_UINT32 per_chain_rssi_pkt_type; } htt_rx_pdev_rate_stats_tlv; Loading fw/targaddrs.h +10 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,16 @@ PREPACK64 struct host_interest_s { #define HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_HOST 0x400 /* HOST to support using BMI dump FW memory when hit assert */ #define HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_FW 0x800 /* FW to support using BMI dump FW memory when hit assert */ /* USB_RESET_RESUME * The host will set this flag, based on platform configuration specs. * The target will check this flag at the time USB becomes suspended. * If the flag is set, the target will invoke its reset / resume code. * If the flag is not set, the target will do nothing, other than wait. */ #define HI_OPTION_USB_RESET_RESUME 0x1000 #define USB_RESET_RESUME() \ (HOST_INTEREST->hi_option_flag2 & HI_OPTION_USB_RESET_RESUME) #define GPIO_WAKEUP_ENABLED() \ (HOST_INTEREST->hi_option_flag2 & HT_OPTION_GPIO_WAKEUP_SUPPORT) Loading fw/wlan_defs.h +49 −7 Original line number Diff line number Diff line /* * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved.* * Copyright (c) 2013-2016, 2018-2019 The Linux Foundation. All rights reserved.* * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Loading Loading @@ -206,6 +206,7 @@ typedef enum { ((mode) == MODE_11AC_VHT80)) #endif #if SUPPORT_11AX #define IS_MODE_HE(mode) (((mode) == MODE_11AX_HE20) || \ ((mode) == MODE_11AX_HE40) || \ ((mode) == MODE_11AX_HE80) || \ Loading @@ -214,6 +215,10 @@ typedef enum { ((mode) == MODE_11AX_HE20_2G) || \ ((mode) == MODE_11AX_HE40_2G) || \ ((mode) == MODE_11AX_HE80_2G)) #define IS_MODE_HE_2G(mode) (((mode) == MODE_11AX_HE20_2G) || \ ((mode) == MODE_11AX_HE40_2G) || \ ((mode) == MODE_11AX_HE80_2G)) #endif /* SUPPORT_11AX */ #define IS_MODE_VHT_2G(mode) (((mode) == MODE_11AC_VHT20_2G) || \ ((mode) == MODE_11AC_VHT40_2G) || \ Loading @@ -235,6 +240,40 @@ typedef enum { ((mode) == MODE_11NG_HT40)) #define IS_MODE_11GONLY(mode) ((mode) == MODE_11GONLY) #define IS_MODE_LEGACY(phymode) ((phymode == MODE_11A) || \ (phymode == MODE_11G) || \ (phymode == MODE_11B) || \ (phymode == MODE_11GONLY)) #define IS_MODE_11N(phymode) ((phymode >= MODE_11NA_HT20) && \ (phymode <= MODE_11NG_HT40)) #ifdef CONFIG_160MHZ_SUPPORT #define IS_MODE_11AC(phymode) ((phymode >= MODE_11AC_VHT20) && \ (phymode <= MODE_11AC_VHT160)) #else #define IS_MODE_11AC(phymode) ((phymode >= MODE_11AC_VHT20) && \ (phymode <= MODE_11AC_VHT80_2G)) #endif /* CONFIG_160MHZ_SUPPORT */ #if SUPPORT_11AX #define IS_MODE_80MHZ(phymode) ((phymode == MODE_11AC_VHT80_2G) || \ (phymode == MODE_11AC_VHT80) || \ (phymode == MODE_11AX_HE80) || \ (phymode == MODE_11AX_HE80_2G)) #define IS_MODE_40MHZ(phymode) ((phymode == MODE_11AC_VHT40_2G) || \ (phymode == MODE_11AC_VHT40) || \ (phymode == MODE_11NG_HT40) || \ (phymode == MODE_11NA_HT40) || \ (phymode == MODE_11AX_HE40) || \ (phymode == MODE_11AX_HE40_2G)) #else #define IS_MODE_80MHZ(phymode) ((phymode == MODE_11AC_VHT80_2G) || \ (phymode == MODE_11AC_VHT80)) #define IS_MODE_40MHZ(phymode) ((phymode == MODE_11AC_VHT40_2G) || \ (phymode == MODE_11AC_VHT40) || \ (phymode == MODE_11NG_HT40) || \ (phymode == MODE_11NA_HT40)) #endif /* SUPPORT_11AX */ enum { REGDMN_MODE_11A = 0x00000001, /* 11a channels */ Loading Loading @@ -318,12 +357,13 @@ typedef struct { * In host-based implementation of the rate-control feature, this struture is used to * create the payload for HTT message/s from target to host. */ #ifndef CONFIG_MOVE_RC_STRUCT_TO_MACCORE #if (NUM_SPATIAL_STREAM > 3) #define A_RATEMASK A_UINT64 #else #define A_RATEMASK A_UINT32 #endif #endif /* CONFIG_MOVE_RC_STRUCT_TO_MACCORE */ typedef A_UINT8 A_RATE; typedef A_UINT8 A_RATECODE; Loading Loading @@ -425,6 +465,7 @@ typedef struct { * because the host should have no references to these target-only data * structures. */ #ifndef CONFIG_MOVE_RC_STRUCT_TO_MACCORE #if !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) #if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B) typedef struct{ Loading Loading @@ -494,6 +535,7 @@ typedef struct { A_UINT8 dd_profile; } RC_TX_RATE_INFO; #endif /* !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) */ #endif /* CONFIG_MOVE_RC_STRUCT_TO_MACCORE */ #endif /* Loading Loading
fw/htt.h +119 −2 Original line number Diff line number Diff line /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Loading Loading @@ -174,9 +174,10 @@ * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def */ #define HTT_CURRENT_VERSION_MAJOR 3 #define HTT_CURRENT_VERSION_MINOR 59 #define HTT_CURRENT_VERSION_MINOR 60 #define HTT_NUM_TX_FRAG_DESC 1024 Loading Loading @@ -5603,6 +5604,7 @@ enum htt_t2h_msg_type { HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20, HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21, HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22, HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23, HTT_T2H_MSG_TYPE_TEST, /* keep this last */ Loading Loading @@ -10331,6 +10333,27 @@ enum htt_dbg_ext_stats_status { (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \ HTT_T2H_PPDU_STATS_PPDU_ID_S) /* htt_t2h_ppdu_stats_ind_hdr_t * This struct contains the fields within the header of the * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific * stats info. * This struct assumes little-endian layout, and thus is only * suitable for use within processors known to be little-endian * (such as the target). * In contrast, the above macros provide endian-portable methods * to get and set the bitfields within this PPDU_STATS_IND header. */ typedef struct { A_UINT32 msg_type: 8, /* bits 7:0 */ mac_id: 2, /* bits 9:8 */ pdev_id: 2, /* bits 11:10 */ reserved1: 4, /* bits 15:12 */ payload_size: 16; /* bits 31:16 */ A_UINT32 ppdu_id; A_UINT32 timestamp_us; A_UINT32 reserved2; } htt_t2h_ppdu_stats_ind_hdr_t; /** * @brief target -> host extended statistics upload * Loading Loading @@ -11144,4 +11167,98 @@ PREPACK struct htt_cfr_dump_compl_ind { (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \ HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S) /** * @brief target -> host peer (PPDU) stats message * HTT_T2H_MSG_TYPE_PEER_STATS_IND * @details * This message is generated by FW when FW is sending stats to host * about one or more PPDUs that the FW has transmitted to one or more peers. * This message is sent autonomously by the target rather than upon request * by the host. * The following field definitions describe the format of the HTT target * to host peer stats indication message. * * The HTT_T2H PPDU_STATS_IND message has a header followed by one * or more PPDU stats records. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV. * If the details of N PPDUS are sent in one PEER_STATS_IND message, * then the message would start with the * header, followed by N htt_tx_ppdu_stats_info structures, as depicted * below. * * |31 16|15|14|13 11|10 9|8|7 0| * |-------------------------------------------------------------| * | reserved |MSG_TYPE | * |-------------------------------------------------------------| * rec 0 | TLV header | * rec 0 |-------------------------------------------------------------| * rec 0 | ppdu successful bytes | * rec 0 |-------------------------------------------------------------| * rec 0 | ppdu retry bytes | * rec 0 |-------------------------------------------------------------| * rec 0 | ppdu failed bytes | * rec 0 |-------------------------------------------------------------| * rec 0 | peer id | S|SG| BW | BA |A|rate code| * rec 0 |-------------------------------------------------------------| * rec 0 | retried MSDUs | successful MSDUs | * rec 0 |-------------------------------------------------------------| * rec 0 | TX duration | failed MSDUs | * rec 0 |-------------------------------------------------------------| * ... * |-------------------------------------------------------------| * rec N | TLV header | * rec N |-------------------------------------------------------------| * rec N | ppdu successful bytes | * rec N |-------------------------------------------------------------| * rec N | ppdu retry bytes | * rec N |-------------------------------------------------------------| * rec N | ppdu failed bytes | * rec N |-------------------------------------------------------------| * rec N | peer id | S|SG| BW | BA |A|rate code| * rec N |-------------------------------------------------------------| * rec N | retried MSDUs | successful MSDUs | * rec N |-------------------------------------------------------------| * rec N | TX duration | failed MSDUs | * rec N |-------------------------------------------------------------| * * where: * A = is A-MPDU flag * BA = block-ack failure flags * BW = bandwidth spec * SG = SGI enabled spec * S = skipped rate ctrl * One htt_tx_ppdu_stats_info instance will have stats for one PPDU * * Header * ------ * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND * dword0 - b'8:31 - reserved : Reserved for future use * * payload include below peer_stats information * -------------------------------------------- * @TLV : HTT_PPDU_STATS_INFO_TLV * @tx_success_bytes : total successful bytes in the PPDU. * @tx_retry_bytes : total retried bytes in the PPDU. * @tx_failed_bytes : total failed bytes in the PPDU. * @tx_ratecode : rate code used for the PPDU. * @is_ampdu : Indicates PPDU is AMPDU or not. * @ba_ack_failed : BA/ACK failed for this PPDU * b00 -> BA received * b01 -> BA failed once * b10 -> BA failed twice, when HW retry is enabled. * @bw : BW * b00 -> 20 MHz * b01 -> 40 MHz * b10 -> 80 MHz * b11 -> 160 MHz (or 80+80) * @sg : SGI enabled * @s : skipped ratectrl * @peer_id : peer id * @tx_success_msdus : successful MSDUs * @tx_retry_msdus : retried MSDUs * @tx_failed_msdus : MSDUs dropped in FW after max retry * @tx_duration : Tx duration for the PPDU (microsecond units) */ #endif
fw/htt_ppdu_stats.h +123 −10 Original line number Diff line number Diff line /* * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -114,6 +114,19 @@ typedef enum htt_ppdu_stats_tlv_tag htt_ppdu_stats_tlv_tag_t; ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)); \ } while (0) #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M 0x00008000 #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S 15 #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_GET(_var) \ (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M) >> \ HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S) #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_SET(_var, _val) \ do { \ HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR, _val); \ ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)); \ } while (0) #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M 0xffff0000 #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S 16 Loading Loading @@ -193,13 +206,23 @@ PREPACK struct htt_tx_ppdu_stats_info { 3: 160 MHz or 80+80 MHz */ bw: 3, sgi: 1, reserved0: 1, skipped_rate_ctrl: 1, peer_id: 16; A_UINT32 tx_success_msdus: 16, tx_retry_msdus: 16; A_UINT32 tx_failed_msdus: 16, /* united in us */ tx_duration: 16; /* * 1 in bit 0 of valid_bitmap represents that bitmap itself is valid. * If the bitmap is valid (i.e. bit 0 is set), then check the other bits * of bitmap to know which fields within htt_tx_ppdu_stats_info are valid. * If bit 1 is set, tx_success_bytes is valid * If bit 2 is set, tx_retry_bytes is valid * ... * If bit 14 is set, tx_duration is valid */ A_UINT32 valid_bitmap; } POSTPACK; typedef struct { Loading @@ -211,15 +234,39 @@ typedef struct { * tx_ppdu_stats_info is variable length, with length = * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info) */ A_UINT32 tx_ppdu_stats_info[1/*number_of_ppdu_stats*/]; struct htt_tx_ppdu_stats_info tx_ppdu_stats_info[1/*number_of_ppdu_stats*/]; } htt_ppdu_stats_usr_common_array_tlv_v; typedef struct { htt_tlv_hdr_t tlv_hdr; #define HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT \ struct { \ htt_tlv_hdr_t tlv_hdr; \ /* Refer bmi_msg.h */ \ A_UINT32 target_type; \ } /* Refer bmi_msg.h */ A_UINT32 target_type; A_UINT32 hw[1]; /* Variable length, refer to struct scheduler_cmd_status */ typedef HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT htt_ppdu_stats_sch_cmd_tlv_hdr_t; typedef struct { /* * Use a union to allow the HW-independent header portion of this struct * to be accessed either within a hdr struct, or directly within the * htt_ppdu_stats_sch_cmd_tlv_v struct. * For example, the target_type field can be accessed either as * htt_ppdu_stats_sch_cmd_tlv_v.target_type * or * htt_ppdu_stats_sch_cmd_tlv_v.hdr.target_type */ union { htt_ppdu_stats_sch_cmd_tlv_hdr_t hdr; HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT; }; /* * The hw portion of this struct contains a scheduler_command_status * struct, whose definition is different for different target HW types. * The target_type field within the header can, if set correctly, * clarify which definition of scheduler_command_status is being used. */ A_UINT32 hw[1]; } htt_ppdu_stats_sch_cmd_tlv_v; #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M 0x0000ffff Loading Loading @@ -345,6 +392,33 @@ enum HTT_PPDU_STATS_BW { }; typedef enum HTT_PPDU_STATS_BW HTT_PPDU_STATS_BW; enum HTT_PPDU_STATS_SEQ_TYPE { HTT_SEQTYPE_UNSPECIFIED = 0, HTT_SEQTYPE_SU = 1, HTT_SEQTYPE_AC_MU_MIMO = 2, HTT_SEQTYPE_AX_MU_MIMO = 3, HTT_SEQTYPE_MU_OFDMA = 4, HTT_SEQTYPE_UL_TRIG = 5, HTT_SEQTYPE_BURST_BCN = 6, HTT_SEQTYPE_UL_BSR_RESP = 7, HTT_SEQTYPE_UL_BSR_TRIG = 8, HTT_SEQTYPE_UL_RESP = 9, }; typedef enum HTT_PPDU_STATS_SEQ_TYPE HTT_PPDU_STATS_SEQ_TYPE; #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M 0x00ff0000 #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S 16 #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_GET(_var) \ (((_var) & HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M) >> \ HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S) #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_SET(_var, _val) \ do { \ HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE, _val); \ ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)); \ } while (0) #define HTT_PPDU_STATS_COMMON_TLV_BW_M 0x000f0000 #define HTT_PPDU_STATS_COMMON_TLV_BW_S 16 Loading Loading @@ -403,15 +477,18 @@ typedef struct { /* BIT [ 7 : 0] :- frame_type - HTT_STATS_FTYPE * BIT [ 15: 8] :- queue_type - HTT_TX_QUEUE_TYPE * BIT [ 19: 16] :- bw - HTT_PPDU_STATS_BW * BIT [ 31: 20] :- reserved * BIT [ 27: 20] :- ppdu_seq_type - HTT_PPDU_STATS_SEQ_TYPE * BIT [ 31: 28] :- reserved */ union { A_UINT32 bw__queue_type__frame_type; A_UINT32 ppdu_seq_type__bw__queue_type__frame_type; struct { A_UINT32 frame_type: 8, queue_type: 8, bw: 4, reserved0: 12; ppdu_seq_type: 8, reserved0: 4; }; }; A_UINT32 chain_mask; Loading @@ -429,6 +506,42 @@ typedef struct { chan_mhz: 16; }; }; /* * The cca_delta_time_us reports the time the tx PPDU in question * was waiting in the HW tx queue for the clear channel assessment * to indicate that the transmission could start. * If this CCA delta time is zero or small, this indicates that the * air interface was unused prior to the transmission, and thus it's * improbable that there was a collision with some other transceiver's * transmission. * In contrast, a large CCA delta time means that this transceiver had * to wait a long time for the air interface to be available; it's * possible that other transceivers were also waiting for the air * interface to become available, and if the other waiting transceiver's * CW backoff aligned with this one, to have a transmit collision. */ A_UINT32 cca_delta_time_us; /* * The rxfrm_delta_time_us reports the time the tx PPDU in question * was waiting in the HW tx queue while there was an ongoing rx, * either because the rx was already ongoing at the time the tx PPDU * was enqueued, or because the rx (i.e. the peer's tx) won the air * interface contention over the local vdev's tx. */ A_UINT32 rxfrm_delta_time_us; /* * The txfrm_delta_time_us reports the time from when the tx PPDU * in question was enqueued into the HW tx queue until the time the * tx completion interrupt for the PPDU occurred. * Thus, the txfrm_delta_time_us incorporates any time the tx PPDU * had to wait for the air interface to become available, the PPDU * duration, the block ack reception, and the tx completion interrupt * latency. */ A_UINT32 txfrm_delta_time_us; } htt_ppdu_stats_common_tlv; #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M 0x000000ff Loading
fw/htt_stats.h +41 −7 Original line number Diff line number Diff line /* * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -393,11 +393,25 @@ typedef enum { } while (0) typedef struct { union { /* BIT [11 : 0] :- tag * BIT [23 : 12] :- length * BIT [31 : 24] :- reserved */ A_UINT32 tag__length; /* * The following struct is not endian-portable. * It is suitable for use within the target, which is known to be * little-endian. * The host should use the above endian-portable macros to access * the tag and length bitfields in an endian-neutral manner. */ struct { A_UINT32 tag: 12, /* BIT [11 : 0] */ length: 12, /* BIT [23 : 12] */ reserved: 8; /* BIT [31 : 24] */ }; }; } htt_tlv_hdr_t; #define HTT_STATS_MAX_STRING_SZ32 4 Loading Loading @@ -1120,6 +1134,16 @@ typedef struct _htt_rx_peer_rate_stats_tlv { A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */ A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */ A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */ A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS];/* dBm unit */ /* per_chain_rssi_pkt_type: * This field shows what type of rx frame the per-chain RSSI was computed * on, by recording the frame type and sub-type as bit-fields within this * field: * BIT [3 : 0] :- IEEE80211_FC0_TYPE * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE * BIT [31 : 8] :- Reserved */ A_UINT32 per_chain_rssi_pkt_type; } htt_rx_peer_rate_stats_tlv; typedef enum { Loading Loading @@ -2944,6 +2968,16 @@ typedef struct { * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB) */ A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* dBm units */ /* per_chain_rssi_pkt_type: * This field shows what type of rx frame the per-chain RSSI was computed * on, by recording the frame type and sub-type as bit-fields within this * field: * BIT [3 : 0] :- IEEE80211_FC0_TYPE * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE * BIT [31 : 8] :- Reserved */ A_UINT32 per_chain_rssi_pkt_type; } htt_rx_pdev_rate_stats_tlv; Loading
fw/targaddrs.h +10 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,16 @@ PREPACK64 struct host_interest_s { #define HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_HOST 0x400 /* HOST to support using BMI dump FW memory when hit assert */ #define HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_FW 0x800 /* FW to support using BMI dump FW memory when hit assert */ /* USB_RESET_RESUME * The host will set this flag, based on platform configuration specs. * The target will check this flag at the time USB becomes suspended. * If the flag is set, the target will invoke its reset / resume code. * If the flag is not set, the target will do nothing, other than wait. */ #define HI_OPTION_USB_RESET_RESUME 0x1000 #define USB_RESET_RESUME() \ (HOST_INTEREST->hi_option_flag2 & HI_OPTION_USB_RESET_RESUME) #define GPIO_WAKEUP_ENABLED() \ (HOST_INTEREST->hi_option_flag2 & HT_OPTION_GPIO_WAKEUP_SUPPORT) Loading
fw/wlan_defs.h +49 −7 Original line number Diff line number Diff line /* * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved.* * Copyright (c) 2013-2016, 2018-2019 The Linux Foundation. All rights reserved.* * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Loading Loading @@ -206,6 +206,7 @@ typedef enum { ((mode) == MODE_11AC_VHT80)) #endif #if SUPPORT_11AX #define IS_MODE_HE(mode) (((mode) == MODE_11AX_HE20) || \ ((mode) == MODE_11AX_HE40) || \ ((mode) == MODE_11AX_HE80) || \ Loading @@ -214,6 +215,10 @@ typedef enum { ((mode) == MODE_11AX_HE20_2G) || \ ((mode) == MODE_11AX_HE40_2G) || \ ((mode) == MODE_11AX_HE80_2G)) #define IS_MODE_HE_2G(mode) (((mode) == MODE_11AX_HE20_2G) || \ ((mode) == MODE_11AX_HE40_2G) || \ ((mode) == MODE_11AX_HE80_2G)) #endif /* SUPPORT_11AX */ #define IS_MODE_VHT_2G(mode) (((mode) == MODE_11AC_VHT20_2G) || \ ((mode) == MODE_11AC_VHT40_2G) || \ Loading @@ -235,6 +240,40 @@ typedef enum { ((mode) == MODE_11NG_HT40)) #define IS_MODE_11GONLY(mode) ((mode) == MODE_11GONLY) #define IS_MODE_LEGACY(phymode) ((phymode == MODE_11A) || \ (phymode == MODE_11G) || \ (phymode == MODE_11B) || \ (phymode == MODE_11GONLY)) #define IS_MODE_11N(phymode) ((phymode >= MODE_11NA_HT20) && \ (phymode <= MODE_11NG_HT40)) #ifdef CONFIG_160MHZ_SUPPORT #define IS_MODE_11AC(phymode) ((phymode >= MODE_11AC_VHT20) && \ (phymode <= MODE_11AC_VHT160)) #else #define IS_MODE_11AC(phymode) ((phymode >= MODE_11AC_VHT20) && \ (phymode <= MODE_11AC_VHT80_2G)) #endif /* CONFIG_160MHZ_SUPPORT */ #if SUPPORT_11AX #define IS_MODE_80MHZ(phymode) ((phymode == MODE_11AC_VHT80_2G) || \ (phymode == MODE_11AC_VHT80) || \ (phymode == MODE_11AX_HE80) || \ (phymode == MODE_11AX_HE80_2G)) #define IS_MODE_40MHZ(phymode) ((phymode == MODE_11AC_VHT40_2G) || \ (phymode == MODE_11AC_VHT40) || \ (phymode == MODE_11NG_HT40) || \ (phymode == MODE_11NA_HT40) || \ (phymode == MODE_11AX_HE40) || \ (phymode == MODE_11AX_HE40_2G)) #else #define IS_MODE_80MHZ(phymode) ((phymode == MODE_11AC_VHT80_2G) || \ (phymode == MODE_11AC_VHT80)) #define IS_MODE_40MHZ(phymode) ((phymode == MODE_11AC_VHT40_2G) || \ (phymode == MODE_11AC_VHT40) || \ (phymode == MODE_11NG_HT40) || \ (phymode == MODE_11NA_HT40)) #endif /* SUPPORT_11AX */ enum { REGDMN_MODE_11A = 0x00000001, /* 11a channels */ Loading Loading @@ -318,12 +357,13 @@ typedef struct { * In host-based implementation of the rate-control feature, this struture is used to * create the payload for HTT message/s from target to host. */ #ifndef CONFIG_MOVE_RC_STRUCT_TO_MACCORE #if (NUM_SPATIAL_STREAM > 3) #define A_RATEMASK A_UINT64 #else #define A_RATEMASK A_UINT32 #endif #endif /* CONFIG_MOVE_RC_STRUCT_TO_MACCORE */ typedef A_UINT8 A_RATE; typedef A_UINT8 A_RATECODE; Loading Loading @@ -425,6 +465,7 @@ typedef struct { * because the host should have no references to these target-only data * structures. */ #ifndef CONFIG_MOVE_RC_STRUCT_TO_MACCORE #if !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) #if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B) typedef struct{ Loading Loading @@ -494,6 +535,7 @@ typedef struct { A_UINT8 dd_profile; } RC_TX_RATE_INFO; #endif /* !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) */ #endif /* CONFIG_MOVE_RC_STRUCT_TO_MACCORE */ #endif /* Loading