summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbings <bings@codeaurora.org>2019-04-22 14:53:18 +0800
committerbings <bings@codeaurora.org>2019-04-22 15:30:19 +0800
commit317a6bd0d3551be90cc06abdbaf1f92e9b98ccf8 (patch)
tree9237c85f452566cfa5f8f05dda823f4c73720a6a
parent1c783f10e0ab57f0a343e9de3edfc4881266b0ea (diff)
qcacld-2.0: Clear up DFS rules for multiple interfaces
Currently if STA connects to a DFS channel AP, SAP fails to start in non-DFS channel. To fix this issue, clear up DFS rules in sap_check_mcc_valid. For STA+SAP mode, if STA exists, SAP can't start in DFS channel. For SAP+SAP mode, DFS channel can't be selected if they work in MCC mode. Change-Id: I8697fe46b43b79f0380b18b1ebf919cbb318e97b CRs-Fixed: 2438589
-rw-r--r--CORE/SAP/src/sapFsm.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 254f5a1b7b7c..08a49ef178f9 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -2357,20 +2357,32 @@ static VOS_STATUS sap_check_mcc_valid(
/*
* 3. Don't support MCC on DFS channel.
*/
- if (chan_cnt > 0) {
- for (j = 0; j < chan_cnt; j++) {
- if (channels[j] != 0
- && vos_nv_getChannelEnabledState(channels[j])
- == NV_CHANNEL_DFS) {
- VOS_TRACE( VOS_MODULE_ID_SAP,
- VOS_TRACE_LEVEL_ERROR,
- "%s: dfs not support in MCC dfs chan %d"
- "(chan %d band %d)",
- __func__, channels[j], chan, band);
+ for (i = 0; i < session_count; i++) {
+ info = &sessions[i];
+ if (info->och != 0 &&
+ vos_nv_getChannelEnabledState(info->och) ==
+ NV_CHANNEL_DFS) {
+ if ((info->con_mode == VOS_STA_SAP_MODE ||
+ info->con_mode == VOS_P2P_GO_MODE) &&
+ info->och != chan) {
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_ERROR,
+ "SAP+SAP MCC DFS not support");
+ return VOS_STATUS_E_FAILURE;
+ }
+ if ((info->con_mode == VOS_STA_MODE ||
+ info->con_mode == VOS_P2P_CLIENT_MODE) &&
+ vos_nv_getChannelEnabledState(chan) ==
+ NV_CHANNEL_DFS
+ ) {
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_ERROR,
+ "STA+SAP SAP can't start in DFS ch");
return VOS_STATUS_E_FAILURE;
}
}
}
+
return VOS_STATUS_SUCCESS;
}