浏览代码

qcacmn: Add Max ML Peer ID support from target capability exchange

Add support to parse the Max ML Peer ID's parameter received from target
capabilities and update the parameter in global MLO context.

Change-Id: I4118d288a312dc4a18182caf765b0ded014b985a
CRs-Fixed: 3556542
Rakesh Boyina 2 年之前
父节点
当前提交
64dc3a4199

+ 8 - 0
target_if/init_deinit/src/init_event_handler.c

@@ -39,6 +39,7 @@
 #include <wlan_reg_ucfg_api.h>
 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
 #include <wlan_mlo_mgr_cmn.h>
+#include <wlan_mlo_mgr_ap.h>
 #include <wlan_mlo_mgr_setup.h>
 #endif
 #include <target_if_twt.h>
@@ -1213,6 +1214,13 @@ static int init_deinit_mlo_setup_comp_event_handler(ol_scn_t scn_handle,
 	pdev = wlan_objmgr_get_pdev_by_id(psoc, params.pdev_id,
 					  WLAN_INIT_DEINIT_ID);
 
+	if (mlo_ap_update_max_ml_peer_ids(
+				params.pdev_id, params.max_ml_peer_ids)
+			!= QDF_STATUS_SUCCESS) {
+		target_if_err("max_ml_peer_ids update failed for pdev_id: %d",
+			      params.pdev_id);
+	}
+
 	if (pdev) {
 		mlo_link_setup_complete(pdev, grp_id);
 		wlan_objmgr_pdev_release_ref(pdev, WLAN_INIT_DEINIT_ID);

+ 10 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_ap.h

@@ -524,6 +524,16 @@ QDF_STATUS mlme_set_aid(struct wlan_objmgr_vdev *vdev,
  */
 uint16_t wlan_mlme_get_aid_count(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * mlo_ap_update_max_ml_peer_ids() - public API to update max MLO peer ids
+ * @pdev_id: PDEV id
+ * @max_ml_peer_ids: maximum ml peer ids supported
+ *
+ * This function updated the maximum MLO peer ids supported for the psoc
+ */
+QDF_STATUS mlo_ap_update_max_ml_peer_ids(
+		uint32_t pdev_id, uint32_t max_ml_peer_ids);
+
 /**
  * mlo_ap_ml_peerid_alloc() - public API to allocate MLO peer id
  *

+ 28 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_ap.c

@@ -18,6 +18,7 @@
 /*
  * DOC: contains MLO manager ap related functionality
  */
+#include <qdf_module.h>
 #include "wlan_objmgr_vdev_obj.h"
 #include "wlan_mlo_mgr_ap.h"
 #include <wlan_mlo_mgr_cmn.h>
@@ -601,6 +602,33 @@ void mlo_ap_link_down_cmpl_notify(struct wlan_objmgr_vdev *vdev)
 	mlo_ap_vdev_detach(vdev);
 }
 
+QDF_STATUS
+mlo_ap_update_max_ml_peer_ids(uint32_t pdev_id, uint32_t max_ml_peer_ids)
+{
+	struct mlo_mgr_context *mlo_mgr_ctx = wlan_objmgr_get_mlo_ctx();
+	uint16_t max_mlo_peer_id_stale;
+
+	max_mlo_peer_id_stale = mlo_mgr_ctx->max_mlo_peer_id;
+
+	ml_peerid_lock_acquire(mlo_mgr_ctx);
+
+	/* Reset the value to default if max_ml_peer_ids received is "0" */
+	mlo_mgr_ctx->max_mlo_peer_id = max_ml_peer_ids ?
+				max_ml_peer_ids : MAX_MLO_PEER_ID;
+
+	mlo_info("max_ml_peer_ids update from: %d to: %d for pdev: %d",
+		 max_mlo_peer_id_stale,
+		 mlo_mgr_ctx->max_mlo_peer_id, pdev_id);
+
+	mlo_info("max_peer support from target obtained :%d", max_ml_peer_ids);
+
+	ml_peerid_lock_release(mlo_mgr_ctx);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+qdf_export_symbol(mlo_ap_update_max_ml_peer_ids);
+
 uint16_t mlo_ap_ml_peerid_alloc(void)
 {
 	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();

+ 2 - 0
wmi/inc/wmi_unified_11be_param.h

@@ -78,10 +78,12 @@ enum wmi_mlo_setup_status {
 /** struct wmi_mlo_setup_complete_params - MLO setup complete event params
  * @pdev_id: pdev id of radio on which this event is received
  * @status: status code
+ * @max_ml_peer_ids: Maximum ML Peer ID's
  */
 struct wmi_mlo_setup_complete_params {
 	uint32_t pdev_id;
 	enum wmi_mlo_setup_status status;
+	uint32_t max_ml_peer_ids;
 };
 
 /** enum wmi_mlo_teardown_status - Status code in WMI MLO teardown completion

+ 2 - 0
wmi/src/wmi_unified_11be_tlv.c

@@ -2136,6 +2136,8 @@ extract_mlo_setup_cmpl_event_tlv(struct wmi_unified *wmi_handle,
 	else
 		params->status = WMI_MLO_SETUP_STATUS_FAILURE;
 
+	params->max_ml_peer_ids = ev->max_ml_peer_ids;
+
 	return QDF_STATUS_SUCCESS;
 }