Forráskód Böngészése

qcacld-3.0: Add MBO IE in assoc frame based on MFPC

In OCE 4.2.1, REF AP sets MFPR = 0 and MFPC = 1, DUT STA
set MFPR = 0 and MFPC = 1 by default. The current driver
only add MBO IE when MFPR = 1 and MPFC = 1. Then the test
failed because of no MBO IE in DUT assoc request frame.

Driver needs to add MBO IE when MFPC = 1 in STA and AP
based on test plan spec. Add new API lim_get_bss_rmf_capable
to check MFPC and required mgmt cipher.

Change-Id: I54aaa096393702154d1d0df218ba334eda80b0aa
CRs-Fixed: 2604189
Liangwei Dong 5 éve
szülő
commit
dc8baf36c3

+ 33 - 0
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -1204,6 +1204,39 @@ static void lim_set_rmf_enabled(struct mac_context *mac,
 		 csr_join_req->vdev_id, session->limRmfEnabled,
 		 rsn_caps);
 }
+
+bool lim_get_bss_rmf_capable(struct mac_context *mac,
+			     struct pe_session *session)
+{
+	struct wlan_objmgr_vdev *vdev;
+	uint16_t rsn_caps;
+	bool peer_rmf_capable = false;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc,
+						    session->vdev_id,
+						    WLAN_LEGACY_SME_ID);
+	if (!vdev) {
+		pe_err("Invalid vdev");
+		return false;
+	}
+	rsn_caps = (uint16_t)wlan_crypto_get_param(vdev,
+						   WLAN_CRYPTO_PARAM_RSN_CAP);
+	if (wlan_crypto_vdev_has_mgmtcipher(
+				vdev,
+				(1 << WLAN_CRYPTO_CIPHER_AES_GMAC) |
+				(1 << WLAN_CRYPTO_CIPHER_AES_GMAC_256) |
+				(1 << WLAN_CRYPTO_CIPHER_AES_CMAC)) &&
+	    (rsn_caps & WLAN_CRYPTO_RSN_CAP_MFP_ENABLED))
+		peer_rmf_capable = true;
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+
+	pe_debug("vdev %d peer_rmf_capable %d rsn_caps 0x%x",
+		 session->vdev_id, peer_rmf_capable,
+		 rsn_caps);
+
+	return peer_rmf_capable;
+}
 #else
 /**
  * lim_set_rmf_enabled() - set rmf enabled

+ 4 - 8
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -1879,7 +1879,7 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 	enum rateid min_rid = RATEID_DEFAULT;
 	uint8_t *mbo_ie = NULL, *adaptive_11r_ie = NULL, *vendor_ies = NULL;
 	uint8_t mbo_ie_len = 0, adaptive_11r_ie_len = 0, rsnx_ie_len = 0;
-	struct wlan_objmgr_peer *peer;
+	bool bss_mfp_capable;
 
 	if (!pe_session) {
 		pe_err("pe_session is NULL");
@@ -2250,18 +2250,14 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 			 mbo_ie_len, is_open_auth);
 
 		if (!is_open_auth) {
-			peer = wlan_objmgr_get_peer_by_mac(
-						mac_ctx->psoc,
-						mlm_assoc_req->peerMacAddr,
-						WLAN_MBO_ID);
-			if (peer && !mlme_get_peer_pmf_status(peer)) {
+			bss_mfp_capable =
+				lim_get_bss_rmf_capable(mac_ctx, pe_session);
+			if (!bss_mfp_capable) {
 				pe_debug("Peer doesn't support PMF, Don't add MBO IE");
 				qdf_mem_free(mbo_ie);
 				mbo_ie = NULL;
 				mbo_ie_len = 0;
 			}
-			if (peer)
-				wlan_objmgr_peer_release_ref(peer, WLAN_MBO_ID);
 		}
 	}
 

+ 20 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -921,6 +921,19 @@ void lim_merge_extcap_struct(tDot11fIEExtCap *dst, tDot11fIEExtCap *src,
  * Return: none
  */
 void lim_del_pmf_sa_query_timer(struct mac_context *mac_ctx, struct pe_session *pe_session);
+
+/**
+ * lim_get_bss_rmf_capable() - get rmf capable - MFPC
+ * @mac: mac context
+ * @session: pe session
+ *
+ * Get intersection of local & peer (BSS) RSN caps
+ * and check MFPC bit.
+ *
+ * Return: bool
+ */
+bool lim_get_bss_rmf_capable(struct mac_context *mac,
+			     struct pe_session *session);
 #else
 /**
  * lim_del_pmf_sa_query_timer() - This function deletes SA query timer
@@ -935,6 +948,13 @@ static inline void
 lim_del_pmf_sa_query_timer(struct mac_context *mac_ctx, struct pe_session *pe_session)
 {
 }
+
+static inline
+bool lim_get_bss_rmf_capable(struct mac_context *mac,
+			     struct pe_session *session)
+{
+	return false;
+}
 #endif
 
 /**