wlan: IBSS: Set BC key after Coalescing if security is enabled.
In Coalescing driver do DEL BSS and then ADD BSS with the new
BSSID. But if security is enabled no Broadcast key is added after
ADD BSS and thus firmware throws dpu error and ping does not work.
To solve this after Coalescing set the broadcast key.
CRs-Fixed: 859657
Change-Id: I78b89588804945b356b84ec7015636b5b569a918
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 59f0f19..48b0e1c 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -2042,6 +2042,7 @@
hdd_context_t *pHddCtx = (hdd_context_t*)pAdapter->pHddCtx;
v_MACADDR_t broadcastMacAddr = VOS_MAC_ADDR_BROADCAST_INITIALIZER;
struct cfg80211_bss *bss;
+ hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s: id %d, status %d, result %d",
__func__, pAdapter->dev->name, roamId, roamStatus, roamResult);
@@ -2106,6 +2107,35 @@
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"%s: NULL Bss Desc",__func__);
}
+
+ /* Set Broadcast key again in case IBSS_COALESCED as DEL BSS,
+ * in IBSS_COALESCED will remove the BC key.
+ */
+ if ((eCSR_ROAM_RESULT_IBSS_COALESCED == roamResult) &&
+ ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY
+ == pHddStaCtx->ibss_enc_key.encType
+ ||eCSR_ENCRYPT_TYPE_WEP104_STATICKEY
+ == pHddStaCtx->ibss_enc_key.encType
+ ||eCSR_ENCRYPT_TYPE_TKIP == pHddStaCtx->ibss_enc_key.encType
+ ||eCSR_ENCRYPT_TYPE_AES == pHddStaCtx->ibss_enc_key.encType ))
+ {
+ u8 grpmacaddr[WNI_CFG_BSSID_LEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
+ VOS_STATUS vosStatus;
+
+ pHddStaCtx->ibss_enc_key.keyDirection = eSIR_TX_RX;
+
+ memcpy(&pHddStaCtx->ibss_enc_key.peerMac,
+ grpmacaddr, WNI_CFG_BSSID_LEN);
+ hddLog(VOS_TRACE_LEVEL_INFO,
+ FL(" SET GTK in case of COALESCED"));
+ vosStatus = sme_RoamSetKey( WLAN_HDD_GET_HAL_CTX(pAdapter),
+ pAdapter->sessionId, &pHddStaCtx->ibss_enc_key, &roamId );
+ if ( VOS_STATUS_SUCCESS != vosStatus )
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ FL("sme_RoamSetKey failed, returned %d"),vosStatus);
+ }
+ }
break;
}
@@ -2382,6 +2412,8 @@
{
vosStatus = WLANTL_STAPtkInstalled( pHddCtx->pvosContext,
IBSS_BROADCAST_STAID);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ "WLAN TL STA GTK Installed for STAID=%d", IBSS_BROADCAST_STAID);
pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE;
}
else
@@ -2576,6 +2608,7 @@
||eCSR_ENCRYPT_TYPE_AES == pHddStaCtx->ibss_enc_key.encType )
{
pHddStaCtx->ibss_enc_key.keyDirection = eSIR_TX_RX;
+
memcpy(&pHddStaCtx->ibss_enc_key.peerMac,
pRoamInfo->peerMac, WNI_CFG_BSSID_LEN);
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index fc3cd22..afe457e 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -3198,7 +3198,7 @@
limLog(pMac, LOGP, FL("call to AllocateMemory failed for mlmSetKeysReq"));
goto end;
}
-
+ vos_mem_zero(pMlmSetKeysReq,sizeof(tLimMlmSetKeysReq));
pMlmSetKeysReq->edType = pSetContextReq->keyMaterial.edType;
pMlmSetKeysReq->numKeys = pSetContextReq->keyMaterial.numKeys;
if(pMlmSetKeysReq->numKeys > SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS)