From 03103fd0700f237feec4b0b9dab9dadb4ea2406d Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 23 Jun 2017 10:48:52 -0700 Subject: [PATCH] qcacld-3.0: Add logic to force SCC in SAP+STA concurrency with ACS If STA is up & SAP is comings up on a ACS derived channel causing MCC, move SAP to the other band if DBS is supported. This logic is enabled only if gWlanMccToSccSwitchMode is set to QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION. Change-Id: I48d809f83921292f51ca1735bff4c4d6dd339975 CRs-Fixed: 2063060 --- core/hdd/src/wlan_hdd_hostapd.c | 17 ++++++++++++----- core/sap/src/sap_ch_select.c | 22 ++++++++++++++++++++-- core/sme/src/csr/csr_util.c | 4 ++-- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 777d9d9790dc..ca0633c8356f 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2703,6 +2703,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( struct hdd_context *hdd_ctx; hdd_station_ctx_t *hdd_sta_ctx; hdd_adapter_t *sta_adapter; + uint8_t temp_channel = 0; hdd_adapter_t *ap_adapter = wlan_hdd_get_adapter_from_vdev( psoc, vdev_id); if (!ap_adapter) { @@ -2750,11 +2751,17 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( !policy_mgr_is_safe_channel(psoc, hdd_sta_ctx->conn_info.operationChannel)) { if (policy_mgr_is_hw_dbs_capable(psoc)) { - if (WLAN_REG_IS_5GHZ_CH( - hdd_sta_ctx->conn_info.operationChannel)) - intf_ch = CDS_24_GHZ_CHANNEL_6; - else - intf_ch = CDS_5_GHZ_CHANNEL_36; + temp_channel = + policy_mgr_get_alternate_channel_for_sap(psoc); + if (temp_channel) { + intf_ch = temp_channel; + } else { + if (WLAN_REG_IS_5GHZ_CH( + hdd_sta_ctx->conn_info.operationChannel)) + intf_ch = CDS_24_GHZ_CHANNEL_6; + else + intf_ch = CDS_5_GHZ_CHANNEL_36; + } } else { hdd_debug("can't move sap to %d", hdd_sta_ctx->conn_info.operationChannel); diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index a24cb1dad955..e4529a3b8b06 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -2302,13 +2302,31 @@ uint8_t sap_select_channel(tHalHandle hal, ptSapContext sap_ctx, if (best_ch_num == SAP_CHANNEL_NOT_SELECTED) continue; - if (operating_band != eCSR_DOT11_MODE_11g) + if (operating_band != eCSR_DOT11_MODE_11g) { + QDF_TRACE(QDF_MODULE_ID_SAP, + QDF_TRACE_LEVEL_INFO_HIGH, + "operating_band %d", operating_band); continue; + } /* Give preference to Non-overlap channels */ if (false == sap_filter_over_lap_ch(sap_ctx, - spect_info->pSpectCh[count].chNum)) + spect_info->pSpectCh[count].chNum)) { + QDF_TRACE(QDF_MODULE_ID_SAP, + QDF_TRACE_LEVEL_INFO_HIGH, + "sap_filter_over_lap_ch is false"); continue; + } + + if (wlan_reg_is_dfs_ch(mac_ctx->pdev, + spect_info->pSpectCh[count].chNum) && + policy_mgr_disallow_mcc(mac_ctx->psoc, + spect_info->pSpectCh[count].chNum)) { + QDF_TRACE(QDF_MODULE_ID_SAP, + QDF_TRACE_LEVEL_INFO_HIGH, + "No DFS MCC"); + continue; + } if (spect_info->pSpectCh[count].weight_copy > sap_ctx->acsBestChannelInfo.weight) diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 2678406ac396..fade29ae548e 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -593,7 +593,7 @@ bool csr_scan_active_ll_remove_entry(struct sAniSirGlobal *mac_ctx, found_sme_cmd = &sme_cmd->Link; if (found_sme_cmd == entry) return true; - + return false; } @@ -1273,7 +1273,7 @@ uint16_t csr_check_concurrent_channel_overlap(tpAniSirGlobal mac_ctx, QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION) || (cc_switch_mode == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL))) { - if (!((intf_ch < 14 && sap_ch < 14) || + if (!((intf_ch <= 14 && sap_ch <= 14) || (intf_ch > 14 && sap_ch > 14))) intf_ch = 0; else if (cc_switch_mode ==