From 53441b208abc853e365e04de3990f6dd12398226 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Thu, 24 Feb 2022 19:31:05 +0800 Subject: [PATCH] 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 --- wmi/inc/wmi_unified_11be_tlv.h | 7 ++++--- wmi/src/wmi_unified_11be_tlv.c | 10 +++++++++- wmi/src/wmi_unified_tlv.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/wmi/inc/wmi_unified_11be_tlv.h b/wmi/inc/wmi_unified_11be_tlv.h index 776e878189..fe5a26837d 100644 --- a/wmi/inc/wmi_unified_11be_tlv.h +++ b/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; } diff --git a/wmi/src/wmi_unified_11be_tlv.c b/wmi/src/wmi_unified_11be_tlv.c index 4b0ac2e36d..d14f960b48 100644 --- a/wmi/src/wmi_unified_11be_tlv.c +++ b/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); diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 704e7742ce..92d7917978 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/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)