From 728901337edc1c5db3ce6b215ac730b03d312ab6 Mon Sep 17 00:00:00 2001 From: Ashish Date: Wed, 12 Jan 2022 15:48:25 +0530 Subject: [PATCH 01/16] qcacmn: Move reg_get_6g_ap_master_chan_list out of AFC flag Currently api wlan_reg_get_6g_ap_master_chan_list is declared and defined under CONFIG_AFC_SUPPORT feature flag, since this is a generic API and can be used by other functionalities as well. With this change move wlan_reg_get_6g_ap_master_chan_list api out of CONFIG_AFC_SUPPORT feature flag. Change-Id: Ifa7b27895b4660bbf248fc2827472ba50c9df9a4 CRs-Fixed: 3090281 --- .../regulatory/core/src/reg_build_chan_list.c | 24 +++++++++++++++++++ .../regulatory/core/src/reg_build_chan_list.h | 24 ++++++++++++++++++- .../dispatcher/inc/wlan_reg_services_api.h | 21 ++++++++++++++++ .../dispatcher/src/wlan_reg_services_api.c | 10 ++++++++ 4 files changed, 78 insertions(+), 1 deletion(-) diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index 1e781c36e7c2..d20271009038 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -1988,6 +1988,30 @@ QDF_STATUS reg_process_master_chan_list_ext( return QDF_STATUS_SUCCESS; } + +QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev, + enum reg_6g_ap_type ap_pwr_type, + struct regulatory_channel *chan_list) +{ + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + struct regulatory_channel *master_chan_list_6g; + + pdev_priv_obj = reg_get_pdev_obj(pdev); + + if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { + reg_err("reg pdev private obj is NULL"); + return QDF_STATUS_E_FAILURE; + } + + if (ap_pwr_type >= REG_CURRENT_MAX_AP_TYPE) + return QDF_STATUS_E_FAILURE; + + master_chan_list_6g = pdev_priv_obj->mas_chan_list_6g_ap[ap_pwr_type]; + qdf_mem_copy(chan_list, master_chan_list_6g, + NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel)); + + return QDF_STATUS_SUCCESS; +} #endif /* CONFIG_BAND_6GHZ */ QDF_STATUS reg_process_master_chan_list( diff --git a/umac/regulatory/core/src/reg_build_chan_list.h b/umac/regulatory/core/src/reg_build_chan_list.h index 4245e3a73c9f..3b1923903e97 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.h +++ b/umac/regulatory/core/src/reg_build_chan_list.h @@ -88,7 +88,29 @@ void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS reg_process_master_chan_list_ext(struct cur_regulatory_info *reg_info); -#endif + +/** + * reg_get_6g_ap_master_chan_list() - Get an ap master channel list depending + * on * ap power type + * @ap_pwr_type: Power type (LPI/VLP/SP) + * @chan_list: Pointer to the channel list. The output channel list + * + * Return: QDF_STATUS + */ +QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev, + enum reg_6g_ap_type ap_pwr_type, + struct regulatory_channel *chan_list); + +#else /* CONFIG_BAND_6GHZ */ +static inline QDF_STATUS +reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev, + enum reg_6g_ap_type ap_pwr_type, + struct regulatory_channel *chan_list) +{ + return QDF_STATUS_E_FAILURE; +} +#endif /* CONFIG_BAND_6GHZ */ + /** * reg_process_master_chan_list() - Compute master channel list based on the * regulatory rules. diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 1b0a7875208c..711d673bc046 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -227,6 +227,19 @@ static inline bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq, } #endif +/** + * wlan_reg_get_6g_ap_master_chan_list() - provide the appropriate ap master + * channel list + * @pdev: pdev pointer + * @ap_pwr_type: The ap power type (LPI/VLP/SP) + * @chan_list: channel list pointer + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_reg_get_6g_ap_master_chan_list( + struct wlan_objmgr_pdev *pdev, + enum reg_6g_ap_type ap_pwr_type, + struct regulatory_channel *chan_list); /** * wlan_reg_is_6ghz_psc_chan_freq() - Check if the given 6GHz channel frequency * is preferred scanning channel frequency. @@ -337,6 +350,14 @@ wlan_reg_get_max_txpower_for_6g_tpe(struct wlan_objmgr_pdev *pdev, { return QDF_STATUS_E_FAILURE; } + +static inline QDF_STATUS +wlan_reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev, + enum reg_6g_ap_type ap_pwr_type, + struct regulatory_channel *chan_list) +{ + return QDF_STATUS_E_FAILURE; +} #endif /* CONFIG_BAND_6GHZ */ /** diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index ddd2f93b61c8..4251c50326e5 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -476,6 +476,16 @@ regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc, if (tx_ops->unregister_master_ext_handler) tx_ops->unregister_master_ext_handler(psoc, NULL); } + +QDF_STATUS wlan_reg_get_6g_ap_master_chan_list( + struct wlan_objmgr_pdev *pdev, + enum reg_6g_ap_type ap_pwr_type, + struct regulatory_channel *chan_list) +{ + return reg_get_6g_ap_master_chan_list(pdev, ap_pwr_type, chan_list); +} + +qdf_export_symbol(wlan_reg_get_6g_ap_master_chan_list); #else static inline void regulatory_assign_register_master_ext_handler(struct wlan_objmgr_psoc *psoc, From 40395a8bda4e36ea9d69d8c7c4868d9eb0a8ef6b Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Wed, 5 Jan 2022 11:32:47 +0800 Subject: [PATCH 02/16] qcacmn: Add mpdu tx retries stats Customer reported their HLOS LTE-WLAN transition algo sometimes go wrong for wrong low layer stats, Txretry delta is bigger than Txtotal delta. Txretry unit is msdu while Txtotal unit is mpdu. Add vdev/peer stats for mpdu number of successfully transmitted after more than one retransmission attempt, to align mpdu tx_packets, tx_failed. CRs-Fixed: 3099490 Change-Id: Id4b9d8fd81af4bf0c141dad481bfd2b3f6c1db2a --- dp/inc/cdp_txrx_stats_struct.h | 2 ++ dp/wifi3.0/dp_internal.h | 1 + dp/wifi3.0/dp_tx.c | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 34bd143389c5..813de47f98eb 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -914,6 +914,7 @@ struct protocol_trace_count { * @stbc: Packets in STBC * @ldpc: Packets in LDPC * @retries: Packet retries + * @retries_mpdu: mpdu number of successfully transmitted after retries * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation * @amsdu_cnt: Number of MSDUs part of AMSDU * @tx_rate: Tx Rate @@ -995,6 +996,7 @@ struct cdp_tx_stats { uint32_t stbc; uint32_t ldpc; uint32_t retries; + uint32_t retries_mpdu; uint32_t non_amsdu_cnt; uint32_t amsdu_cnt; uint32_t tx_rate; diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index 13e4a851611c..e9f8de7431e7 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -853,6 +853,7 @@ static inline void dp_update_vdev_stats(struct dp_soc *soc, tgtobj->tx.ldpc += srcobj->stats.tx.ldpc; tgtobj->tx.pream_punct_cnt += srcobj->stats.tx.pream_punct_cnt; tgtobj->tx.retries += srcobj->stats.tx.retries; + tgtobj->tx.retries_mpdu += srcobj->stats.tx.retries_mpdu; tgtobj->tx.non_amsdu_cnt += srcobj->stats.tx.non_amsdu_cnt; tgtobj->tx.amsdu_cnt += srcobj->stats.tx.amsdu_cnt; tgtobj->tx.non_ampdu_cnt += srcobj->stats.tx.non_ampdu_cnt; diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 9438be28a218..2bb79296f82b 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -4117,15 +4117,18 @@ dp_tx_update_peer_stats(struct dp_tx_desc_s *tx_desc, DP_STATS_INCC(peer, tx.stbc, 1, ts->stbc); DP_STATS_INCC(peer, tx.ldpc, 1, ts->ldpc); DP_STATS_INCC(peer, tx.retries, 1, ts->transmit_cnt > 1); + #if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc, &peer->stats, ts->peer_id, UPDATE_PEER_STATS, pdev->pdev_id); #endif - if (ts->first_msdu) + if (ts->first_msdu) { DP_STATS_INCC(peer, tx.mpdu_success_with_retries, qdf_do_div(ts->transmit_cnt, DP_RETRY_COUNT), ts->transmit_cnt > DP_RETRY_COUNT); + DP_STATS_INCC(peer, tx.retries_mpdu, 1, ts->transmit_cnt > 1); + } } #ifdef QCA_LL_TX_FLOW_CONTROL_V2 From eec62c31a840c28670f46c557e2e89bfcafa1734 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Mon, 20 Sep 2021 18:53:58 +0530 Subject: [PATCH 03/16] qcacmn: Add logs to print if nan is enabled or not for a freq With this change add log with scan channels list dump to print if NAN is enabled or not for any frequency. Change-Id: I81f5017c7f146d2c7bd227601ae320d9cc67f82f CRs-Fixed: 3042903 --- wmi/src/wmi_unified_tlv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index df3781218048..23487b0be26b 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -3194,13 +3194,15 @@ static void wmi_scan_chanlist_dump(struct scan_chan_list_params *scan_chan_list) for (i = 0; i < scan_chan_list->nallchans; i++) { chan = &scan_chan_list->ch_param[i]; ret = qdf_scnprintf(info + len, sizeof(info) - len, - " %d[%d][%d]", chan->mhz, chan->maxregpower, - chan->dfs_set); + " %d[%d][%d][%d]", chan->mhz, + chan->maxregpower, + chan->dfs_set, chan->nan_disabled); if (ret <= 0) break; len += ret; if (len >= (sizeof(info) - 20)) { - wmi_nofl_debug("Chan[TXPwr][DFS]:%s", info); + wmi_nofl_debug("Chan[TXPwr][DFS][nan_disabled]:%s", + info); len = 0; } } From 9f3ed88982319c8b35da78cedcda9792e7ec3213 Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Wed, 10 Nov 2021 14:36:18 +0530 Subject: [PATCH 04/16] qcacmn: Remove csum_enabled flag check Currently, to set checksum enable flags in Tx descriptor we are checking the csum_enabled flag along with stack checksum offload request. In case of roaming from latency-critical connection to non-latency critical connection we request stack to calculate checksum and set csum_enabled flag to 0. For some packets which are already queued where the stack has not calculated checksum and csum_enabled flag is set to 0, we will not set the checksum enable flags in Tx descriptors for those packets. To fix the issue remove the csum_enabled flag check and directly check if the stack has calculated checksum for those packets or not. Change-Id: I8d7754afc3d0a33315b85b0113cd3062e5783e28 CRs-Fixed: 3070858 --- dp/wifi3.0/dp_tx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 2bb79296f82b..ce555cea9100 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1696,9 +1696,8 @@ dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev, hal_tx_desc_set_to_fw(hal_tx_desc_cached, 1); /* verify checksum offload configuration*/ - if (vdev->csum_enabled && - ((qdf_nbuf_get_tx_cksum(tx_desc->nbuf) == QDF_NBUF_TX_CKSUM_TCP_UDP) - || qdf_nbuf_is_tso(tx_desc->nbuf))) { + if ((qdf_nbuf_get_tx_cksum(tx_desc->nbuf) == QDF_NBUF_TX_CKSUM_TCP_UDP) + || qdf_nbuf_is_tso(tx_desc->nbuf)) { hal_tx_desc_set_l3_checksum_en(hal_tx_desc_cached, 1); hal_tx_desc_set_l4_checksum_en(hal_tx_desc_cached, 1); } From 0f8b6684b2849f99e2cd2026dea77e912a08b539 Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Wed, 10 Nov 2021 14:55:01 +0530 Subject: [PATCH 05/16] qcacmn: Remove csum_enabled flag and related changes As part of code change we are removing csum_enabled flag check. In that case, csum_enabled becomes redundant since we are not using it in the code base, So remove redundant code as part of the cleanup. Change-Id: Iac411b20f06436053b1969a1af9e3b3ee418c34c CRs-Fixed: 3070858 --- dp/inc/cdp_txrx_cmn_struct.h | 7 ++----- dp/wifi3.0/dp_main.c | 5 ----- dp/wifi3.0/dp_tx.c | 26 -------------------------- dp/wifi3.0/dp_types.h | 3 --- 4 files changed, 2 insertions(+), 39 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index e8dd3a280abc..3313ee325a95 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -1138,8 +1139,6 @@ enum cdp_pdev_param_type { * * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable * @cdp_psoc_param_en_nss_cfg: set nss cfg - * - * @cdp_enable_tx_checksum: Flag to specify if HW Tx checksum enabled */ typedef union cdp_config_param_t { /* peer params */ @@ -1209,7 +1208,6 @@ typedef union cdp_config_param_t { int cdp_psoc_param_preferred_hw_mode; bool cdp_psoc_param_pext_stats; - bool cdp_enable_tx_checksum; } cdp_config_param_type; /** @@ -1307,7 +1305,6 @@ enum cdp_vdev_param_type { #endif CDP_SAFEMODE, CDP_DROP_UNENC, - CDP_ENABLE_CSUM, CDP_ENABLE_IGMP_MCAST_EN, CDP_ENABLE_HLOS_TID_OVERRIDE, #ifdef QCA_SUPPORT_WDS_EXTENDED diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 6067336cb479..2ec38f9eb9ae 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -9324,11 +9324,6 @@ dp_set_vdev_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, val.cdp_vdev_param_mesh_mode); break; #endif - case CDP_ENABLE_CSUM: - dp_info("vdev_id %d enable Checksum %d", vdev_id, - val.cdp_enable_tx_checksum); - vdev->csum_enabled = val.cdp_enable_tx_checksum; - break; case CDP_ENABLE_HLOS_TID_OVERRIDE: dp_info("vdev_id %d enable hlod tid override %d", vdev_id, val.cdp_vdev_param_hlos_tid_override); diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index ce555cea9100..a499384d3dd4 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -5017,30 +5017,6 @@ qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, } #endif -static void dp_tx_vdev_update_feature_flags(struct dp_vdev *vdev) -{ - struct wlan_cfg_dp_soc_ctxt *cfg; - - struct dp_soc *soc; - - soc = vdev->pdev->soc; - if (!soc) - return; - - cfg = soc->wlan_cfg_ctx; - if (!cfg) - return; - - if (vdev->opmode == wlan_op_mode_ndi) - vdev->csum_enabled = wlan_cfg_get_nan_checksum_offload(cfg); - else if ((vdev->subtype == wlan_op_subtype_p2p_device) || - (vdev->subtype == wlan_op_subtype_p2p_cli) || - (vdev->subtype == wlan_op_subtype_p2p_go)) - vdev->csum_enabled = wlan_cfg_get_p2p_checksum_offload(cfg); - else - vdev->csum_enabled = wlan_cfg_get_checksum_offload(cfg); -} - /** * dp_tx_vdev_attach() - attach vdev to dp tx * @vdev: virtual device instance @@ -5072,8 +5048,6 @@ QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev) dp_tx_vdev_update_search_flags(vdev); - dp_tx_vdev_update_feature_flags(vdev); - return QDF_STATUS_SUCCESS; } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 87587b070bfc..248e22d4dcb7 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -2579,9 +2579,6 @@ struct dp_vdev { /* IGMP multicast enhancement enabled */ uint8_t igmp_mcast_enhanc_en; - /* HW TX Checksum Enabled Flag */ - uint8_t csum_enabled; - /* vdev_id - ID used to specify a particular vdev to the target */ uint8_t vdev_id; From 9a52a4d3045485ec368b5e9ac2686d0f2ac848fe Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Tue, 11 Jan 2022 12:55:56 +0530 Subject: [PATCH 06/16] qcacmn: Fix deleting unused timer in QCA6750 target In QCA6750 target hif sleep timer is not used but timer delete is performed during deinit path. Fix this so that hif sleep timer delete operation is not performed in QCA6750 target. Change-Id: I54790f3b20af4f4b265ab37b593d300032f00fa5 CRs-Fixed: 3108047 --- hif/src/ipcie/if_ipci.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/hif/src/ipcie/if_ipci.c b/hif/src/ipcie/if_ipci.c index 8be39b1aa248..084f749fb089 100644 --- a/hif/src/ipcie/if_ipci.c +++ b/hif/src/ipcie/if_ipci.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 above @@ -115,21 +116,14 @@ static int hif_ce_msi_map_ce_to_irq(struct hif_softc *scn, int ce_id) int hif_ipci_bus_configure(struct hif_softc *hif_sc) { int status = 0; - struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc); uint8_t wake_ce_id; hif_ce_prepare_config(hif_sc); - /* initialize sleep state adjust variables */ - hif_state->sleep_timer_init = true; - hif_state->keep_awake_count = 0; - hif_state->fake_sleep = false; - hif_state->sleep_ticks = 0; - status = hif_wlan_enable(hif_sc); if (status) { hif_err("hif_wlan_enable error = %d", status); - goto timer_free; + return status; } A_TARGET_ACCESS_LIKELY(hif_sc); @@ -162,11 +156,6 @@ disable_wlan: A_TARGET_ACCESS_UNLIKELY(hif_sc); hif_wlan_disable(hif_sc); -timer_free: - qdf_timer_stop(&hif_state->sleep_timer); - qdf_timer_free(&hif_state->sleep_timer); - hif_state->sleep_timer_init = false; - hif_err("Failed, status = %d", status); return status; } From 879b75a05aaa9717764def68a2d42d5e665d57c8 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 13 Jan 2022 22:25:46 -0800 Subject: [PATCH 07/16] qcacmn: Add log message for RTPM prevent API triggered resume Add a log message to indicate RTPM resume is requested by RTPM prevent runtime suspend API. Change-Id: Ifb90493d1ea48601bb40708b1a2d7a821144a9b2 CRs-Fixed: 3110580 --- hif/src/hif_runtime_pm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hif/src/hif_runtime_pm.c b/hif/src/hif_runtime_pm.c index 061558aca878..b6f76644901b 100644 --- a/hif/src/hif_runtime_pm.c +++ b/hif/src/hif_runtime_pm.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 above @@ -1366,6 +1367,7 @@ static int __hif_pm_runtime_prevent_suspend(struct hif_softc *scn, return 0; ret = __hif_pm_runtime_get(dev); + hif_debug("request runtime PM resume, rtpm_dbgid %s", lock->name); /** * The ret can be -EINPROGRESS, if Runtime status is RPM_RESUMING or From 339a6e5c3ba0e0788407dfe3a332ad6631dc5778 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 13 Jan 2022 22:59:35 -0800 Subject: [PATCH 08/16] qcacmn: Clear num stats over QMI once WoW enter/exit Num stats over QMI indicates how many stats requests are fetched without triggering RTPM resume. If RTPM resume/suspend happens in the middle then num stats over QMI counter should reset. Add logic to reset num stats over QMI counter during WoW enter/exit. Change-Id: I34fe93759bf8a7a2a6c0d4b389ad96b8e1ba4d6c CRs-Fixed: 3110590 --- wmi/src/wmi_unified.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 5c9ba8e5166c..e143c75344e2 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 @@ -3567,6 +3568,7 @@ void wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val) void wmi_set_target_suspend_acked(wmi_unified_t wmi_handle, A_BOOL val) { qdf_atomic_set(&wmi_handle->is_target_suspend_acked, val); + qdf_atomic_set(&wmi_handle->num_stats_over_qmi, 0); } /** From 5c6b2ee5bf1ac395acdb91dce8e2c53c8e86e192 Mon Sep 17 00:00:00 2001 From: Ananya Gupta Date: Mon, 24 Jan 2022 13:28:24 +0530 Subject: [PATCH 09/16] qcacmn: Send EAPOL pkt to stack in rx_err path Send only eapol packets to stack and drop other packets when found in rx err path when either REO or RXDMA push reason is set to ROUTE type. Change-Id: If1f43426adf21f7d00f17d369cd7fde7f7f85866 CRs-Fixed: 3114312 --- dp/wifi3.0/dp_rx_err.c | 143 ++++++++++++++++++++++++++++++++++++++++- dp/wifi3.0/dp_stats.c | 4 ++ dp/wifi3.0/dp_types.h | 4 ++ 3 files changed, 150 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index dfd7f0b62e04..ddf45223cf7f 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 @@ -1624,6 +1625,124 @@ fail: return; } +/** + * dp_rx_err_route_hdl() - Function to send EAPOL frames to stack + * Free any other packet which comes in + * this path. + * + * @soc: core DP main context + * @nbuf: buffer pointer + * @peer: peer handle + * @rx_tlv_hdr: start of rx tlv header + * @err_src: rxdma/reo + * + * This function indicates EAPOL frame received in wbm error ring to stack. + * Any other frame should be dropped. + * + * Return: SUCCESS if delivered to stack + */ +static void +dp_rx_err_route_hdl(struct dp_soc *soc, qdf_nbuf_t nbuf, + struct dp_peer *peer, uint8_t *rx_tlv_hdr, + enum hal_rx_wbm_error_source err_src) +{ + uint32_t pkt_len; + uint16_t msdu_len; + struct dp_vdev *vdev; + struct hal_rx_msdu_metadata msdu_metadata; + bool is_eapol; + + hal_rx_msdu_metadata_get(soc->hal_soc, rx_tlv_hdr, &msdu_metadata); + msdu_len = hal_rx_msdu_start_msdu_len_get(rx_tlv_hdr); + pkt_len = msdu_len + msdu_metadata.l3_hdr_pad + RX_PKT_TLVS_LEN; + + if (qdf_likely(!qdf_nbuf_is_frag(nbuf))) { + if (dp_rx_check_pkt_len(soc, pkt_len)) + goto drop_nbuf; + + /* Set length in nbuf */ + qdf_nbuf_set_pktlen( + nbuf, qdf_min(pkt_len, (uint32_t)RX_DATA_BUFFER_SIZE)); + qdf_assert_always(nbuf->data == rx_tlv_hdr); + } + + /* + * Check if DMA completed -- msdu_done is the last bit + * to be written + */ + if (!hal_rx_attn_msdu_done_get(rx_tlv_hdr)) { + dp_err_rl("MSDU DONE failure"); + hal_rx_dump_pkt_tlvs(soc->hal_soc, rx_tlv_hdr, + QDF_TRACE_LEVEL_INFO); + qdf_assert(0); + } + + if (!peer) + goto drop_nbuf; + + vdev = peer->vdev; + if (!vdev) { + dp_err_rl("Null vdev!"); + DP_STATS_INC(soc, rx.err.invalid_vdev, 1); + goto drop_nbuf; + } + + /* + * Advance the packet start pointer by total size of + * pre-header TLV's + */ + if (qdf_nbuf_is_frag(nbuf)) + qdf_nbuf_pull_head(nbuf, RX_PKT_TLVS_LEN); + else + qdf_nbuf_pull_head(nbuf, (msdu_metadata.l3_hdr_pad + + RX_PKT_TLVS_LEN)); + + dp_vdev_peer_stats_update_protocol_cnt(vdev, nbuf, NULL, 0, 1); + + /* + * Indicate EAPOL frame to stack only when vap mac address + * matches the destination address. + */ + is_eapol = qdf_nbuf_is_ipv4_eapol_pkt(nbuf); + if (is_eapol || qdf_nbuf_is_ipv4_wapi_pkt(nbuf)) { + qdf_ether_header_t *eh = + (qdf_ether_header_t *)qdf_nbuf_data(nbuf); + if (qdf_mem_cmp(eh->ether_dhost, &vdev->mac_addr.raw[0], + QDF_MAC_ADDR_SIZE) == 0) { + DP_STATS_INC_PKT(vdev, rx.to_stack, 1, + qdf_nbuf_len(nbuf)); + + /* + * Update the protocol tag in SKB based on + * CCE metadata. + */ + dp_rx_update_protocol_tag(soc, vdev, nbuf, rx_tlv_hdr, + EXCEPTION_DEST_RING_ID, + true, true); + /* Update the flow tag in SKB based on FSE metadata */ + dp_rx_update_flow_tag(soc, vdev, nbuf, rx_tlv_hdr, + true); + DP_STATS_INC_PKT(peer, rx.to_stack, 1, + qdf_nbuf_len(nbuf)); + qdf_nbuf_set_exc_frame(nbuf, 1); + qdf_nbuf_set_next(nbuf, NULL); + + dp_rx_deliver_to_stack(soc, vdev, peer, nbuf, NULL); + + return; + } + } + +drop_nbuf: + + DP_STATS_INCC(soc, rx.reo2rel_route_drop, 1, + err_src == HAL_RX_WBM_ERR_SRC_REO); + DP_STATS_INCC(soc, rx.rxdma2rel_route_drop, 1, + err_src == HAL_RX_WBM_ERR_SRC_RXDMA); + + qdf_nbuf_free(nbuf); +} + #ifdef DP_RX_DESC_COOKIE_INVALIDATE /** * dp_rx_link_cookie_check() - Validate link desc cookie @@ -2466,6 +2585,17 @@ done: wbm_err_info.reo_err_code); qdf_nbuf_free(nbuf); } + } else if (wbm_err_info.reo_psh_rsn + == HAL_RX_WBM_REO_PSH_RSN_ROUTE) { + dp_rx_err_route_hdl(soc, nbuf, peer, + rx_tlv_hdr, + HAL_RX_WBM_ERR_SRC_REO); + } else { + /* should not enter here */ + dp_alert("invalid reo push reason %u", + wbm_err_info.reo_psh_rsn); + qdf_nbuf_free(nbuf); + qdf_assert_always(0); } } else if (wbm_err_info.wbm_err_src == HAL_RX_WBM_ERR_SRC_RXDMA) { @@ -2530,6 +2660,17 @@ done: dp_err_rl("RXDMA error %d", wbm_err_info.rxdma_err_code); } + } else if (wbm_err_info.rxdma_psh_rsn + == HAL_RX_WBM_RXDMA_PSH_RSN_ROUTE) { + dp_rx_err_route_hdl(soc, nbuf, peer, + rx_tlv_hdr, + HAL_RX_WBM_ERR_SRC_RXDMA); + } else { + /* should not enter here */ + dp_alert("invalid rxdma push reason %u", + wbm_err_info.rxdma_psh_rsn); + qdf_nbuf_free(nbuf); + qdf_assert_always(0); } } else { /* Should not come here */ diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index 2d96e52c477c..979b23b7e6f9 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -6652,6 +6652,10 @@ dp_print_soc_rx_stats(struct dp_soc *soc) soc->stats.rx.err.reo_cmd_send_fail); DP_PRINT_STATS("Rx BAR frames:%d", soc->stats.rx.bar_frame); + DP_PRINT_STATS("Rxdma2rel route drop:%d", + soc->stats.rx.rxdma2rel_route_drop); + DP_PRINT_STATS("Reo2rel route drop:%d", + soc->stats.rx.reo2rel_route_drop); } #ifdef FEATURE_TSO_STATS diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 248e22d4dcb7..51184b9f8e87 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -972,6 +972,10 @@ struct dp_soc_stats { uint32_t msdu_scatter_wait_break; /* Number of bar frames received */ uint32_t bar_frame; + /* Number of frames routed from rxdma */ + uint32_t rxdma2rel_route_drop; + /* Number of frames routed from reo*/ + uint32_t reo2rel_route_drop; struct { /* Invalid RBM error count */ From 87dae55f0cf1a715abe51ffb2ffb97a4fc41eb63 Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Tue, 14 Sep 2021 18:31:50 +0530 Subject: [PATCH 10/16] qcacmn: WMI CE buffer size update to 3520 Bytes Update WMI CE buffer size to 3520 Bytes to support large frame size on QCA6490. Change-Id: I1f3326f40bf18dda6010def57ea7f2e0961bc725 CRs-Fixed: 3036932 --- hif/src/ce/ce_assignment.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h index 14adecfeb3bf..38aa5ad02768 100644 --- a/hif/src/ce/ce_assignment.h +++ b/hif/src/ce/ce_assignment.h @@ -1263,7 +1263,7 @@ static struct CE_attr host_ce_config_wlan_qca6490[] = { /* target->host HTT + HTC control */ { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, /* target->host WMI */ - { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 3200, 64, NULL,}, + { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 3520, 64, NULL,}, /* host->target WMI */ { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,}, /* host->target HTT */ @@ -1288,7 +1288,7 @@ static struct CE_pipe_config target_ce_config_wlan_qca6490[] = { /* target->host HTT */ { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}, /* target->host WMI + HTC control */ - { /* CE2 */ 2, PIPEDIR_IN, 32, 3200, CE_ATTR_FLAGS, 0,}, + { /* CE2 */ 2, PIPEDIR_IN, 32, 3520, CE_ATTR_FLAGS, 0,}, /* host->target WMI */ { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,}, /* host->target HTT */ From db7818216695d449855be591f067cdeb2999e35a Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Wed, 10 Nov 2021 16:44:32 +0800 Subject: [PATCH 11/16] qcacmn: Always enable ce debug history for ce2/ce3 Current there is no ce debug history when testing perf build, so it is hard to debug some issue. Here it only enable ce2/ce3 on perf build, which keep only necessary log here. Change-Id: I29b998939cfa25f0547a9871721c6daeb0fdd961 CRs-Fixed: 3058740 --- hif/inc/hif.h | 31 +++++++++++++ hif/src/ce/ce_main.c | 107 +++++++++++++++++++++++++++++++++++++++---- hif/src/hif_main.h | 3 +- 3 files changed, 131 insertions(+), 10 deletions(-) diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 9786f4aa6d4e..e338ed73800c 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 @@ -1656,6 +1657,36 @@ ssize_t hif_ce_en_desc_hist(struct hif_softc *scn, const char *buf, size_t size); ssize_t hif_disp_ce_enable_desc_data_hist(struct hif_softc *scn, char *buf); ssize_t hif_dump_desc_event(struct hif_softc *scn, char *buf); +/** + * hif_ce_debug_history_prealloc_init() - alloc ce debug history memory + * + * alloc ce debug history memory with driver init, so such memory can + * be existed even after stop module. + * on ini value. + * + * Return: QDF_STATUS_SUCCESS for success, other for fail. + */ +QDF_STATUS hif_ce_debug_history_prealloc_init(void); +/** + * hif_ce_debug_history_prealloc_deinit() - free ce debug history memory + * + * free ce debug history memory when driver deinit. + * + * Return: QDF_STATUS_SUCCESS for success, other for fail. + */ +QDF_STATUS hif_ce_debug_history_prealloc_deinit(void); +#else +static inline +QDF_STATUS hif_ce_debug_history_prealloc_init(void) +{ + return QDF_STATUS_SUCCESS; +} + +static inline +QDF_STATUS hif_ce_debug_history_prealloc_deinit(void) +{ + return QDF_STATUS_SUCCESS; +} #endif/*#if defined(HIF_CONFIG_SLUB_DEBUG_ON)||defined(HIF_CE_DEBUG_DATA_BUF)*/ /** diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 9a0dd3f17d0e..1fc8bb03c7fe 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 @@ -1412,6 +1413,7 @@ QDF_STATUS alloc_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id) (uint8_t *)qdf_mem_malloc(CE_DEBUG_MAX_DATA_BUF_SIZE); if (!event->data) { hif_err_rl("ce debug data alloc failed"); + scn->hif_ce_desc_hist.data_enable[ce_id] = false; return QDF_STATUS_E_NOMEM; } } @@ -1451,7 +1453,72 @@ void free_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id) #ifndef HIF_CE_DEBUG_DATA_DYNAMIC_BUF #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF) -struct hif_ce_desc_event hif_ce_desc_history[CE_COUNT_MAX][HIF_CE_HISTORY_MAX]; +struct hif_ce_desc_event *hif_ce_desc_history[CE_COUNT_MAX]; + +/* define this variable for crashscope parse */ +uint32_t hif_ce_history_max = HIF_CE_HISTORY_MAX; + +/** + * hif_ce_debug_only_enable_ce2_ce3() - if only enable ce2/ce3 debug + * This is different config for perf/debug buid version. + * for debug build, it will enable ce history for all ce, but for + * perf build(if CONFIG_SLUB_DEBUG_ON is N), it only enable for + * ce2(wmi event) & ce3(wmi cmd) history. + * + * Return: true if only enable ce2/ce3 debug, otherwise false. + */ +#if defined(CONFIG_SLUB_DEBUG_ON) +static inline bool hif_ce_debug_only_enable_ce2_ce3(void) +{ + return false; +} +#else +static inline bool hif_ce_debug_only_enable_ce2_ce3(void) +{ + return true; +} +#endif + +QDF_STATUS hif_ce_debug_history_prealloc_deinit(void) +{ + int ce_id; + + for (ce_id = 0; ce_id < CE_COUNT_MAX; ce_id++) { + if (hif_ce_desc_history[ce_id]) { + qdf_mem_free(hif_ce_desc_history[ce_id]); + hif_ce_desc_history[ce_id] = NULL; + } + } + hif_debug("ce debug memory freed"); + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS hif_ce_debug_history_prealloc_init(void) +{ + int ce_id; + + hif_debug("alloc ce debug memory, only_ce2/ce3 %d", + hif_ce_debug_only_enable_ce2_ce3()); + for (ce_id = 0; ce_id < CE_COUNT_MAX; ce_id++) { + if (hif_ce_debug_only_enable_ce2_ce3() && + ce_id != CE_ID_2 && + ce_id != CE_ID_3) { + hif_ce_desc_history[ce_id] = NULL; + continue; + } + + hif_ce_desc_history[ce_id] = + qdf_mem_malloc(HIF_CE_HISTORY_MAX * + sizeof(struct hif_ce_desc_event)); + if (!hif_ce_desc_history[ce_id]) { + hif_ce_debug_history_prealloc_deinit(); + return QDF_STATUS_E_NOMEM; + } + } + + return QDF_STATUS_SUCCESS; +} /** * alloc_mem_ce_debug_history() - Allocate CE descriptor history @@ -1465,14 +1532,33 @@ alloc_mem_ce_debug_history(struct hif_softc *scn, unsigned int ce_id, uint32_t src_nentries) { struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; + QDF_STATUS status = QDF_STATUS_SUCCESS; - ce_hist->hist_ev[ce_id] = hif_ce_desc_history[ce_id]; - ce_hist->enable[ce_id] = 1; - - if (src_nentries) - alloc_mem_ce_debug_hist_data(scn, ce_id); - else + if (hif_ce_debug_only_enable_ce2_ce3() && + ce_id != CE_ID_2 && + ce_id != CE_ID_3) { + ce_hist->enable[ce_id] = false; ce_hist->data_enable[ce_id] = false; + return QDF_STATUS_SUCCESS; + } + + if (!hif_ce_desc_history[ce_id]) { + hif_err("prealloc memory failed"); + return QDF_STATUS_E_NOMEM; + } + ce_hist->hist_ev[ce_id] = hif_ce_desc_history[ce_id]; + ce_hist->enable[ce_id] = true; + + if (src_nentries) { + status = alloc_mem_ce_debug_hist_data(scn, ce_id); + if (status != QDF_STATUS_SUCCESS) { + ce_hist->enable[ce_id] = false; + ce_hist->hist_ev[ce_id] = NULL; + return status; + } + } else { + ce_hist->data_enable[ce_id] = false; + } return QDF_STATUS_SUCCESS; } @@ -1488,7 +1574,10 @@ static void free_mem_ce_debug_history(struct hif_softc *scn, unsigned int ce_id) { struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; - ce_hist->enable[ce_id] = 0; + if (!ce_hist->enable[ce_id]) + return; + + ce_hist->enable[ce_id] = false; if (ce_hist->data_enable[ce_id]) { ce_hist->data_enable[ce_id] = false; free_mem_ce_debug_hist_data(scn, ce_id); @@ -1538,7 +1627,7 @@ static void free_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id) free_mem_ce_debug_hist_data(scn, CE_id); } - ce_hist->enable[CE_id] = 0; + ce_hist->enable[CE_id] = false; qdf_mem_free(ce_hist->hist_ev[CE_id]); ce_hist->hist_ev[CE_id] = NULL; } diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index e6bcaaba16d7..5dbea7f4ab4a 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 @@ -166,7 +167,7 @@ struct hif_latency_detect { #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF) struct ce_desc_hist { qdf_atomic_t history_index[CE_COUNT_MAX]; - uint32_t enable[CE_COUNT_MAX]; + bool enable[CE_COUNT_MAX]; bool data_enable[CE_COUNT_MAX]; qdf_mutex_t ce_dbg_datamem_lock[CE_COUNT_MAX]; uint32_t hist_index; From da801d399a235b497f9b49f38e0c05eda65a9264 Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Mon, 24 Jan 2022 11:12:18 +0530 Subject: [PATCH 12/16] qcacmn: Check for EP vote access during prevent l1 state By the time driver reaches prevent l1 call there is chance of EP vote access getting disabled in-flight, to handle this skip vote request if EP vote access disabled in-flight. Change-Id: I91e1cdfc08492188ad8614339d5918c294bf10e4 CRs-Fixed: 3113786 --- hif/src/ipcie/if_ipci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hif/src/ipcie/if_ipci.c b/hif/src/ipcie/if_ipci.c index 084f749fb089..349ab37bcb29 100644 --- a/hif/src/ipcie/if_ipci.c +++ b/hif/src/ipcie/if_ipci.c @@ -894,6 +894,14 @@ int hif_prevent_link_low_power_states(struct hif_opaque_softc *hif) if (pld_is_pci_ep_awake(scn->qdf_dev->dev) == -ENOTSUPP) return 0; + if ((qdf_atomic_read(&scn->dp_ep_vote_access) == + HIF_EP_VOTE_ACCESS_DISABLE) && + (qdf_atomic_read(&scn->ep_vote_access) == + HIF_EP_VOTE_ACCESS_DISABLE)) { + hif_info_high("EP access disabled in flight skip vote"); + return 0; + } + start_time = curr_time = qdf_system_ticks_to_msecs(qdf_system_ticks()); while (pld_is_pci_ep_awake(scn->qdf_dev->dev) && curr_time <= start_time + EP_WAKE_RESET_DELAY_TIMEOUT_MS) { From 0d93cddae469fffd6db5fb7767de498271273520 Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Thu, 27 Jan 2022 18:19:28 +0530 Subject: [PATCH 13/16] qcacmn: Increase WMI CE buffer size to 3520 Bytes As part of new change to support large management frame the buffer size of CE2 has been increased to 3520 Bytes. Since CE2 & CE3 shares common EP in Fw because of which any changes in buffer size in CE2 need to have similar changes on CE3 as well. So to accommodate change increase CE3 buffer size. Change-Id: I8e558f11b1c44934cf6d64d1f3027f016d34f526 CRs-Fixed: 3118928 --- hif/src/ce/ce_assignment.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h index 38aa5ad02768..1d911f9a6391 100644 --- a/hif/src/ce/ce_assignment.h +++ b/hif/src/ce/ce_assignment.h @@ -1265,7 +1265,7 @@ static struct CE_attr host_ce_config_wlan_qca6490[] = { /* target->host WMI */ { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 3520, 64, NULL,}, /* host->target WMI */ - { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,}, + { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 3520, 0, NULL,}, /* host->target HTT */ { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, CE_HTT_H2T_MSG_SRC_NENTRIES_QCA6490, 256, 0, NULL,}, @@ -1290,7 +1290,7 @@ static struct CE_pipe_config target_ce_config_wlan_qca6490[] = { /* target->host WMI + HTC control */ { /* CE2 */ 2, PIPEDIR_IN, 32, 3520, CE_ATTR_FLAGS, 0,}, /* host->target WMI */ - { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,}, + { /* CE3 */ 3, PIPEDIR_OUT, 32, 3520, CE_ATTR_FLAGS, 0,}, /* host->target HTT */ { /* CE4 */ 4, PIPEDIR_OUT, 256, 256, (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,}, @@ -1313,9 +1313,9 @@ static struct CE_attr host_ce_config_wlan_qca6750[] = { /* target->host HTT + HTC control */ { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, /* target->host WMI */ - { /* CE2 */ CE_ATTR_FLAGS | CE_ATTR_HI_TASKLET, 0, 0, 2048, 32, NULL,}, + { /* CE2 */ CE_ATTR_FLAGS | CE_ATTR_HI_TASKLET, 0, 0, 3520, 32, NULL,}, /* host->target WMI */ - { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,}, + { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 3520, 0, NULL,}, /* host->target HTT */ { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,}, @@ -1343,9 +1343,9 @@ static struct CE_pipe_config target_ce_config_wlan_qca6750[] = { /* target->host HTT */ { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}, /* target->host WMI + HTC control */ - { /* CE2 */ 2, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}, + { /* CE2 */ 2, PIPEDIR_IN, 32, 3520, CE_ATTR_FLAGS, 0,}, /* host->target WMI */ - { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,}, + { /* CE3 */ 3, PIPEDIR_OUT, 32, 3520, CE_ATTR_FLAGS, 0,}, /* host->target HTT */ { /* CE4 */ 4, PIPEDIR_OUT, 256, 256, (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,}, From 34a825e043354d1db316134475912dab357d486e Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Fri, 21 Jan 2022 21:23:28 +0800 Subject: [PATCH 14/16] qcacmn: Populate additional params to CFR info for QCA6750 HAL changes to populate agc gain, CFO, rx_start_ts, mcs_rate and gi_type to CFR info for QCA6750. Change-Id: I164324b1e929399a8dacf88f3012970c65d5d653 CRs-Fixed: 3115256 --- hal/wifi3.0/qca6750/hal_6750_rx.h | 40 +++++++++++++++++++++++++++++++ target_if/cfr/src/target_if_cfr.c | 3 ++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/hal/wifi3.0/qca6750/hal_6750_rx.h b/hal/wifi3.0/qca6750/hal_6750_rx.h index 2563993227cf..386ad9441a82 100644 --- a/hal/wifi3.0/qca6750/hal_6750_rx.h +++ b/hal/wifi3.0/qca6750/hal_6750_rx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 @@ -462,6 +463,45 @@ void hal_rx_get_rtt_info_6750(void *rx_tlv, HAL_RX_GET(rx_tlv, PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, RESERVED_8); + ppdu_info->cfr_info.rx_start_ts = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_9_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RX_START_TS); + + ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t) + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_CFO_MEASUREMENT); + + ppdu_info->cfr_info.agc_gain_info0 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_1_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info1 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_2_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_UPPER_32); + + ppdu_info->cfr_info.agc_gain_info2 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_3_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info3 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_4_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_UPPER_32); + + ppdu_info->cfr_info.mcs_rate = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_MCS_RATE); + + ppdu_info->cfr_info.gi_type = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_GI_TYPE); } #endif #endif diff --git a/target_if/cfr/src/target_if_cfr.c b/target_if/cfr/src/target_if_cfr.c index dce4c5c37a7a..3601054b0d1c 100644 --- a/target_if/cfr/src/target_if_cfr.c +++ b/target_if/cfr/src/target_if_cfr.c @@ -227,7 +227,8 @@ void target_if_cfr_fill_header(struct csi_cfr_header *hdr, hdr->cmn.chip_type = CFR_CAPTURE_RADIO_HKV2; } else { if (target_type == TARGET_TYPE_QCN9000 || - target_type == TARGET_TYPE_QCA6490) + target_type == TARGET_TYPE_QCA6490 || + target_type == TARGET_TYPE_QCA6750) hdr->cmn.cfr_metadata_version = CFR_META_VERSION_7; else if ((target_type == TARGET_TYPE_QCA6018) || ((target_type == TARGET_TYPE_QCA5018) && (!is_rcc))) From a64c052bb25005b0cac9d11ec66106f4abc7aea8 Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Thu, 27 Jan 2022 15:17:01 +0530 Subject: [PATCH 15/16] qcacmn: Reduce the log level from error to info Reduce the log level of tx flow control threshold pool size from error to info. This is done to reduce the delay due to console logging in connection/roaming path. Change-Id: I5332bd179edc92006976a6421121cfce38b89b70 CRs-Fixed: 3119430 --- dp/wifi3.0/dp_tx_flow_control.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dp/wifi3.0/dp_tx_flow_control.c b/dp/wifi3.0/dp_tx_flow_control.c index 341e7945904d..41654aa1e7af 100644 --- a/dp/wifi3.0/dp_tx_flow_control.c +++ b/dp/wifi3.0/dp_tx_flow_control.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 @@ -73,9 +73,8 @@ dp_tx_initialize_threshold(struct dp_tx_desc_pool_s *pool, pool->stop_th[DP_TH_HI] = (pool->stop_th[DP_TH_BE_BK] * FL_TH_HI_PERCENTAGE) / 100; - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "%s: tx flow control threshold is set, pool size is %d", - __func__, flow_pool_size); + dp_info("tx flow control threshold is set, pool size is %d", + flow_pool_size); } /** From 8c4a382b14fa3802056661dae28297fc241ea612 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Tue, 15 Feb 2022 10:13:30 +0530 Subject: [PATCH 16/16] qcacmn: Dont add the wmi header size while allocating the wmi buff Currently whenever the wmi message is allocated the wmi header length is also added to check with against the max size supported by the firmware, there is no need to add the extra wmi header size as the max length shared by firmware has the wmi header size included. Below is the breakdown: Max CE2 transfer size is 2048 bytes HTC header is 8 bytes WMI header is 4 bytes Max payload can be (MAX CE2 Transfer size - (HTC header+ WMI header) (2048 - (8 +4)) = 2036 During the htc handshake this max wmi length is recevied by the host as 2040 bytes which is including the wmi header so host adding the extra 4 bytes is redundant and can be removed. HTC buffer->actual_length = 2036 + WMI(4) = 2040 bytes Change-Id: Ib958a938506c5c96347dec5304ca30aa8690d459 CRs-Fixed: 3130493 --- wmi/src/wmi_unified.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index e143c75344e2..7bed514cbdb7 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1649,7 +1649,10 @@ wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint32_t len, { wmi_buf_t wmi_buf; - if (roundup(len + sizeof(WMI_CMD_HDR), 4) > wmi_handle->max_msg_len) { + if (roundup(len, 4) > wmi_handle->max_msg_len) { + wmi_err("Invalid length %u (via %s:%u) max size: %u", + len, func_name, line_num, + wmi_handle->max_msg_len); QDF_ASSERT(0); return NULL; } @@ -1690,9 +1693,9 @@ wmi_buf_t wmi_buf_alloc_fl(wmi_unified_t wmi_handle, uint32_t len, { wmi_buf_t wmi_buf; - if (roundup(len + sizeof(WMI_CMD_HDR), 4) > wmi_handle->max_msg_len) { - QDF_DEBUG_PANIC("Invalid length %u (via %s:%u)", - len, func, line); + if (roundup(len, 4) > wmi_handle->max_msg_len) { + QDF_DEBUG_PANIC("Invalid length %u (via %s:%u) max size: %u", + len, func, line, wmi_handle->max_msg_len); return NULL; }