Merge "SCAN-OFFLOAD: SME changes for updating the default channel list."
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 64aa6b2..9cb86c7 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -4225,4 +4225,16 @@
tANI_U32 scanId;
} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
+typedef struct sSirUpdateChanParam
+{
+ tANI_U8 chanId;
+ tANI_U8 pwr;
+} tSirUpdateChanParam, *tpSirUpdateChanParam;
+
+typedef struct sSirUpdateChan
+{
+ tANI_U8 numChan;
+ tSirUpdateChanParam chanParam[1];
+} tSirUpdateChanList, *tpSirUpdateChanList;
+
#endif /* __SIR_API_H */
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 0dae6db..471e6f4 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -452,6 +452,45 @@
csrRoamDeInitGlobals(pMac);
return (status);
}
+
+eHalStatus csrUpdateChannelList(tCsrScanStruct *pScan)
+{
+ tSirUpdateChanList *pChanList;
+ tANI_U8 numChan = pScan->base20MHzChannels.numChannels;
+ tANI_U32 bufLen = sizeof(tSirUpdateChanList) +
+ (sizeof(tSirUpdateChanParam) * (numChan - 1));
+ vos_msg_t msg;
+ tANI_U8 i;
+
+ pChanList = (tSirUpdateChanList *) vos_mem_malloc(bufLen);
+ if (!pChanList)
+ {
+ VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+ "Failed to allocate memory for tSirUpdateChanList");
+ return eHAL_STATUS_FAILED_ALLOC;
+ }
+
+ msg.type = WDA_UPDATE_CHAN_LIST_REQ;
+ msg.reserved = 0;
+ msg.bodyptr = pChanList;
+ pChanList->numChan = numChan;
+ for (i = 0; i < pChanList->numChan; i++)
+ {
+ pChanList->chanParam[i].chanId = pScan->defaultPowerTable[i].chanId;
+ pChanList->chanParam[i].pwr = pScan->defaultPowerTable[i].pwr;
+ }
+
+ if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))
+ {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL,
+ "%s: Failed to post msg to WDA", __func__);
+ vos_mem_free(pChanList);
+ return eHAL_STATUS_FAILURE;
+ }
+
+ return eHAL_STATUS_SUCCESS;
+}
+
eHalStatus csrStart(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -484,6 +523,14 @@
smsLog(pMac, LOGW, " csrStart: Couldn't Init HO control blk ");
break;
}
+
+ if (pMac->fScanOffload)
+ {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+ "Scan offload is enabled, update default chan list");
+ status = csrUpdateChannelList(&pMac->scan);
+ }
+
}while(0);
#if defined(ANI_LOGDUMP)
csrDumpInit(pMac);
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 4b0d3f4..5fbd93b 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -6990,10 +6990,21 @@
void csrSetCfgValidChannelList( tpAniSirGlobal pMac, tANI_U8 *pChannelList, tANI_U8 NumChannels )
{
tANI_U32 dataLen = sizeof( tANI_U8 ) * NumChannels;
-
+ eHalStatus status;
ccmCfgSetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, pChannelList, dataLen, NULL, eANI_BOOLEAN_FALSE);
+ if (pMac->fScanOffload)
+ {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+ "Scan offload is enabled, update default chan list");
+ status = csrUpdateChannelList(&pMac->scan);
+ if (eHAL_STATUS_SUCCESS != status)
+ {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ "failed to update the supported channel list");
+ }
+ }
return;
}
diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h
index d3221a7..ae49b10 100644
--- a/CORE/SME/src/csr/csrInsideApi.h
+++ b/CORE/SME/src/csr/csrInsideApi.h
@@ -971,5 +971,8 @@
eHalStatus csrScanCreateEntryInScanCache(tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrBssid bssid, tANI_U8 channel);
+
+eHalStatus csrUpdateChannelList(tCsrScanStruct *pScan);
+
#endif