Browse Source

qcacld-3.0: Add host fixes related to EMLSR association

Add following host fixes related to EMLSR association.
1) Use phy cap get macro to extract EMLSR hw mode id.
2) Add logic to send EMLSR cap flag during vdev start.
3) Add logic to copy EML caps from assoc link common
info subfield to MLO peer assoc struct in order to
share EML caps to FW on both links via peer assoc.
4) Add checks to update EMLSR cap flag only if both
STA and AP support and advertise EMLSR mode.
5) Send EMLMR support flag along with EMLSR support
flag to FW as part of vdev set IE cmd for roaming
scenarios. Also, update common info length when EML
caps are present.

Change-Id: Ied2570d498a43adadd93899d4fdbe023d320676b
CRs-Fixed: 3235059
Gururaj Pandurangi 2 years ago
parent
commit
9605f2337c

+ 2 - 1
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -1527,7 +1527,8 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc,
 				sbs_mode = HW_MODE_SBS;
 		}
 		/* eMLSR mode */
-		if (hw_config_type == WMI_HW_MODE_EMLSR) {
+		if (WMI_BECAP_PHY_GET_HW_MODE_CFG(hw_config_type) ==
+				WMI_HW_MODE_EMLSR) {
 			tmp = &info->mac_phy_cap[j++];
 			policy_mgr_get_hw_mode_params(tmp, &mac1_ss_bw_info);
 			policy_mgr_update_mac_freq_info(psoc, pm_ctx,

+ 2 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -11132,8 +11132,8 @@ static int hdd_test_config_emlsr_mode(struct hdd_context *hdd_ctx,
 
 	cfg_val = nla_get_u8(attr);
 	hdd_info("11be op mode setting %d", cfg_val);
-	if (cfg_val) {
-		hdd_debug("eMLSR mode is enabled");
+	if (cfg_val && policy_mgr_is_hw_emlsr_capable(hdd_ctx->psoc)) {
+		hdd_debug("HW supports eMLSR mode, set caps");
 		ucfg_mlme_set_emlsr_mode_enabled(hdd_ctx->psoc, cfg_val);
 	} else {
 		hdd_debug("Default mode: MLMR, no action required");

+ 2 - 1
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -3712,6 +3712,7 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 			QDF_MAC_ADDR_FMT,
 			QDF_MAC_ADDR_REF(
 				pAddBssParams->staContext.staMac));
+			qdf_mem_free(pAddBssParams);
 			return QDF_STATUS_E_FAILURE;
 	}
 
@@ -3893,7 +3894,7 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 		}
 	}
 
-	lim_intersect_ap_emlsr_caps(pe_session, pAddBssParams, pAssocRsp);
+	lim_intersect_ap_emlsr_caps(mac, pe_session, pAddBssParams, pAssocRsp);
 
 	pAddBssParams->staContext.smesessionId =
 		pe_session->smeSessionId;

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

@@ -3882,11 +3882,44 @@ static void lim_fill_ml_info(struct cm_vdev_join_req *req,
 	}
 	pe_join_req->assoc_link_id = req->assoc_link_id;
 }
+
+static void lim_set_emlsr_caps(struct mac_context *mac_ctx,
+			       struct pe_session *session)
+{
+	bool emlsr_cap, emlsr_allowed, emlsr_enabled = false;
+
+	/* Check if HW supports eMLSR mode */
+	emlsr_cap = policy_mgr_is_hw_emlsr_capable(mac_ctx->psoc);
+	if (!emlsr_cap)
+		return;
+
+	/* Check if vendor command chooses eMLSR mode */
+	wlan_mlme_get_emlsr_mode_enabled(mac_ctx->psoc, &emlsr_enabled);
+
+	emlsr_allowed = emlsr_cap && emlsr_enabled;
+
+	if (emlsr_allowed) {
+		wlan_vdev_obj_lock(session->vdev);
+		wlan_vdev_mlme_cap_set(session->vdev, WLAN_VDEV_C_EMLSR_CAP);
+		wlan_vdev_obj_unlock(session->vdev);
+	} else {
+		wlan_vdev_obj_lock(session->vdev);
+		wlan_vdev_mlme_cap_clear(session->vdev, WLAN_VDEV_C_EMLSR_CAP);
+		wlan_vdev_obj_unlock(session->vdev);
+	}
+
+	pe_debug("eMLSR vdev cap: %d", emlsr_allowed);
+}
 #else
 static void lim_fill_ml_info(struct cm_vdev_join_req *req,
 			     struct join_req *pe_join_req)
 {
 }
+
+static void lim_set_emlsr_caps(struct mac_context *mac_ctx,
+			       struct pe_session *session)
+{
+}
 #endif
 
 static QDF_STATUS
@@ -4085,6 +4118,8 @@ lim_cm_handle_join_req(struct cm_vdev_join_req *req)
 		 pe_session->isOSENConnection,
 		 lim_is_fils_connection(pe_session));
 
+	lim_set_emlsr_caps(mac_ctx, pe_session);
+
 	status = lim_send_connect_req_to_mlm(pe_session);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		pe_err("Failed to send mlm req vdev id %d",

+ 10 - 5
core/mac/src/pe/lim/lim_prop_exts_utils.c

@@ -422,16 +422,21 @@ void lim_objmgr_update_emlsr_caps(struct wlan_objmgr_psoc *psoc,
 
 	ap_emlsr_cap =
 		assoc_rsp->mlo_ie.mlo_ie.eml_capabilities_info.emlsr_support;
-	if (!ap_emlsr_cap) {
-		pe_debug("eMLSR cap not present in assoc rsp");
+
+	if (!(wlan_vdev_mlme_cap_get(vdev, WLAN_VDEV_C_EMLSR_CAP) &&
+	    ap_emlsr_cap)) {
+		if (!wlan_vdev_mlme_cap_get(vdev, WLAN_VDEV_C_EMLSR_CAP) &&
+		    ap_emlsr_cap)
+			pe_debug("No eMLSR STA supp but recvd EML caps in assc rsp");
+		else
+			pe_debug("EML caps not present in assoc rsp");
 		wlan_vdev_obj_lock(vdev);
 		wlan_vdev_mlme_cap_clear(vdev, WLAN_VDEV_C_EMLSR_CAP);
 		wlan_vdev_obj_unlock(vdev);
 	} else {
-		wlan_vdev_obj_lock(vdev);
-		wlan_vdev_mlme_cap_set(vdev, WLAN_VDEV_C_EMLSR_CAP);
-		wlan_vdev_obj_unlock(vdev);
+		pe_debug("EML caps present in assoc rsp");
 	}
+
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 }
 #endif

+ 42 - 11
core/mac/src/pe/lim/lim_utils.c

@@ -8937,27 +8937,58 @@ void lim_update_stads_eht_bw_320mhz(struct pe_session *session,
 #endif
 
 #ifdef WLAN_FEATURE_11BE_MLO
-void lim_intersect_ap_emlsr_caps(struct pe_session *session,
+void lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
+				 struct pe_session *session,
 				 struct bss_params *add_bss,
 				 tpSirAssocRsp assoc_rsp)
 {
-	struct vdev_mlme_obj *mlme_obj;
+	struct wlan_mlo_peer_context *mlo_peer_ctx;
+	struct wlan_objmgr_peer *peer;
 
-	mlme_obj = wlan_vdev_mlme_get_cmpt_obj(session->vdev);
-	if (!mlme_obj) {
-		pe_err("vdev component object is NULL");
+	peer = wlan_objmgr_get_peer_by_mac(mac_ctx->psoc, add_bss->bssId,
+					   WLAN_LEGACY_MAC_ID);
+	if (!peer) {
+		pe_err("peer is null");
 		return;
 	}
 
-	if (wlan_vdev_mlme_cap_get(session->vdev, WLAN_VDEV_C_EMLSR_CAP)) {
-		add_bss->staContext.emlsr_support = true;
-		add_bss->staContext.link_id =
-		    assoc_rsp->mlo_ie.mlo_ie.link_id;
+	mlo_peer_ctx = peer->mlo_peer_ctx;
+	if (!mlo_peer_ctx) {
+		pe_err("mlo peer ctx is null");
+		wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
+		return;
+	}
+
+	if (!wlan_vdev_mlme_cap_get(session->vdev, WLAN_VDEV_C_EMLSR_CAP)) {
+		add_bss->staContext.emlsr_support = false;
+		wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
+		return;
+	}
+
+	if (wlan_vdev_mlme_is_mlo_link_vdev(session->vdev)) {
+		add_bss->staContext.emlsr_support =
+				mlo_peer_ctx->eml_caps.emlsr_support;
 		add_bss->staContext.emlsr_trans_timeout =
-		    assoc_rsp->mlo_ie.mlo_ie.eml_capabilities_info.transition_timeout;
+				mlo_peer_ctx->eml_caps.transition_timeout;
+		add_bss->staContext.link_id =
+				wlan_vdev_get_link_id(session->vdev);
 	} else {
-		add_bss->staContext.emlsr_support = false;
+		add_bss->staContext.emlsr_support = true;
+		add_bss->staContext.emlsr_trans_timeout =
+			assoc_rsp->mlo_ie.mlo_ie.eml_capabilities_info.transition_timeout;
+		add_bss->staContext.link_id =
+				assoc_rsp->mlo_ie.mlo_ie.link_id;
+
+		mlo_peer_ctx->eml_caps.emlsr_support =
+				add_bss->staContext.emlsr_support;
+		mlo_peer_ctx->eml_caps.transition_timeout =
+				add_bss->staContext.emlsr_trans_timeout;
 	}
+
+	wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_MAC_ID);
+	pe_debug("emlsr support: %d, link id: %d, transition timeout:%d",
+		 add_bss->staContext.emlsr_support, add_bss->staContext.link_id,
+		 add_bss->staContext.emlsr_trans_timeout);
 }
 #endif
 

+ 5 - 3
core/mac/src/pe/lim/lim_utils.h

@@ -2225,19 +2225,21 @@ lim_update_stads_eht_bw_320mhz(struct pe_session *session,
 #ifdef WLAN_FEATURE_11BE_MLO
 /**
  * lim_intersect_ap_emlsr_caps() - Intersect AP and self STA EHT capabilities
+ * @mac_ctx: Global MAC context
  * @session: pointer to PE session
  * @add_bss: pointer to ADD BSS params
- * @beacon: pointer to beacon
  * @assoc_rsp: pointer to assoc response
  *
  * Return: None
  */
-void lim_intersect_ap_emlsr_caps(struct pe_session *session,
+void lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
+				 struct pe_session *session,
 				 struct bss_params *add_bss,
 				 tpSirAssocRsp assoc_rsp);
 #else
 static inline void
-lim_intersect_ap_emlsr_caps(struct pe_session *session,
+lim_intersect_ap_emlsr_caps(struct mac_context *mac_ctx,
+			    struct pe_session *session,
 			    struct bss_params *add_bss,
 			    tpSirAssocRsp assoc_rsp)
 {

+ 3 - 17
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -9916,7 +9916,6 @@ populate_dot11f_mlo_caps(struct mac_context *mac_ctx,
 {
 	uint8_t *mld_addr;
 	uint8_t common_info_len = 0;
-	bool emlsr_cap, emlsr_enabled, emlsr_allowed = false;
 
 	mlo_ie->type = 0;
 	/* Common Info Length */
@@ -9930,26 +9929,13 @@ populate_dot11f_mlo_caps(struct mac_context *mac_ctx,
 	mlo_ie->bss_param_change_cnt_present = 0;
 	mlo_ie->medium_sync_delay_info_present = 0;
 
-	/* Check if HW supports eMLSR mode */
-	emlsr_cap = policy_mgr_is_hw_emlsr_capable(mac_ctx->psoc);
-
-	/* Check if vendor command chooses eMLSR mode */
-	wlan_mlme_get_emlsr_mode_enabled(mac_ctx->psoc, &emlsr_enabled);
-
-	emlsr_allowed = emlsr_cap && emlsr_enabled;
-
-	if (emlsr_allowed) {
-		wlan_vdev_obj_lock(session->vdev);
-		wlan_vdev_mlme_cap_set(session->vdev, WLAN_VDEV_C_EMLSR_CAP);
-		wlan_vdev_obj_unlock(session->vdev);
+	if (wlan_vdev_mlme_cap_get(session->vdev, WLAN_VDEV_C_EMLSR_CAP)) {
 		mlo_ie->eml_capab_present = 1;
+		mlo_ie->eml_capabilities_info.emlmr_support = 0;
 		mlo_ie->eml_capabilities_info.emlsr_support = 1;
+		common_info_len += WLAN_ML_BV_CINFO_EMLCAP_SIZE;
 	} else {
-		wlan_vdev_obj_lock(session->vdev);
-		wlan_vdev_mlme_cap_clear(session->vdev, WLAN_VDEV_C_EMLSR_CAP);
-		wlan_vdev_obj_unlock(session->vdev);
 		mlo_ie->eml_capab_present = 0;
-		mlo_ie->eml_capabilities_info.emlsr_support = 0;
 	}
 
 	mlo_ie->mld_capab_and_op_present = 1;

+ 0 - 4
core/wma/src/wma_mgmt.c

@@ -1385,10 +1385,6 @@ static void wma_set_mlo_capability(tp_wma_handle wma,
 			req->mlo_params.emlsr_trans_timeout =
 					params->emlsr_trans_timeout;
 		}
-		wma_debug("eMLSR support:%d, link_id:%d, transition timeout:%d",
-			  req->mlo_params.emlsr_support,
-			  req->mlo_params.ieee_link_id,
-			  req->mlo_params.emlsr_trans_timeout);
 	} else {
 		wma_debug("Peer MLO context is NULL");
 		req->mlo_params.mlo_enabled = false;