wlan: Update SME scan cache with PNO candidate information.
Update SME scan cache with candidate information passed in
network found indication from firmware.
CRs-Fixed: 484419
Change-Id: I32bf3cd9e0a7cf2c94a62b8427ede8387a97a4f6
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi.h b/CORE/WDI/CP/inc/wlan_qct_wdi.h
index 5c33b34..f32dfa2 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi.h
@@ -510,9 +510,11 @@
typedef struct
{
/* Network that was found with the highest RSSI*/
- WDI_MacSSid ssId;
+ WDI_MacSSid ssId;
/* Indicates the RSSI */
- wpt_uint8 rssi;
+ wpt_uint8 rssi;
+ wpt_uint16 frameLength;
+ wpt_uint8 *pData;
} WDI_PrefNetworkFoundInd;
#endif // FEATURE_WLAN_SCAN_PNO
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index db4f2d9..0247e8b 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -24275,8 +24275,9 @@
WDI_EventInfoType* pEventData
)
{
- WDI_LowLevelIndType wdiInd;
- tPrefNetwFoundInd prefNetwFoundInd = {{0}};
+ WDI_LowLevelIndType wdiInd;
+ tpPrefNetwFoundParams pNetwFoundParams;
+ wpt_uint32 msgsize;
/*-------------------------------------------------------------------------
@@ -24294,26 +24295,35 @@
/*-------------------------------------------------------------------------
Extract indication and send it to UMAC
-------------------------------------------------------------------------*/
- wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
- pEventData->pEventData,
- sizeof(tPrefNetwFoundParams));
+ pNetwFoundParams = (tpPrefNetwFoundParams)(pEventData->pEventData);
+
+ msgsize = sizeof(tPrefNetwFoundParams) + pNetwFoundParams->frameLength;
+ wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.pData =
+ (wpt_uint8 *)wpalMemoryAllocate(msgsize);
+
+ if (NULL == wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.pData)
+ {
+ WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
+ "%s: fail to allocate memory", __func__);
+ return WDI_STATUS_MEM_FAILURE;
+ }
+
+ wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
+ (pNetwFoundParams->ssId.length < 32 )?
+ pNetwFoundParams->ssId.length : 32;
+ wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
+ pNetwFoundParams->ssId.ssId,
+ wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
+ wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi = pNetwFoundParams->rssi;
+ wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.frameLength =
+ pNetwFoundParams->frameLength;
+ wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.pData,
+ (wpt_uint8 *)pEventData->pEventData + sizeof(tPrefNetwFoundParams),
+ pNetwFoundParams->frameLength);
/*Fill in the indication parameters*/
wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
- wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
-
- wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
- (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
- prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
-
- wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
- prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
- wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
-
- wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
- prefNetwFoundInd.prefNetwFoundParams.rssi;
-
// DEBUG
WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
"[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",