summaryrefslogtreecommitdiff
path: root/CORE/SAP/src
diff options
context:
space:
mode:
authorChandrasekaran, Manishekar <cmshekar@qti.qualcomm.com>2015-02-09 14:16:02 +0530
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-02-17 17:13:16 +0530
commit74dfc6d808f8fdf7fcc924aa3fd2590daa0fe320 (patch)
treef9dc131d8dbff8804df7016106859e0685188a03 /CORE/SAP/src
parent0ad694f099d6e50349bbb84699d3429b4a21396a (diff)
qcacld: Prioritize non-DFS channels on radar detection
This change will prioritize non-DFS channels over DFS channels while selecting the new channel after radar detection. After radar detection, if DUT moves to DFS channel, the connection between the peer and DUT will get terminated due to CAC time. To avoid this, the new channel chosen will be a non-DFS channel. Only when non-DFS channels are unavailable, the DFS channels will be chosen as the new channel for SAP/P2P GO INI entry 'gPreferNonDfsChanOnRadar' can be used to select if this preference to select non-DFS channels is required. By default this entry will be zero, i.e., the channel selected can be either DFS or non-DFS. Only when this INI entry is set to its max value of 1, the prioritization of non-DFS channel will happen. Change-Id: I19fe9a47110ad99173a4594e50a3b02337587156 CRs-Fixed: 792996
Diffstat (limited to 'CORE/SAP/src')
-rw-r--r--CORE/SAP/src/sapFsm.c65
1 files changed, 45 insertions, 20 deletions
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 14eb4e322a89..ba176574f5eb 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -1362,8 +1362,12 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
{
v_U32_t random_byte = 0;
v_U8_t available_chnl_count = 0;
+ uint8_t avail_dfs_chan_count = 0;
+ uint8_t avail_non_dfs_chan_count = 0;
v_U8_t valid_chnl_count = 0;
v_U8_t availableChannels[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0,};
+ uint8_t avail_dfs_chan_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0,};
+ uint8_t avail_non_dfs_chan_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0,};
v_U8_t target_channel = 0;
v_BOOL_t isChannelNol = VOS_FALSE;
v_BOOL_t isOutOfRange = VOS_FALSE;
@@ -1671,30 +1675,51 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
* no channels are avaialbe
*/
if (available_chnl_count) {
- vos_rand_get_bytes(0, (v_U8_t*)&random_byte, 1);
- i = (random_byte + vos_timer_get_system_ticks()) %
- available_chnl_count;
- /* Random channel selection from available list */
- target_channel = availableChannels[i];
- pMac->sap.SapDfsInfo.new_chanWidth = chanWidth;
- pMac->sap.SapDfsInfo.new_cbMode = cbModeCurrent;
- VOS_TRACE(VOS_MODULE_ID_SAP,
- VOS_TRACE_LEVEL_INFO_LOW,
- FL("sapdfs: New CB mode = %d"),
- pMac->sap.SapDfsInfo.new_cbMode);
- VOS_TRACE(VOS_MODULE_ID_SAP,
- VOS_TRACE_LEVEL_INFO_LOW,
- FL("sapdfs: New Channel width = %d"),
- pMac->sap.SapDfsInfo.new_chanWidth);
- VOS_TRACE(VOS_MODULE_ID_SAP,
- VOS_TRACE_LEVEL_INFO_LOW,
- FL("sapdfs: target_channel = %d"), target_channel);
- }
- else {
+ for (i=0;i<available_chnl_count;i++) {
+ if (VOS_IS_DFS_CH(availableChannels[i])) {
+ avail_dfs_chan_list[avail_dfs_chan_count++] =
+ availableChannels[i];
+ } else {
+ avail_non_dfs_chan_list[avail_non_dfs_chan_count++] =
+ availableChannels[i];
+ }
+ }
+ } else {
VOS_TRACE(VOS_MODULE_ID_SAP,
VOS_TRACE_LEVEL_INFO_LOW,
FL("No target channel found"));
+ break;
}
+
+ vos_rand_get_bytes(0, (v_U8_t*)&random_byte, 1);
+ /* Give preference to non-DFS channel */
+ if (!pMac->f_prefer_non_dfs_on_radar) {
+ i = (random_byte + vos_timer_get_system_ticks()) %
+ available_chnl_count;
+ target_channel = availableChannels[i];
+ } else if (avail_non_dfs_chan_count) {
+ i = (random_byte + vos_timer_get_system_ticks()) %
+ avail_non_dfs_chan_count;
+ target_channel = avail_non_dfs_chan_list[i];
+ } else {
+ i = (random_byte + vos_timer_get_system_ticks()) %
+ avail_dfs_chan_count;
+ target_channel = avail_dfs_chan_list[i];
+ }
+
+ pMac->sap.SapDfsInfo.new_chanWidth = chanWidth;
+ pMac->sap.SapDfsInfo.new_cbMode = cbModeCurrent;
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_INFO_LOW,
+ FL("sapdfs: New CB mode = %d"),
+ pMac->sap.SapDfsInfo.new_cbMode);
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_INFO_LOW,
+ FL("sapdfs: New Channel width = %d"),
+ pMac->sap.SapDfsInfo.new_chanWidth);
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_INFO_LOW,
+ FL("sapdfs: target_channel = %d"), target_channel);
break;
} while(1); /* this loop will iterate at max 3 times */