wlan: MAC: Add mac spoofing support based on random mac OUI
This is done as per need to spoof scans. Only FW initialted
scans will use spoofed mac addr after this.
Add a way to pass first 3 bytes (OUI bytes) of mac addr from
cfg80211 and randomly generate last three bytes in driver
and send them to FW. Disable spoof scanning by set first 3 bytes
of mac addr to 00:00:00.
Change-Id: I95ba3b32af3cdeacc2f0f781c3ab048de06f8dd6
CRs-Fixed: 731655
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 8a8e736..60a9e0f 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -5467,6 +5467,38 @@
return;
}
+static void
+__limProcessSmeSpoofMacAddrRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
+{
+ tSirMsgQ msg;
+ tpSpoofMacAddrReqParams pSpoofMacAddrParams;
+ tpSirSpoofMacAddrReq pSmeReq = (tpSirSpoofMacAddrReq) pMsgBuf;
+
+ pSpoofMacAddrParams = vos_mem_malloc(sizeof( tSpoofMacAddrReqParams));
+ if ( NULL == pSpoofMacAddrParams )
+ {
+ limLog( pMac, LOGP, FL("Unable to allocate memory for tDelStaSelfParams") );
+ return;
+ }
+
+ vos_mem_copy( pSpoofMacAddrParams->macAddr, pSmeReq->macAddr, sizeof(tSirMacAddr) );
+
+ msg.type = WDA_SPOOF_MAC_ADDR_REQ;
+ msg.reserved = 0;
+ msg.bodyptr = pSpoofMacAddrParams;
+ msg.bodyval = 0;
+
+ limLog(pMac, LOG1, FL("sending SIR_HAL_SPOOF_MAC_ADDR_REQ msg to HAL"));
+ MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type));
+
+ if(eSIR_SUCCESS != wdaPostCtrlMsg(pMac, &msg))
+ {
+ limLog(pMac, LOGP, FL("wdaPostCtrlMsg failed for SIR_HAL_SPOOF_MAC_ADDR_REQ"));
+ vos_mem_free(pSpoofMacAddrParams);
+ }
+ return;
+}
+
/**
* limProcessSmeReqMessages()
*
@@ -5802,6 +5834,10 @@
limSendSetTxPowerReq(pMac, pMsgBuf);
break ;
+ case eWNI_SME_MAC_SPOOF_ADDR_IND:
+ __limProcessSmeSpoofMacAddrRequest(pMac, pMsgBuf);
+ break ;
+
default:
vos_mem_free((v_VOID_t*)pMsg->bodyptr);
pMsg->bodyptr = NULL;