wlan: mac: Add host scan mac-spoofing support

Extending the functionality of spoofing of mac addr
in host initiated scans. Now both FW initiated
scans and host initiated scans will be supported.

- Enable spoofing in LIM only after successfully configuring FW.
- Use spoofed mac addr provided by SME in probe req
- check for recieved probe rsp dst addr and replace with
  self sta mac addr.

Change-Id: Ia33dfd36325e8cc3b26ef7dc82e3144d5a0950d7
CRs-Fixed: 737889
diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
index 7c4cd6e..a6eb74c 100644
--- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
+++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
@@ -779,6 +779,21 @@
 
     } else
 #endif
+
+    if ((fc.type == SIR_MAC_MGMT_FRAME) &&
+        (fc.subType == SIR_MAC_MGMT_PROBE_RSP) &&
+        pMac->lim.isSpoofingEnabled)
+    {
+        limLog( pMac, LOG2, FL("Probe Rsp recieved with DA: "MAC_ADDRESS_STR
+            " and selfMac Addr:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
+                            MAC_ADDR_ARRAY(pMac->lim.gSelfMacAddr));
+        if (VOS_TRUE == vos_mem_compare((v_VOID_t*) pHdr->da,
+               (v_VOID_t*) pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN))
+        {
+            vos_mem_copy(pHdr->da, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN);
+        }
+    }
+
     /* Added For BT-AMP Support */
     if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
     {
@@ -2302,6 +2317,10 @@
        break;
     }
 
+    case WDA_SPOOF_MAC_ADDR_RSP:
+       limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval);
+       break;
+
     default:
         vos_mem_free((v_VOID_t*)limMsg->bodyptr);
         limMsg->bodyptr = NULL;