Quellcode durchsuchen

qcacmn: add critical update feature

Add the code logic to save the BSS parameters change count (BPCC)
for critical update feature.

Change-Id: I3fafd44af8661d1dcf5d7bbde84d2729d390a44c
CRs-Fixed: 3324174
Paul Zhang vor 2 Jahren
Ursprung
Commit
37b58d0525

+ 2 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -36,6 +36,7 @@
 #endif
 #include <wlan_utility.h>
 #include <wlan_mlo_mgr_sta.h>
+#include "wlan_mlo_mgr_op.h"
 #include <wlan_objmgr_vdev_obj.h>
 #include "wlan_psoc_mlme_api.h"
 
@@ -601,6 +602,7 @@ static void cm_create_bss_peer(struct cnx_mgr *cm_ctx,
 				      &eht_capab);
 	if (eht_capab) {
 		cm_set_vdev_link_id(cm_ctx, req);
+		wlan_mlo_init_cu_bpcc(cm_ctx->vdev);
 		mld_mac = cm_get_bss_peer_mld_addr(req);
 		is_assoc_link = cm_bss_peer_is_assoc_peer(req);
 	}

+ 59 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_op.h

@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DOC: contains MLO manager public file containing operation functionality
+ */
+#ifndef _WLAN_MLO_MGR_OP_H_
+#define _WLAN_MLO_MGR_OP_H_
+
+#include <wlan_mlo_mgr_cmn.h>
+#include <wlan_mlo_mgr_public_structs.h>
+
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * wlan_mlo_set_cu_bpcc() - set the bpcc per link id
+ * @vdev: vdev object
+ * @bpcc: bss parameters change count
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_mlo_set_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t bpcc);
+
+/**
+ * wlan_mlo_get_cu_bpcc() - get the bpcc per link id
+ * @vdev: vdev object
+ * @bpcc: the bss parameters change count pointer to save value
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_mlo_get_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t *bpcc);
+
+/**
+ * wlan_mlo_init_cu_bpcc() - initialize the bpcc for vdev
+ * @vdev: vdev object
+ *
+ * Return: void
+ */
+void wlan_mlo_init_cu_bpcc(struct wlan_objmgr_vdev *vdev);
+
+#else
+static inline void
+wlan_mlo_init_cu_bpcc(struct wlan_objmgr_vdev *vdev)
+{ }
+
+#endif
+#endif //_WLAN_MLO_MGR_OP_H_

+ 14 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -247,6 +247,18 @@ struct mlo_sta_csa_params {
 	bool valid_csa_param;
 };
 
+/**
+ * mlo_sta_cu_params - critical update parameters in mlo mgr
+ * @vdev_id: vdev id
+ * @bpcc: bss parameter change count
+ * @initialized: flag about the parameter is valid or not
+ */
+struct mlo_sta_cu_params {
+	uint8_t vdev_id;
+	uint8_t bpcc;
+	bool initialized;
+};
+
 /**
  * struct mlo_sta_quiet_status - MLO sta quiet status
  * @link_id: link id
@@ -268,6 +280,7 @@ struct mlo_sta_quiet_status {
  * @copied_conn_req_lock: lock for the original connect request
  * @assoc_rsp: Raw assoc response frame
  * @mlo_csa_param: CSA request parameters for mlo sta
+ * @mlo_cu_param: critical update parameters for mlo sta
  * @disconn_req: disconnect req params
  * @copied_reassoc_rsp: Reassoc response copied from assoc link roam handling
  *                      to re-use while link connect in case of deferred/need
@@ -287,6 +300,7 @@ struct wlan_mlo_sta {
 	struct element_info assoc_rsp;
 	struct mlo_sta_quiet_status mlo_quiet_status[WLAN_UMAC_MLO_MAX_VDEVS];
 	struct mlo_sta_csa_params mlo_csa_param[WLAN_UMAC_MLO_MAX_VDEVS];
+	struct mlo_sta_cu_params mlo_cu_param[WLAN_UMAC_MLO_MAX_VDEVS];
 	struct wlan_cm_disconnect_req *disconn_req;
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	struct wlan_cm_connect_resp *copied_reassoc_rsp;

+ 40 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h

@@ -189,6 +189,46 @@ mlo_update_connected_links_bmap(struct wlan_mlo_dev_context *mlo_dev_ctx,
  */
 void mlo_clear_connected_links_bmap(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * mlo_set_cu_bpcc() - set the bpcc per link id
+ * @vdev: vdev object
+ * @vdev_id: the id of vdev
+ * @bpcc: bss parameters change count
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlo_set_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t vdev_id,
+			   uint8_t bpcc);
+
+/**
+ * mlo_get_cu_bpcc() - get the bpcc per link id
+ * @vdev: vdev object
+ * @vdev_id: the id of vdev
+ * @bpcc: the bss parameters change count pointer to save value
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlo_get_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t vdev_id,
+			   uint8_t *bpcc);
+
+/**
+ * mlo_init_cu_bpcc() - initialize the bpcc for vdev
+ * @mlo_dev_ctx: wlan mlo dev context
+ * @vdev_id: vdev id
+ *
+ * Return: void
+ */
+void mlo_init_cu_bpcc(struct wlan_mlo_dev_context *mlo_dev_ctx,
+		      uint8_t vdev_id);
+
+/**
+ * mlo_clear_cu_bpcc() - clear the bpcc info
+ * @vdev: vdev object
+ *
+ * Return: void
+ */
+void mlo_clear_cu_bpcc(struct wlan_objmgr_vdev *vdev);
+
 /**
  * API to have operation on ml vdevs
  */

+ 74 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_op.c

@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DOC: contains MLO manager operation functionality
+ */
+#include <wlan_cmn.h>
+#include <wlan_cm_public_struct.h>
+#include "wlan_mlo_mgr_cmn.h"
+#include "wlan_mlo_mgr_main.h"
+#include "wlan_mlo_mgr_public_structs.h"
+#include "wlan_mlo_mgr_op.h"
+#include "wlan_mlo_mgr_sta.h"
+
+#ifdef WLAN_FEATURE_11BE_MLO
+QDF_STATUS wlan_mlo_set_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t bpcc)
+{
+	uint8_t vdev_id;
+
+	if (!vdev) {
+		mlo_err("vdev is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	vdev_id = wlan_vdev_get_id(vdev);
+	return mlo_set_cu_bpcc(vdev, vdev_id, bpcc);
+}
+
+QDF_STATUS wlan_mlo_get_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t *bpcc)
+{
+	uint8_t vdev_id;
+
+	if (!vdev || !bpcc) {
+		mlo_err("vdev or bpcc is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	vdev_id = wlan_vdev_get_id(vdev);
+	return mlo_get_cu_bpcc(vdev, vdev_id, bpcc);
+}
+
+void wlan_mlo_init_cu_bpcc(struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_mlo_dev_context *mlo_dev_ctx;
+	uint8_t vdev_id;
+
+	if (!vdev) {
+		mlo_err("vdev is NULL");
+		return;
+	}
+
+	vdev_id = wlan_vdev_get_id(vdev);
+	mlo_dev_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_dev_ctx) {
+		mlo_err("ML dev ctx is NULL");
+		return;
+	}
+
+	mlo_init_cu_bpcc(mlo_dev_ctx, vdev_id);
+}
+#endif

+ 104 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_sta.c

@@ -544,6 +544,109 @@ static QDF_STATUS mlo_validate_mlo_cap(struct wlan_objmgr_vdev *vdev)
 }
 #endif
 
+QDF_STATUS mlo_set_cu_bpcc(struct wlan_objmgr_vdev *vdev,
+			   uint8_t vdev_id, uint8_t bpcc)
+{
+	struct wlan_mlo_dev_context *mlo_dev_ctx;
+	struct mlo_sta_cu_params *cu_param;
+	uint8_t i;
+
+	mlo_dev_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_dev_ctx) {
+		mlo_err("ML dev ctx is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cu_param = &mlo_dev_ctx->sta_ctx->mlo_cu_param[0];
+	for (i = 0; i < WLAN_UMAC_MLO_MAX_VDEVS; i++) {
+		if (cu_param[i].initialized && cu_param[i].vdev_id == vdev_id) {
+			cu_param[i].bpcc = bpcc;
+			return QDF_STATUS_SUCCESS;
+		}
+	}
+
+	return QDF_STATUS_E_INVAL;
+}
+
+QDF_STATUS mlo_get_cu_bpcc(struct wlan_objmgr_vdev *vdev,
+			   uint8_t vdev_id, uint8_t *bpcc)
+{
+	struct wlan_mlo_dev_context *mlo_dev_ctx;
+	struct mlo_sta_cu_params *cu_param;
+	uint8_t i;
+
+	mlo_dev_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_dev_ctx) {
+		mlo_err("ML dev ctx is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cu_param = &mlo_dev_ctx->sta_ctx->mlo_cu_param[0];
+	for (i = 0; i < WLAN_UMAC_MLO_MAX_VDEVS; i++) {
+		if (cu_param[i].initialized &&
+		    cu_param[i].vdev_id == vdev_id) {
+			*bpcc = cu_param[i].bpcc;
+			return QDF_STATUS_SUCCESS;
+		}
+	}
+
+	return QDF_STATUS_E_INVAL;
+}
+
+void mlo_init_cu_bpcc(struct wlan_mlo_dev_context *mlo_dev_ctx,
+		      uint8_t vdev_id)
+{
+	uint8_t i;
+	struct mlo_sta_cu_params *cu_param;
+	uint8_t empty_slot = 0xff;
+
+	cu_param = &mlo_dev_ctx->sta_ctx->mlo_cu_param[0];
+
+	for (i = 0; i < WLAN_UMAC_MLO_MAX_VDEVS; i++) {
+		if (cu_param[i].initialized &&
+		    cu_param[i].vdev_id == vdev_id) {
+			cu_param[i].bpcc = 0;
+			return;
+		}
+
+		if (!cu_param[i].initialized && empty_slot == 0xff)
+			empty_slot = i;
+	}
+
+	if (empty_slot != 0xff) {
+		cu_param[empty_slot].bpcc = 0;
+		cu_param[empty_slot].vdev_id = vdev_id;
+		cu_param[empty_slot].initialized = true;
+		mlo_debug("init cu bpcc idx %d, vdev_id %d",
+			  empty_slot, vdev_id);
+	} else {
+		mlo_debug("No bpcc idx for vdev_id %d", vdev_id);
+	}
+}
+
+void mlo_clear_cu_bpcc(struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_mlo_dev_context *mlo_dev_ctx = NULL;
+	struct wlan_mlo_sta *sta_ctx = NULL;
+	uint32_t size;
+
+	if (!vdev)
+		return;
+
+	mlo_dev_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_dev_ctx)
+		return;
+
+	sta_ctx = mlo_dev_ctx->sta_ctx;
+	if (!sta_ctx)
+		return;
+
+	size = sizeof(sta_ctx->mlo_cu_param);
+	qdf_mem_zero(sta_ctx->mlo_cu_param, size);
+
+	mlo_debug("clear cu bpcc");
+}
+
 QDF_STATUS mlo_connect(struct wlan_objmgr_vdev *vdev,
 		       struct wlan_cm_connect_req *req)
 {
@@ -584,6 +687,7 @@ QDF_STATUS mlo_connect(struct wlan_objmgr_vdev *vdev,
 		}
 
 		if (QDF_IS_STATUS_SUCCESS(status)) {
+			mlo_clear_cu_bpcc(vdev);
 			mlo_clear_connected_links_bmap(vdev);
 			mlo_dev_lock_release(mlo_dev_ctx);