From b63d131e44ea71195e946fccb51d8bee74423928 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Mon, 6 Jul 2020 17:17:13 +0530 Subject: [PATCH] qcacld-3.0: Change uint8_t to qdf_freq_t to hold NAN frequency Currently, SAP has to be moved to NAN channel once NAN enable is successful. The frequency is copied to a uint8_t variable but it can't hold the frequency as the value would be more than 2412. It was initially declared to hold channel number. Change the variable to qdf_freq_t to hold the frequency. Also, move the SAP to NAN 2.4GHz channel in non-DBS platforms. Change-Id: I27186c3a5915db549336537702287ee67cdce011 CRs-Fixed: 2729991 --- .../policy_mgr/src/wlan_policy_mgr_action.c | 20 +++++++++++-------- .../policy_mgr/src/wlan_policy_mgr_core.c | 5 +++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index abac2ce2d2be..e523c672171d 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1680,7 +1680,8 @@ void policy_mgr_nan_sap_post_enable_conc_check(struct wlan_objmgr_psoc *psoc) { struct policy_mgr_psoc_priv_obj *pm_ctx; struct policy_mgr_conc_connection_info *sap_info = NULL; - uint8_t nan_freq_2g, nan_freq_5g, i; + uint8_t i; + qdf_freq_t nan_freq_2g, nan_freq_5g; QDF_STATUS status; pm_ctx = policy_mgr_get_context(psoc); @@ -1720,23 +1721,26 @@ void policy_mgr_nan_sap_post_enable_conc_check(struct wlan_objmgr_psoc *psoc) policy_mgr_err("wait for event failed, still continue with channel switch"); } - policy_mgr_debug("Force SCC for NAN+SAP Ch freq: %d", - WLAN_REG_IS_5GHZ_CH_FREQ(sap_info->freq) ? - nan_freq_5g : nan_freq_2g); if (pm_ctx->hdd_cbacks.wlan_hdd_set_sap_csa_reason) pm_ctx->hdd_cbacks.wlan_hdd_set_sap_csa_reason(psoc, sap_info->vdev_id, CSA_REASON_CONCURRENT_NAN_EVENT); - if (WLAN_REG_IS_5GHZ_CH_FREQ(sap_info->freq)) { + /* SAP should be moved to 2g NAN channel on non-DBS platforms */ + if (!ucfg_is_nan_dbs_supported(pm_ctx->psoc) || + WLAN_REG_IS_24GHZ_CH_FREQ(sap_info->freq)) { + policy_mgr_debug("Force SCC for NAN+SAP Ch freq: %d", + nan_freq_2g); policy_mgr_change_sap_channel_with_csa(psoc, sap_info->vdev_id, - nan_freq_5g, + nan_freq_2g, policy_mgr_get_ch_width( sap_info->bw), true); - } else { + } else if (nan_freq_5g && WLAN_REG_IS_5GHZ_CH_FREQ(sap_info->freq)) { + policy_mgr_debug("Force SCC for NAN+SAP Ch freq: %d", + nan_freq_5g); policy_mgr_change_sap_channel_with_csa(psoc, sap_info->vdev_id, - nan_freq_2g, + nan_freq_5g, policy_mgr_get_ch_width( sap_info->bw), true); diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 1a6551aacbfc..5d3006ace0f8 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -1089,6 +1089,11 @@ static uint32_t policy_mgr_dump_current_concurrency_two_connection( count += strlcat(cc_mode, "+NDI", length); break; + case PM_NAN_DISC_MODE: + count = policy_mgr_dump_current_concurrency_one_connection( + cc_mode, length); + count += strlcat(cc_mode, "+NAN Disc", length); + break; default: policy_mgr_err("unexpected mode %d", mode); break;