diff options
| author | Peng Xu <pxu@qca.qualcomm.com> | 2014-08-27 17:29:23 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-08-29 15:50:30 -0700 |
| commit | 65751509f6367e1a7daafb11d42e3be51ef95eca (patch) | |
| tree | 5a3af641c1c31c667a1fbdb88a3f92b65c29b6c3 | |
| parent | 930bb25e15ea6da132c3706c15feed7e07cba483 (diff) | |
qca-cld:sap: Fix ACS and OBSS coex issue
After ACS picks a channel, send channel change event to hostapd,
and for HT40 mode, add code for selecting secondary channel.
Change-Id: Ia040480267959907be74d9dca953a68d59fe4404
CRs-fixed: 714883
| -rw-r--r-- | CORE/SAP/src/sapChSelect.c | 40 | ||||
| -rw-r--r-- | CORE/SAP/src/sapFsm.c | 15 |
2 files changed, 53 insertions, 2 deletions
diff --git a/CORE/SAP/src/sapChSelect.c b/CORE/SAP/src/sapChSelect.c index 95cbf9eed8b4..7ab4756b1f80 100644 --- a/CORE/SAP/src/sapChSelect.c +++ b/CORE/SAP/src/sapChSelect.c @@ -2089,7 +2089,8 @@ void sapSortChlWeightHT40_24G(tSapChSelSpectInfo *pSpectInfoParams) else { pSpectInfo[j+4].weight = tmpWeight1; - pSpectInfo[j].weight = ACS_WEIGHT_MAX; + /* for secondary channel selection */ + pSpectInfo[j].weight = ACS_WEIGHT_MAX - 1; pSpectInfo[j+8].weight = ACS_WEIGHT_MAX; } } @@ -2099,7 +2100,8 @@ void sapSortChlWeightHT40_24G(tSapChSelSpectInfo *pSpectInfoParams) { pSpectInfo[j+4].weight = tmpWeight2; pSpectInfo[j].weight = ACS_WEIGHT_MAX; - pSpectInfo[j+8].weight = ACS_WEIGHT_MAX; + /* for secondary channel selection */ + pSpectInfo[j+8].weight = ACS_WEIGHT_MAX - 1; } else { @@ -2615,6 +2617,40 @@ v_U8_t sapSelectChannel(tHalHandle halHandle, ptSapContext pSapCtx, tScanResult pSapCtx, pSpectInfoParams); #endif + /* determine secondary channel for 2.4G channel 5, 6, 7 in HT40 */ + if ((operatingBand == RF_SUBBAND_2_4_GHZ) && (chWidth == CHWIDTH_HT40) && + (bestChNum >= 5) && (bestChNum <= 7)) { + int weight_below, weight_above, i; + tSmeConfigParams *pSmeConfig; + tSapSpectChInfo *pSpectInfo; + + weight_below = weight_above = ACS_WEIGHT_MAX; + pSpectInfo = pSpectInfoParams->pSpectCh; + + for (i = 0; i < pSpectInfoParams->numSpectChans ; i++) { + if (pSpectInfo[i].chNum == (bestChNum - 4)) + weight_below = pSpectInfo[i].weight; + + if (pSpectInfo[i].chNum == (bestChNum + 4)) + weight_above = pSpectInfo[i].weight; + } + + pSmeConfig = vos_mem_malloc(sizeof(*pSmeConfig)); + if (NULL != pSmeConfig) { + sme_GetConfigParam(halHandle, pSmeConfig); + + if (weight_below < weight_above) + pSmeConfig->csrConfig.channelBondingMode24GHz = + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; + else + pSmeConfig->csrConfig.channelBondingMode24GHz = + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; + + sme_UpdateConfig(halHandle, pSmeConfig); + vos_mem_free(pSmeConfig); + } + } + // Free all the allocated memory sapChanSelExit(pSpectInfoParams); diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index eec80fa78487..dab13f174f15 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -2542,6 +2542,21 @@ sapFsm sapContext->csrRoamProfile.ChannelInfo.numOfChannels = 1; sapContext->csrRoamProfile.ChannelInfo.ChannelList = &sapContext->csrRoamProfile.operationChannel; sapContext->csrRoamProfile.operationChannel = (tANI_U8)sapContext->channel; + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + "%s: notify hostapd about channel selection: %d", + __func__, sapContext->channel); + if (sapContext->apAutoChannelSelection && + (sapContext->csrRoamProfile.phyMode == + eSAP_DOT11_MODE_11n || + sapContext->csrRoamProfile.phyMode == + eSAP_DOT11_MODE_11n_ONLY)) { + tSap_Event sapApAppEvent; + sapApAppEvent.sapHddEventCode = eSAP_CHANNEL_CHANGE_EVENT; + sapApAppEvent.sapevt.sapChannelChange.operatingChannel = + sapContext->channel; + (*sapContext->pfnSapEventCallback) (&sapApAppEvent, + sapContext->pUsrContext); + } vosStatus = sapGotoStarting( sapContext, sapEvent, eCSR_BSS_TYPE_INFRA_AP); } else |
