summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwadesong <wadesong@codeaurora.org>2016-12-12 23:29:22 +0800
committerAshish kumar goswami <agoswa@codeaurora.org>2016-12-27 10:55:32 +0530
commit28e4ab83f20fde76a25268770feeffcd1b599d69 (patch)
treec06339c0978dae8dc8d0bdfcb4311b4da1f4bbde
parent93eb1744f7af2efb0eec9911c751f6e666b34ac4 (diff)
qcacld-2.0: Implement AP+STA mode DFS channel overriding
DFS channels should not be used to start AP when there is already a STA role running on the same card. Override AP channel with the one used by the concurrent STA to maintain SCC when AP DFS overriding takes place Change-Id: I0a50e0b84eb056e8e52abd99771f9580dfeaf974 CRs-Fixed: 1100277
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c27
-rw-r--r--CORE/SAP/src/sapFsm.c6
2 files changed, 31 insertions, 2 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index eed598d8ba50..5841f207827e 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -8630,6 +8630,32 @@ static int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
hdd_adapter_t *con_sap_adapter;
tsap_Config_t *sap_config, *con_sap_config;
int con_ch;
+ tHalHandle hHal;
+
+ /*
+ * Check if STA is running in a concurrent channel
+ */
+ hHal = WLAN_HDD_GET_HAL_CTX(adapter);
+ con_ch = sme_GetConcurrentOperationChannel(hHal);
+ sap_config = &adapter->sessionCtx.ap.sapConfig;
+
+ if (con_ch && vos_get_concurrency_mode() == VOS_STA_SAP) {
+
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
+ FL("concurrent STA role running on channel %d"), con_ch);
+
+ /*
+ * There is a STA role running on the same card, in that case
+ * DFS channel cannot be used by concurrent SAP.
+ * Try to use the same channel as the STA to achieve SCC
+ */
+ if (VOS_IS_DFS_CH(sap_config->channel)) {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
+ FL("SAP channel config overridden due to DFS channel not allowed in STA+SAP mode %d -> %d"),
+ sap_config->channel, con_ch);
+ sap_config->channel = con_ch;
+ }
+ }
/*
* Check if AP+AP case, once primary AP chooses a DFS
@@ -8642,7 +8668,6 @@ static int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
if (!con_sap_adapter)
return 0;
- sap_config = &adapter->sessionCtx.ap.sapConfig;
con_sap_config = &con_sap_adapter->sessionCtx.ap.sapConfig;
con_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index f6c57b530b31..9d0e462938fa 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -2686,7 +2686,8 @@ sapGotoChannelSel
sapContext->dfs_ch_disable = VOS_TRUE;
else if (VOS_IS_DFS_CH(sapContext->channel)) {
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_WARN,
- "In %s, DFS not supported in STA_AP Mode", __func__);
+ "In %s, DFS not supported in STA_AP Mode, chan=%d",
+ __func__, sapContext->channel);
return VOS_STATUS_E_ABORTED;
}
#endif
@@ -2708,6 +2709,9 @@ sapGotoChannelSel
if (con_ch)
{ /*if a valid channel is returned then use concurrent channel.
Else take whatever comes from configuartion*/
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
+ FL("Channel overridden due to MCC->SCC switch: %d -> %d"),
+ sapContext->channel, con_ch);
sapContext->channel = con_ch;
sme_SelectCBMode(hHal, sapContext->csrRoamProfile.phyMode,
con_ch, 0, &sapContext->vht_channel_width,