Pārlūkot izejas kodu

qcacmn: Send the vdev chain params to fw

Send the vdev nss, chain params to fw.

Change-Id: Ie62ea5001c579545b43b4c30ab15d9023e636042
CRs-Fixed: 2347628
Ashish Kumar Dhanotiya 6 gadi atpakaļ
vecāks
revīzija
c4fd271d20

+ 12 - 0
wmi/inc/wmi_unified_api.h

@@ -461,6 +461,18 @@ QDF_STATUS wmi_unified_vdev_create_send(void *wmi_hdl,
 QDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl,
 					  uint8_t if_id);
 
+/**
+ * wmi_unified_vdev_nss_chain_params_send() - send VDEV nss chain params to fw
+ * @wmi_handle: wmi handle
+ * @vdev_id: vdev id
+ * @nss_chains_user_cfg: user configured params to send
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_vdev_nss_chain_params_send(void *wmi_hdl,
+			uint8_t vdev_id,
+			struct wlan_mlme_nss_chains *nss_chains_user_cfg);
+
 QDF_STATUS wmi_unified_vdev_stop_send(void *wmi_hdl,
 					uint8_t vdev_id);
 

+ 1 - 0
wmi/inc/wmi_unified_param.h

@@ -24,6 +24,7 @@
 #ifndef _WMI_UNIFIED_PARAM_H_
 #define _WMI_UNIFIED_PARAM_H_
 
+#include "wlan_mlme_public_struct.h"
 #include <wlan_scan_public_structs.h>
 #ifdef CONVERGED_TDLS_ENABLE
 #include <wlan_tdls_public_structs.h>

+ 4 - 0
wmi/inc/wmi_unified_priv.h

@@ -271,6 +271,10 @@ QDF_STATUS (*send_vdev_create_cmd)(wmi_unified_t wmi_handle,
 QDF_STATUS (*send_vdev_delete_cmd)(wmi_unified_t wmi_handle,
 					  uint8_t if_id);
 
+QDF_STATUS (*send_vdev_nss_chain_params_cmd)(wmi_unified_t wmi_handle,
+					 uint8_t vdev_id,
+					 struct wlan_mlme_nss_chains *user_cfg);
+
 QDF_STATUS (*send_vdev_stop_cmd)(wmi_unified_t wmi,
 					uint8_t vdev_id);
 

+ 16 - 0
wmi/src/wmi_unified_api.c

@@ -92,6 +92,22 @@ QDF_STATUS wmi_unified_vdev_delete_send(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS
+wmi_unified_vdev_nss_chain_params_send(void *wmi_hdl,
+				       uint8_t vdev_id,
+				       struct wlan_mlme_nss_chains *user_cfg)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->send_vdev_nss_chain_params_cmd)
+		return wmi_handle->ops->send_vdev_nss_chain_params_cmd(
+							wmi_handle,
+							vdev_id,
+							user_cfg);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 /**
  * wmi_unified_vdev_stop_send() - send vdev stop command to fw
  * @wmi: wmi handle

+ 59 - 0
wmi/src/wmi_unified_tlv.c

@@ -282,6 +282,64 @@ static QDF_STATUS send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle,
 	return ret;
 }
 
+/**
+ * send_vdev_nss_chain_params_cmd_tlv() - send VDEV nss chain params to fw
+ * @wmi_handle: wmi handle
+ * @vdev_id: vdev id
+ * @nss_chains_user_cfg: user configured nss chain params
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static QDF_STATUS
+send_vdev_nss_chain_params_cmd_tlv(wmi_unified_t wmi_handle,
+				   uint8_t vdev_id,
+				   struct wlan_mlme_nss_chains *user_cfg)
+{
+	wmi_vdev_chainmask_config_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	QDF_STATUS ret;
+
+	buf = wmi_buf_alloc(wmi_handle, sizeof(*cmd));
+	if (!buf) {
+		WMI_LOGP("%s:wmi_buf_alloc failed", __func__);
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	cmd = (wmi_vdev_chainmask_config_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		     WMITLV_TAG_STRUC_wmi_vdev_chainmask_config_cmd_fixed_param,
+		     WMITLV_GET_STRUCT_TLVLEN
+			       (wmi_vdev_chainmask_config_cmd_fixed_param));
+	cmd->vdev_id = vdev_id;
+	cmd->disable_rx_mrc_2g = user_cfg->disable_rx_mrc[NSS_CHAINS_BAND_2GHZ];
+	cmd->disable_tx_mrc_2g = user_cfg->disable_tx_mrc[NSS_CHAINS_BAND_2GHZ];
+	cmd->disable_rx_mrc_5g = user_cfg->disable_rx_mrc[NSS_CHAINS_BAND_5GHZ];
+	cmd->disable_tx_mrc_5g = user_cfg->disable_tx_mrc[NSS_CHAINS_BAND_5GHZ];
+	cmd->num_rx_chains_2g = user_cfg->num_rx_chains[NSS_CHAINS_BAND_2GHZ];
+	cmd->num_tx_chains_2g = user_cfg->num_tx_chains[NSS_CHAINS_BAND_2GHZ];
+	cmd->num_rx_chains_5g = user_cfg->num_rx_chains[NSS_CHAINS_BAND_5GHZ];
+	cmd->num_tx_chains_5g = user_cfg->num_tx_chains[NSS_CHAINS_BAND_5GHZ];
+	cmd->rx_nss_2g = user_cfg->rx_nss[NSS_CHAINS_BAND_2GHZ];
+	cmd->tx_nss_2g = user_cfg->tx_nss[NSS_CHAINS_BAND_2GHZ];
+	cmd->rx_nss_5g = user_cfg->rx_nss[NSS_CHAINS_BAND_5GHZ];
+	cmd->tx_nss_5g = user_cfg->tx_nss[NSS_CHAINS_BAND_5GHZ];
+	cmd->num_tx_chains_a = user_cfg->num_tx_chains_11a;
+	cmd->num_tx_chains_b = user_cfg->num_tx_chains_11b;
+	cmd->num_tx_chains_g = user_cfg->num_tx_chains_11g;
+
+	wmi_mtrace(WMI_VDEV_CHAINMASK_CONFIG_CMDID, cmd->vdev_id, 0);
+	ret = wmi_unified_cmd_send(wmi_handle, buf,
+			sizeof(wmi_vdev_chainmask_config_cmd_fixed_param),
+			WMI_VDEV_CHAINMASK_CONFIG_CMDID);
+	if (QDF_IS_STATUS_ERROR(ret)) {
+		WMI_LOGE("Failed to send WMI_VDEV_CHAINMASK_CONFIG_CMDID");
+		wmi_buf_free(buf);
+	}
+	WMI_LOGD("%s: vdev_id %d", __func__, vdev_id);
+
+	return ret;
+}
+
 /**
  * send_vdev_stop_cmd_tlv() - send vdev stop command to fw
  * @wmi: wmi handle
@@ -10999,6 +11057,7 @@ static void wmi_11ax_bss_color_attach_tlv(struct wmi_unified *wmi_handle)
 struct wmi_ops tlv_ops =  {
 	.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
 	.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
+	.send_vdev_nss_chain_params_cmd = send_vdev_nss_chain_params_cmd_tlv,
 	.send_vdev_down_cmd = send_vdev_down_cmd_tlv,
 	.send_vdev_start_cmd = send_vdev_start_cmd_tlv,
 	.send_hidden_ssid_vdev_restart_cmd =