Sfoglia il codice sorgente

qcacld-3.0: Fix clang warning 'Wlogical-not-parentheses'

logical not is only applied to the left hand side of this
bitwise operator [-Werror,-Wlogical-not-parentheses]
           (!(ies->RSN.RSN_Cap[0] >> 7) & 0x1)))
            ^                           ~
csr_api_roam.c:14617:6: note: add parentheses after the '!' to
evaluate the bitwise operator first
           (!(ies->RSN.RSN_Cap[0] >> 7) & 0x1)))
            ^
             (                               )
csr_api_roam.c:14617:6: note: add parentheses around left hand
side expression to silence this warning
           (!(ies->RSN.RSN_Cap[0] >> 7) & 0x1)))
            ^
            (                          )

Change-Id: I489eba6a6265778346bb3b20832f92774a2d5e0e
CRs-Fixed: 2087302
Srinivas Girigowda 7 anni fa
parent
commit
6519b93735

+ 1 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -5444,7 +5444,7 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter,
 					dot11RSNIE.gp_cipher_suite);
 #ifdef WLAN_FEATURE_11W
 		*pMfpRequired = (dot11RSNIE.RSN_Cap[0] >> 6) & 0x1;
-		*pMfpCapable = (dot11RSNIE.RSN_Cap[0] >> 7) & 0x1;
+		*pMfpCapable = csr_is_mfpc_capable(&dot11RSNIE);
 #endif
 		/* Set the PMKSA ID Cache for this interface */
 		for (i = 0; i < dot11RSNIE.pmkid_count; i++) {

+ 18 - 2
core/sme/src/csr/csr_api_roam.c

@@ -14081,6 +14081,23 @@ static QDF_STATUS csr_set_ldpc_exception(tpAniSirGlobal mac_ctx,
 }
 
 #ifdef WLAN_FEATURE_11W
+/**
+ * csr_is_mfpc_capable() - is MFPC capable
+ * @ies: AP information element
+ *
+ * Return: true if MFPC capable, false otherwise
+ */
+bool csr_is_mfpc_capable(struct sDot11fIERSN *rsn)
+{
+	bool mfpc_capable = false;
+
+	if (rsn && rsn->present &&
+	    ((rsn->RSN_Cap[0] >> 7) & 0x01))
+		mfpc_capable = true;
+
+	return mfpc_capable;
+}
+
 /**
  * csr_set_mgmt_enc_type() - set mgmt enc type for PMF
  * @profile: roam profile
@@ -14098,8 +14115,7 @@ static void csr_set_mgmt_enc_type(tCsrRoamProfile *profile,
 		csr_join_req->MgmtEncryptionType = eSIR_ED_NONE;
 	if (profile->MFPEnabled &&
 	   !(profile->MFPRequired) &&
-	   ((ies->RSN.present) &&
-	   (!(ies->RSN.RSN_Cap[0] >> 7) & 0x1)))
+	   !csr_is_mfpc_capable(&ies->RSN))
 		csr_join_req->MgmtEncryptionType = eSIR_ED_NONE;
 }
 #else

+ 9 - 0
core/sme/src/csr/csr_inside_api.h

@@ -1089,3 +1089,12 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal mac_ctx,
 		bool reset_country);
 void csr_prune_channel_list_for_mode(tpAniSirGlobal pMac,
 				     tCsrChannel *pChannelList);
+
+#ifdef WLAN_FEATURE_11W
+bool csr_is_mfpc_capable(struct sDot11fIERSN *rsn);
+#else
+static inline bool csr_is_mfpc_capable(struct sDot11fIERSN *rsn)
+{
+	return false;
+}
+#endif

+ 1 - 1
core/sme/src/csr/csr_util.c

@@ -3348,7 +3348,7 @@ csr_is_pmf_capabilities_in_rsn_match(tHalHandle hHal,
 	if (pRSNIe && pFilterMFPEnabled && pFilterMFPCapable
 	    && pFilterMFPRequired) {
 		/* Extracting MFPCapable bit from RSN Ie */
-		apProfileMFPCapable = (pRSNIe->RSN_Cap[0] >> 7) & 0x1;
+		apProfileMFPCapable = csr_is_mfpc_capable(pRSNIe);
 		apProfileMFPRequired = (pRSNIe->RSN_Cap[0] >> 6) & 0x1;
 
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,