Wlan: Ignore security mismatch during WPS registartion

During WPS registration process the psession encryption type is 0.
Now if AP's beacon have RSN IE, while processing beacons security
mismatch is detected and DUT sends unicast probe request without
WPS IE.

To avoid this ignore security mismatch during WPS registartion.

Change-Id: Ic1b4de116ec6a99749ec3d8ba28b29d52190c344
CRs-Fixed: 967553
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index aa2fac1..47ca7fd 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -1041,6 +1041,7 @@
     tANI_U8             dot11mode;              // to support BT-AMP     
     tVOS_CON_MODE       staPersona;             //Persona
     tANI_BOOLEAN        bOSENAssociation;       //HS2.0
+    tANI_BOOLEAN        bWPSAssociation;       //WPS
     ePhyChanBondState   cbMode;                 // Pass CB mode value in Join.
 
     /*This contains the UAPSD Flag for all 4 AC
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index 223034d..bd9f228 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -92,6 +92,7 @@
     tSirNwType              nwType;
     tpSirSmeStartBssReq     pLimStartBssReq;        //handle to smestart bss req
     tANI_BOOLEAN            bOSENAssociation;       //handle to OSEN assoc req
+    tANI_BOOLEAN            bWPSAssociation;        //WPS Registration
     tpSirSmeJoinReq         pLimJoinReq;            // handle to sme join req
     tpSirSmeJoinReq         pLimReAssocReq;         //handle to sme reassoc req
     tpLimMlmJoinReq         pLimMlmJoinReq;         //handle to MLM join Req
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 87d921d..911441d 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -1787,9 +1787,10 @@
                   pBeacon->capabilityInfo.privacy, pBeacon->wpaPresent,
                                                          pBeacon->rsnPresent);
     limLog(pMac, LOG1,
-            FL("pSession:: Privacy :%d EncyptionType: %d"),
+            FL("pSession:: Privacy :%d EncyptionType: %d WPS %d OSEN %d"),
                   SIR_MAC_GET_PRIVACY(pSession->limCurrentBssCaps),
-                                               pSession->encryptType);
+                       pSession->encryptType, pSession->bWPSAssociation,
+                       pSession->bOSENAssociation);
 
     /* This is handled by sending probe req due to IOT issues so return TRUE
      */
@@ -1831,13 +1832,18 @@
      * in beacon. Therefore no need to
      * check for security type in case
      * OSEN session.
+     * For WPS registration session no need to detect
+     * security mismatch as it wont match and
+     * driver may end up sending probe request without
+     * WPS IE during WPS registartion process.
      */
     /*TODO: AP capability mismatch
      * is not checked here because
      * no logic for beacon parsing
      * is avilable for HS2.0.
      */
-    if (pSession->bOSENAssociation)
+    if (pSession->bOSENAssociation ||
+             pSession->bWPSAssociation)
         return eSIR_TRUE;
 
     return eSIR_FALSE;
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 33ad3b6..4dcf9cf 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -1854,6 +1854,7 @@
         psessionEntry->limWmeEnabled = pSmeJoinReq->isWMEenabled;
         psessionEntry->limQosEnabled = pSmeJoinReq->isQosEnabled;
         psessionEntry->bOSENAssociation = pSmeJoinReq->bOSENAssociation;
+        psessionEntry->bWPSAssociation = pSmeJoinReq->bWPSAssociation;
 
         /* Store vendor specfic IE for CISCO AP */
         ieLen = (pSmeJoinReq->bssDescription.length +
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index 6410182..71da217 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -976,6 +976,14 @@
         return eSIR_FAILURE;
     }
 
+    pJoinReq->bWPSAssociation = *pBuf++;
+    len--;
+    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
+    {
+         limLog(pMac, LOGE, FL("remaining len %d is too short"), len);
+         return eSIR_FAILURE;
+    }
+
     // Extract cbMode
     pJoinReq->cbMode = *pBuf++;
     len--;
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 57b58fb..1e78c64 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -13196,6 +13196,8 @@
         pBuf++;
         *pBuf = (tANI_U8)pProfile->bOSENAssociation;
         pBuf++;
+        *pBuf = (tANI_U8)pProfile->bWPSAssociation;
+        pBuf++;
         //CBMode
         *pBuf = (tANI_U8)pSession->bssParams.cbMode;
         pBuf++;