qcacmn: Add Tx TLV Recording support

Add Tx TLV recording support for monitor 2.0
Also add support to control Rx and Tx TLV
recording

Change-Id: I27a0d2c9ea8bdfacd46e6b7188b45b08ed47bbcd
CRs-Fixed: 3422787
This commit is contained in:
Aniruddha Mishra
2023-02-22 19:39:15 +05:30
committed by Madan Koyyalamudi
parent 2c6112bf44
commit ba55e0f2a8
5 changed files with 383 additions and 38 deletions

View File

@@ -1152,6 +1152,9 @@ struct hal_phy_rx_ht_sig_tlv_record {
fes_coding:1,
cbw:1;
};
/* Tx TLVs - structs of Tx TLV with fields to be added here*/
/*
* enum hal_ppdu_tlv_category - Categories of TLV
* @PPDU_START: PPDU start level TLV
@@ -1246,6 +1249,14 @@ struct hal_txmon_usr_desc_common {
#define TXMON_STATUS_INFO(hal_tx_status_info, field) \
hal_tx_status_info->field
#ifdef MONITOR_TLV_RECORDING_ENABLE
struct hal_tx_tlv_info {
uint32_t tlv_tag;
uint8_t tlv_category;
uint8_t is_data_ppdu_info;
};
#endif
/**
* struct hal_tx_status_info - status info that wasn't populated in rx_status
* @reception_type: su or uplink mu reception type
@@ -1330,6 +1341,7 @@ struct hal_tx_status_info {
* @cur_usr_idx: Current user index of the PPDU
* @reserved: for future purpose
* @prot_tlv_status: protection tlv status
* @tx_tlv_info: store tx tlv info for recording
* @packet_info: packet information
* @rx_status: monitor mode rx status information
* @rx_user_status: monitor mode rx user status information
@@ -1344,6 +1356,9 @@ struct hal_tx_ppdu_info {
uint32_t prot_tlv_status;
#ifdef MONITOR_TLV_RECORDING_ENABLE
struct hal_tx_tlv_info tx_tlv_info;
#endif
/* placeholder to hold packet buffer info */
struct hal_mon_packet_info packet_info;
struct mon_rx_status rx_status;

View File

@@ -1384,6 +1384,18 @@ hal_txmon_status_get_num_users_generic_be(void *tx_tlv_hdr, uint8_t *num_users)
return tlv_status;
}
#ifdef MONITOR_TLV_RECORDING_ENABLE
static inline void
hal_tx_tlv_record_set_data_ppdu_info(struct hal_tx_ppdu_info *ppdu_info)
{
ppdu_info->tx_tlv_info.is_data_ppdu_info = 1;
}
#else
static inline void
hal_tx_tlv_record_set_data_ppdu_info(struct hal_tx_ppdu_info *ppdu_info)
{
}
#endif
/**
* hal_txmon_get_word_mask_generic_be() - api to get word mask for tx monitor
* @wmask: pointer to hal_txmon_word_mask_config_t
@@ -1438,6 +1450,7 @@ hal_tx_get_ppdu_info(void *data_info, void *prot_info, uint32_t tlv_tag)
case WIFISCHEDULER_END_E:/* DOWNSTREAM */
case WIFITX_FES_STATUS_START_PPDU_E:/* UPSTREAM */
{
hal_tx_tlv_record_set_data_ppdu_info(data_info);
return data_info;
}
}
@@ -1455,9 +1468,71 @@ hal_tx_get_ppdu_info(void *data_info, void *prot_info, uint32_t tlv_tag)
return prot_info;
}
hal_tx_tlv_record_set_data_ppdu_info(data_info);
return data_info;
}
#ifdef MONITOR_TLV_RECORDING_ENABLE
static inline void
hal_tx_record_tlv_info(struct hal_tx_ppdu_info *ppdu_info,
uint32_t tlv_tag)
{
ppdu_info->tx_tlv_info.tlv_tag = tlv_tag;
switch (tlv_tag) {
case WIFITX_FES_SETUP_E:
case WIFITXPCU_BUFFER_STATUS_E:
case WIFIPCU_PPDU_SETUP_INIT_E:
case WIFISCH_CRITICAL_TLV_REFERENCE_E:
case WIFITX_PEER_ENTRY_E:
case WIFITX_RAW_OR_NATIVE_FRAME_SETUP_E:
case WIFITX_QUEUE_EXTENSION_E:
case WIFITX_FES_SETUP_COMPLETE_E:
case WIFIFW2SW_MON_E:
case WIFISCHEDULER_END_E:
case WIFITQM_MPDU_GLOBAL_START_E:
ppdu_info->tx_tlv_info.tlv_category = CATEGORY_PPDU_START;
break;
case WIFITX_MPDU_START_E:
case WIFITX_MSDU_START_E:
case WIFITX_DATA_E:
case WIFITX_MSDU_END_E:
case WIFITX_MPDU_END_E:
ppdu_info->tx_tlv_info.tlv_category = CATEGORY_MPDU;
break;
case WIFITX_LAST_MPDU_FETCHED_E:
case WIFITX_LAST_MPDU_END_E:
case WIFIPDG_TX_REQ_E:
case WIFITX_FES_STATUS_START_PPDU_E:
case WIFIPHYTX_PPDU_HEADER_INFO_REQUEST_E:
case WIFIMACTX_L_SIG_A_E:
case WIFITXPCU_PREAMBLE_DONE_E:
case WIFIMACTX_USER_DESC_COMMON_E:
case WIFIMACTX_SERVICE_E:
case WIFITXDMA_STOP_REQUEST_E:
case WIFITXPCU_USER_BUFFER_STATUS_E:
case WIFITX_FES_STATUS_USER_PPDU_E:
case WIFITX_MPDU_COUNT_TRANSFER_END_E:
case WIFIRX_START_PARAM_E:
case WIFITX_FES_STATUS_ACK_OR_BA_E:
case WIFITX_FES_STATUS_USER_RESPONSE_E:
case WIFITX_FES_STATUS_END_E:
case WIFITX_FES_STATUS_PROT_E:
case WIFIMACTX_PHY_DESC_E:
case WIFIMACTX_HE_SIG_A_SU_E:
ppdu_info->tx_tlv_info.tlv_category = CATEGORY_PPDU_END;
break;
}
}
#else
static inline void
hal_tx_record_tlv_info(struct hal_tx_ppdu_info *ppdu_info,
uint32_t tlv_tag)
{
}
#endif
/**
* hal_txmon_status_parse_tlv_generic_be() - api to parse status tlv.
* @data_ppdu_info: hal_txmon data ppdu info
@@ -1497,6 +1572,7 @@ hal_txmon_status_parse_tlv_generic_be(void *data_ppdu_info,
prot_status_info);
user_id = (tlv_user_id > ppdu_info->num_users ? 0 : tlv_user_id);
hal_tx_record_tlv_info(ppdu_info, tlv_tag);
switch (tlv_tag) {
/* start of initiator FES window */