瀏覽代碼

qcacmn: Extend vdev stop and peer delete cmd for link switch

Enhance WMI command of existing peer delete and VDEV stop to
add new TLV to carry MLO params with link switch BIT set when
link switch is in progress.

Change-Id: I50b1aa48e4e2c976a56bcd3b75395eef6830e627
CRs-Fixed: 3663340
Vinod Kumar Pirla 1 年之前
父節點
當前提交
0d945daa64

+ 2 - 2
target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -711,7 +711,7 @@ static QDF_STATUS target_if_vdev_mgr_stop_send(
 	target_if_wake_lock_timeout_release(psoc, START_WAKELOCK);
 	target_if_wake_lock_timeout_acquire(psoc, STOP_WAKELOCK);
 
-	status = wmi_unified_vdev_stop_send(wmi_handle, param->vdev_id);
+	status = wmi_unified_vdev_stop_send(wmi_handle, param);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		vdev_rsp->expire_time = 0;
 		vdev_rsp->timer_status = QDF_STATUS_E_CANCELED;

+ 2 - 0
umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c

@@ -646,6 +646,8 @@ static QDF_STATUS vdev_mgr_stop_param_update(
 	}
 
 	param->vdev_id = wlan_vdev_get_id(vdev);
+	param->is_mlo_link_switch =
+		wlan_vdev_mlme_is_mlo_link_switch_in_progress(vdev);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 5 - 1
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -513,10 +513,12 @@ struct peer_flush_params {
  * @vdev_id: vdev id
  * @hw_link_id_bitmap: logical link id bitmap for peers
  * not getting created
+ * @is_mlo_link_switch: Is peer delete due to link switch
  */
 struct peer_delete_cmd_params {
 	uint8_t vdev_id;
 	uint32_t hw_link_id_bitmap;
+	bool is_mlo_link_switch;
 };
 
 /* Default FILS DISCOVERY/probe response sent in period of 20TU */
@@ -862,9 +864,11 @@ struct vdev_delete_params {
 /**
  * struct vdev_stop_params - vdev stop cmd parameter
  * @vdev_id: vdev id
+ * @is_mlo_link_switch: Is VDEV stop due to link switch
  */
 struct vdev_stop_params {
 	uint8_t vdev_id;
+	bool is_mlo_link_switch;
 };
 
 /**

+ 31 - 1
wmi/inc/wmi_unified_11be_tlv.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 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
@@ -190,6 +190,24 @@ size_t peer_delete_mlo_params_size(struct peer_delete_cmd_params *req);
 uint8_t *peer_delete_add_mlo_params(uint8_t *buf_ptr,
 				    struct peer_delete_cmd_params *req);
 
+/**
+ * vdev_stop_mlo_params_size() - Get MLO params size in vdev stop
+ * @params: VDEV stop request params
+ *
+ * Return: size of MLO params in VDEV stop
+ */
+size_t vdev_stop_mlo_params_size(struct vdev_stop_params *params);
+
+/**
+ * vdev_stop_add_mlo_params() - Add MLO params in VDEV stop cmd
+ * @buf_ptr: Pointer to VDEV stop cmd buffer.
+ * @params: VDEV stop request params
+ *
+ * Return: Pointer to new offset of cmd buffer.
+ */
+uint8_t *vdev_stop_add_mlo_params(uint8_t *buf_ptr,
+				  struct vdev_stop_params *params);
+
 /** wmi_11be_tlv_attach_tlv - Attach 11be relaated callbacks
  *  @wmi_handle: WMI handle
  */
@@ -337,6 +355,18 @@ static uint8_t *peer_delete_add_mlo_params(uint8_t *buf_ptr,
 	return buf_ptr + WMI_TLV_HDR_SIZE;
 }
 
+static inline size_t vdev_stop_mlo_params_size(struct vdev_stop_params *params)
+{
+	return WMI_TLV_HDR_SIZE;
+}
+
+static inline uint8_t *vdev_stop_add_mlo_params(uint8_t *buf_ptr,
+						struct vdev_stop_params *params)
+{
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
+	return buf_ptr + WMI_TLV_HDR_SIZE;
+}
+
 static void wmi_11be_attach_tlv(wmi_unified_t wmi_handle)
 { }
 

+ 2 - 2
wmi/inc/wmi_unified_api.h

@@ -957,12 +957,12 @@ wmi_unified_vdev_nss_chain_params_send(
 /**
  * wmi_unified_vdev_stop_send() - send vdev stop command to fw
  * @wmi_handle: wmi handle
- * @vdev_id: vdev id
+ * @params: VDEV stop params
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
 QDF_STATUS wmi_unified_vdev_stop_send(wmi_unified_t wmi_handle,
-				      uint8_t vdev_id);
+				      struct vdev_stop_params *params);
 
 /**
  * wmi_unified_vdev_up_send() - send vdev up command in fw

+ 2 - 2
wmi/inc/wmi_unified_priv.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -541,7 +541,7 @@ QDF_STATUS (*send_vdev_nss_chain_params_cmd)(wmi_unified_t wmi_handle,
 					 struct vdev_nss_chains *user_cfg);
 
 QDF_STATUS (*send_vdev_stop_cmd)(wmi_unified_t wmi,
-					uint8_t vdev_id);
+				 struct vdev_stop_params *params);
 
 QDF_STATUS (*send_vdev_down_cmd)(wmi_unified_t wmi,
 			uint8_t vdev_id);

+ 38 - 3
wmi/src/wmi_unified_11be_tlv.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -450,7 +450,7 @@ uint8_t *peer_assoc_add_ml_partner_links(uint8_t *buf_ptr,
 
 size_t peer_delete_mlo_params_size(struct peer_delete_cmd_params *req)
 {
-	if (!req->hw_link_id_bitmap)
+	if (!req->hw_link_id_bitmap && !req->is_mlo_link_switch)
 		return WMI_TLV_HDR_SIZE;
 
 	return sizeof(wmi_peer_delete_mlo_params) + WMI_TLV_HDR_SIZE;
@@ -461,7 +461,7 @@ uint8_t *peer_delete_add_mlo_params(uint8_t *buf_ptr,
 {
 	wmi_peer_delete_mlo_params *mlo_params;
 
-	if (!req->hw_link_id_bitmap) {
+	if (!req->hw_link_id_bitmap && !req->is_mlo_link_switch) {
 		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
 		return buf_ptr + WMI_TLV_HDR_SIZE;
 	}
@@ -475,9 +475,44 @@ uint8_t *peer_delete_add_mlo_params(uint8_t *buf_ptr,
 		       WMITLV_TAG_STRUC_wmi_peer_delete_mlo_params,
 		       WMITLV_GET_STRUCT_TLVLEN(wmi_peer_delete_mlo_params));
 	mlo_params->mlo_hw_link_id_bitmap = req->hw_link_id_bitmap;
+	WMI_MLO_FLAGS_SET_MLO_LINK_SWITCH(mlo_params->mlo_flags.mlo_flags,
+					  req->is_mlo_link_switch);
+
 	return buf_ptr + sizeof(wmi_peer_delete_mlo_params);
 }
 
+size_t vdev_stop_mlo_params_size(struct vdev_stop_params *params)
+{
+	if (!params->is_mlo_link_switch)
+		return WMI_TLV_HDR_SIZE;
+
+	return sizeof(wmi_vdev_stop_mlo_params) + WMI_TLV_HDR_SIZE;
+}
+
+uint8_t *vdev_stop_add_mlo_params(uint8_t *buf_ptr,
+				  struct vdev_stop_params *params)
+{
+	wmi_vdev_stop_mlo_params *mlo_params;
+
+	if (!params->is_mlo_link_switch) {
+		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
+		return buf_ptr + WMI_TLV_HDR_SIZE;
+	}
+
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+		       sizeof(wmi_vdev_stop_mlo_params));
+	buf_ptr += WMI_TLV_HDR_SIZE;
+
+	mlo_params = (wmi_vdev_stop_mlo_params *)buf_ptr;
+	WMITLV_SET_HDR(&mlo_params->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_vdev_stop_mlo_params,
+		       WMITLV_GET_STRUCT_TLVLEN(wmi_vdev_stop_mlo_params));
+	WMI_MLO_FLAGS_SET_MLO_LINK_SWITCH(mlo_params->mlo_flags.mlo_flags,
+					  params->is_mlo_link_switch);
+
+	return buf_ptr + sizeof(wmi_vdev_stop_mlo_params);
+}
+
 /**
  * force_mode_host_to_fw() - translate force mode for MLO link set active
  *  command

+ 3 - 4
wmi/src/wmi_unified_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -124,11 +124,10 @@ wmi_unified_vdev_nss_chain_params_send(wmi_unified_t wmi_handle,
 }
 
 QDF_STATUS wmi_unified_vdev_stop_send(wmi_unified_t  wmi_handle,
-				      uint8_t vdev_id)
+				      struct vdev_stop_params *params)
 {
 	if (wmi_handle->ops->send_vdev_stop_cmd)
-		return wmi_handle->ops->send_vdev_stop_cmd(wmi_handle,
-			   vdev_id);
+		return wmi_handle->ops->send_vdev_stop_cmd(wmi_handle, params);
 
 	return QDF_STATUS_E_FAILURE;
 }

+ 12 - 5
wmi/src/wmi_unified_tlv.c

@@ -1172,33 +1172,40 @@ send_vdev_nss_chain_params_cmd_tlv(wmi_unified_t wmi_handle,
 /**
  * send_vdev_stop_cmd_tlv() - send vdev stop command to fw
  * @wmi: wmi handle
- * @vdev_id: vdev id
+ * @params: VDEV stop params
  *
  * Return: QDF_STATUS_SUCCESS for success or error code
  */
 static QDF_STATUS send_vdev_stop_cmd_tlv(wmi_unified_t wmi,
-					uint8_t vdev_id)
+					 struct vdev_stop_params *params)
 {
 	wmi_vdev_stop_cmd_fixed_param *cmd;
 	wmi_buf_t buf;
 	int32_t len = sizeof(*cmd);
+	uint8_t *buf_ptr;
+
+	len += vdev_stop_mlo_params_size(params);
 
 	buf = wmi_buf_alloc(wmi, len);
 	if (!buf)
 		return QDF_STATUS_E_NOMEM;
 
-	cmd = (wmi_vdev_stop_cmd_fixed_param *) wmi_buf_data(buf);
+	buf_ptr = wmi_buf_data(buf);
+	cmd = (wmi_vdev_stop_cmd_fixed_param *)buf_ptr;
 	WMITLV_SET_HDR(&cmd->tlv_header,
 		       WMITLV_TAG_STRUC_wmi_vdev_stop_cmd_fixed_param,
 		       WMITLV_GET_STRUCT_TLVLEN(wmi_vdev_stop_cmd_fixed_param));
-	cmd->vdev_id = vdev_id;
+	cmd->vdev_id = params->vdev_id;
+	buf_ptr += sizeof(wmi_vdev_stop_cmd_fixed_param);
+	buf_ptr = vdev_stop_add_mlo_params(buf_ptr, params);
+
 	wmi_mtrace(WMI_VDEV_STOP_CMDID, cmd->vdev_id, 0);
 	if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_STOP_CMDID)) {
 		wmi_err("Failed to send vdev stop command");
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
 	}
-	wmi_debug("vdev id = %d", vdev_id);
+	wmi_debug("vdev id = %d", cmd->vdev_id);
 
 	return 0;
 }