Explorar o código

qcacmn: do not add MLO params if MLD is not set for vdev

If MLD is not set for a vdev, do not add MLO params
in vdev create command.

Change-Id: Ie726cd30165a541357422851848fb1da9790d64b
CRs-Fixed: 3138070
Yu Wang %!s(int64=3) %!d(string=hai) anos
pai
achega
53441b208a

+ 4 - 3
wmi/inc/wmi_unified_11be_tlv.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 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
@@ -20,10 +21,10 @@
 #ifdef WLAN_FEATURE_11BE_MLO
 /**
  *  vdev_create_mlo_params_size() - Get MLO params size in vdev create
- *
+ *  @param: ponter to vdev create request param
  *  Return: size of MLO params in vdev create
  */
-size_t vdev_create_mlo_params_size(void);
+size_t vdev_create_mlo_params_size(struct vdev_create_params *param);
 /**
  *  vdev_create_add_mlo_params() - Add MLO params in vdev create cmd
  *  @buf_ptr: pointer to vdev create buffer.
@@ -121,7 +122,7 @@ static uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr,
 	return buf_ptr + WMI_TLV_HDR_SIZE;
 }
 
-static size_t vdev_create_mlo_params_size(void)
+static size_t vdev_create_mlo_params_size(struct vdev_create_params *param)
 {
 	return WMI_TLV_HDR_SIZE;
 }

+ 9 - 1
wmi/src/wmi_unified_11be_tlv.c

@@ -24,8 +24,11 @@
 #endif
 #include "wmi_unified_11be_tlv.h"
 
-size_t vdev_create_mlo_params_size(void)
+size_t vdev_create_mlo_params_size(struct vdev_create_params *param)
 {
+	if (qdf_is_macaddr_zero((struct qdf_mac_addr *)param->mlo_mac))
+		return WMI_TLV_HDR_SIZE;
+
 	return sizeof(wmi_vdev_create_mlo_params) + WMI_TLV_HDR_SIZE;
 }
 
@@ -34,6 +37,11 @@ uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr,
 {
 	wmi_vdev_create_mlo_params *mlo_params;
 
+	if (qdf_is_macaddr_zero((struct qdf_mac_addr *)param->mlo_mac)) {
+		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_create_mlo_params));
 	buf_ptr += sizeof(uint32_t);

+ 1 - 1
wmi/src/wmi_unified_tlv.c

@@ -810,7 +810,7 @@ static QDF_STATUS send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle,
 	wmi_vdev_txrx_streams *txrx_streams;
 
 	len += (num_bands * sizeof(*txrx_streams) + WMI_TLV_HDR_SIZE);
-	len += vdev_create_mlo_params_size();
+	len += vdev_create_mlo_params_size(param);
 
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf)