From 1347c3ab9cc2e9296a0c76d9c3f934a299f5daaa Mon Sep 17 00:00:00 2001 From: Shwetha G K Date: Mon, 18 May 2020 12:46:34 +0530 Subject: [PATCH] qcacmn: Update Pine specific CFR changes Update Pine specific CFR changes Change-Id: Ibdd33e458cd058f6db94de5165df31d25d97eebb --- target_if/cfr/inc/target_if_cfr_6018.h | 8 ++++ target_if/cfr/src/target_if_cfr_6018.c | 47 ++++++++++++++++---- umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h | 2 + 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/target_if/cfr/inc/target_if_cfr_6018.h b/target_if/cfr/inc/target_if_cfr_6018.h index 10c9251858ca..c186c689fe6a 100644 --- a/target_if/cfr/inc/target_if_cfr_6018.h +++ b/target_if/cfr/inc/target_if_cfr_6018.h @@ -75,6 +75,14 @@ #define STREAMFS_NUM_SUBBUF_CYP 255 +/* Max size : + * 16886 = 310 bytes(csi header) + 192 bytes(cfr header) + 16384 bytes(cfr + * payload) + */ +#define STREAMFS_MAX_SUBBUF_PINE 16886 + +#define STREAMFS_NUM_SUBBUF_PINE 255 + /* * @tag: ucode fills this with 0xBA * diff --git a/target_if/cfr/src/target_if_cfr_6018.c b/target_if/cfr/src/target_if_cfr_6018.c index 005bdfc7408d..3766a22afbf9 100644 --- a/target_if/cfr/src/target_if_cfr_6018.c +++ b/target_if/cfr/src/target_if_cfr_6018.c @@ -1039,13 +1039,19 @@ static void dump_cfr_peer_tx_event_enh(wmi_cfr_peer_tx_event_param *event, */ static void enh_prepare_cfr_header_txstatus(wmi_cfr_peer_tx_event_param *tx_evt_param, - struct csi_cfr_header *header) + struct csi_cfr_header *header, + uint32_t target_type) { header->start_magic_num = 0xDEADBEAF; header->vendorid = 0x8cfdf0; header->cfr_metadata_version = CFR_META_VERSION_3; header->cfr_data_version = CFR_DATA_VERSION_1; - header->chip_type = CFR_CAPTURE_RADIO_CYP; + + if (target_type == TARGET_TYPE_QCN9000) + header->chip_type = CFR_CAPTURE_RADIO_PINE; + else + header->chip_type = CFR_CAPTURE_RADIO_CYP; + header->pltform_type = CFR_PLATFORM_TYPE_ARM; header->Reserved = 0; header->u.meta_v3.status = 0; /* failure */ @@ -1084,6 +1090,7 @@ target_if_peer_capture_event(ol_scn_t sc, uint8_t *data, uint32_t datalen) struct wlan_channel *bss_chan; struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = NULL; struct wlan_lmac_if_rx_ops *rx_ops; + uint32_t target_type; if (!sc || !data) { cfr_err("sc or data is null"); @@ -1159,12 +1166,16 @@ target_if_peer_capture_event(ol_scn_t sc, uint8_t *data, uint32_t datalen) goto relref; } + target_type = target_if_cfr_get_target_type(psoc); + if ((tx_evt_param.status & PEER_CFR_CAPTURE_EVT_PS_STATUS_MASK) == 1) { cfr_err("CFR capture failed as peer is in powersave: " QDF_MAC_ADDR_STR, QDF_MAC_ADDR_ARRAY(tx_evt_param.peer_mac_addr.bytes)); - enh_prepare_cfr_header_txstatus(&tx_evt_param, &header_error); + enh_prepare_cfr_header_txstatus(&tx_evt_param, + &header_error, + target_type); if (cfr_rx_ops->cfr_info_send) cfr_rx_ops->cfr_info_send(pdev, &header_error, @@ -1231,7 +1242,12 @@ target_if_peer_capture_event(ol_scn_t sc, uint8_t *data, uint32_t datalen) header->vendorid = 0x8cfdf0; header->cfr_metadata_version = CFR_META_VERSION_3; header->cfr_data_version = CFR_DATA_VERSION_1; - header->chip_type = CFR_CAPTURE_RADIO_CYP; + + if (target_type == TARGET_TYPE_QCN9000) + header->chip_type = CFR_CAPTURE_RADIO_PINE; + else + header->chip_type = CFR_CAPTURE_RADIO_CYP; + header->pltform_type = CFR_PLATFORM_TYPE_ARM; header->Reserved = 0; header->u.meta_v3.status = (tx_evt_param.status & @@ -1539,12 +1555,18 @@ QDF_STATUS cfr_6018_init_pdev(struct wlan_objmgr_psoc *psoc, { QDF_STATUS status = QDF_STATUS_SUCCESS; struct pdev_cfr *pcfr; + uint32_t target_type; if (!pdev) { cfr_err("PDEV is NULL!"); return QDF_STATUS_E_NULL_VALUE; } + if (!psoc) { + cfr_err("PSOC is NULL"); + return QDF_STATUS_E_NULL_VALUE; + } + pcfr = wlan_objmgr_pdev_get_comp_private_obj(pdev, WLAN_UMAC_COMP_CFR); if (!pcfr) { @@ -1552,6 +1574,8 @@ QDF_STATUS cfr_6018_init_pdev(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_NULL_VALUE; } + target_type = target_if_cfr_get_target_type(psoc); + #if DIRECT_BUF_RX_ENABLE status = target_if_register_to_dbr_enh(pdev); if (status != QDF_STATUS_SUCCESS) { @@ -1571,7 +1595,7 @@ QDF_STATUS cfr_6018_init_pdev(struct wlan_objmgr_psoc *psoc, pcfr->rcc_param.modified_in_curr_session = MAX_RESET_CFG_ENTRY; pcfr->rcc_param.num_grp_tlvs = MAX_TA_RA_ENTRIES; pcfr->rcc_param.vdev_id = CFR_INVALID_VDEV_ID; - pcfr->rcc_param.srng_id = 0; + pcfr->rcc_param.srng_id = DEFAULT_SRNGID_CFR; target_if_cfr_default_ta_ra_config(&pcfr->rcc_param, true, MAX_RESET_CFG_ENTRY); @@ -1588,9 +1612,16 @@ QDF_STATUS cfr_6018_init_pdev(struct wlan_objmgr_psoc *psoc, pcfr->rcc_param.modified_in_curr_session = 0; pcfr->cfr_max_sta_count = MAX_CFR_ENABLED_CLIENTS; - pcfr->subbuf_size = STREAMFS_MAX_SUBBUF_CYP; - pcfr->num_subbufs = STREAMFS_NUM_SUBBUF_CYP; - pcfr->chip_type = CFR_CAPTURE_RADIO_CYP; + + if (target_type == TARGET_TYPE_QCN9000) { + pcfr->subbuf_size = STREAMFS_MAX_SUBBUF_PINE; + pcfr->num_subbufs = STREAMFS_NUM_SUBBUF_PINE; + pcfr->chip_type = CFR_CAPTURE_RADIO_PINE; + } else { + pcfr->subbuf_size = STREAMFS_MAX_SUBBUF_CYP; + pcfr->num_subbufs = STREAMFS_NUM_SUBBUF_CYP; + pcfr->chip_type = CFR_CAPTURE_RADIO_CYP; + } if (!pcfr->lut_timer_init) { qdf_timer_init(NULL, diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h index 4215d5710809..005f7a37c499 100644 --- a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h +++ b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h @@ -51,6 +51,7 @@ #define MAX_TA_RA_ENTRIES 16 #define MAX_RESET_CFG_ENTRY 0xFFFF #define CFR_INVALID_VDEV_ID 0xff +#define DEFAULT_SRNGID_CFR 0 #endif enum cfrmetaversion { @@ -91,6 +92,7 @@ enum cfrradiotype { CFR_CAPTURE_RADIO_HKV2, CFR_CAPTURE_RADIO_CYP, CFR_CAPTURE_RADIO_HSP, + CFR_CAPTURE_RADIO_PINE, CFR_CAPTURE_RADIO_MAX = 0xFF, };