Ignore privacy bit changes in beacon when rsnie or wpaie is present

When Cisco 1262 Enterprise APs are configured with WPA2-PSK with
AES+TKIP pairwise ciphers and WEP-40 groups cipher, they do not
set the privacy bit in beacons (wpaie/rsnie is still present in
beacon), the privacy bit is set in probe and association
responses. Due to this anomaly we detect a change in AP capabilities
when we receive a beacon after association and disconnect from the
AP. Add a check to make sure that we can connect to such APs.

CRs-Fixed: 437442
Change-Id: I8e8c77cefc2a29fe87c70511c2fd489f01f8575e
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 80c260e..740915e 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -2154,6 +2154,24 @@
                           psessionEntry->currentOperChannel, newChannel);)
             return;
         }
+
+       /**
+        * When Cisco 1262 Enterprise APs are configured with WPA2-PSK with
+        * AES+TKIP Pairwise ciphers and WEP-40 Group cipher, they do not set
+        * the privacy bit in Beacons (wpa/rsnie is still present in beacons),
+        * the privacy bit is set in Probe and association responses.
+        * Due to this anomaly, we detect a change in
+        * AP capabilities when we receive a beacon after association and
+        * disconnect from the AP. The following check makes sure that we can
+        * connect to such APs
+        */
+        else if ((SIR_MAC_GET_PRIVACY(apNewCaps.capabilityInfo) == 0) &&
+                (pBeacon->rsnPresent || pBeacon->wpaPresent))
+        {
+            PELOGE(limLog(pMac, LOGE, FL("BSS Caps (Privacy) bit 0 in beacon,"
+                                         " but WPA or RSN IE present, Ignore Beacon!\n"));)
+            return;
+        }
         else
             apNewCaps.channelId = psessionEntry->currentOperChannel;
         palCopyMemory( pMac->hHdd, (tANI_U8 *) &apNewCaps.ssId,