浏览代码

qcacmn: Add new WMI API for OCL command

Currently there is no provision to configure OCL mode in FW during
driver bootup.

To enable this configuration add a new WMI API wmi_unified_send_ocl_cmd.

Change-Id: Idb936172612ff2ed8ea029d8a363b758625eb97d
CRs-Fixed: 2647631
Bapiraju Alla 5 年之前
父节点
当前提交
d5d364a58d

+ 4 - 0
wmi/inc/wmi_unified_priv.h

@@ -913,6 +913,10 @@ QDF_STATUS (*send_process_del_periodic_tx_ptrn_cmd)(wmi_unified_t wmi_handle,
 QDF_STATUS (*send_set_auto_shutdown_timer_cmd)(wmi_unified_t wmi_handle,
 						  uint32_t timer_val);
 
+QDF_STATUS
+(*send_ocl_cmd)(wmi_unified_t wmi_handle,
+		struct ocl_cmd_params *param);
+
 #ifdef WLAN_FEATURE_NAN
 QDF_STATUS (*send_nan_req_cmd)(wmi_unified_t wmi_handle,
 			struct nan_msg_params *nan_req);

+ 14 - 1
wmi/inc/wmi_unified_sta_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2020 The Linux Foundation. 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
@@ -452,4 +452,17 @@ QDF_STATUS wmi_unified_peer_unmap_conf_send(wmi_unified_t wmi_handle,
 					    uint32_t peer_id_cnt,
 					    uint16_t *peer_id_list);
 
+/**
+ * wmi_unified_send_ocl_cmd() - send OCL command
+ * @wmi_handle: wmi handle
+ * @param: OCL commang parameters
+ *
+ * Send WMI_SET_OCL_CMDID parameters to fw.
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS
+wmi_unified_send_ocl_cmd(wmi_unified_t wmi_handle,
+			 struct ocl_cmd_params *param);
+
 #endif /* _WMI_UNIFIED_STA_API_H_ */

+ 10 - 0
wmi/inc/wmi_unified_sta_param.h

@@ -363,4 +363,14 @@ struct get_arp_stats {
 	uint32_t vdev_id;
 };
 
+/**
+ * struct ocl_cmd_params - OCL command params
+ * @vdev_id: Virtual AP device identifier
+ * @en_dis_chain: enable/disable dynamic/static OCL mode
+ */
+struct ocl_cmd_params {
+	uint32_t vdev_id;
+	uint32_t en_dis_chain;
+};
+
 #endif /* _WMI_UNIFIED_STA_PARAM_H_ */

+ 11 - 1
wmi/src/wmi_unified_sta_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2020 The Linux Foundation. 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
@@ -415,3 +415,13 @@ QDF_STATUS wmi_unified_peer_unmap_conf_send(wmi_unified_t wmi_handle,
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS
+wmi_unified_send_ocl_cmd(wmi_unified_t wmi_handle,
+			 struct ocl_cmd_params *param)
+{
+	if (wmi_handle->ops->send_ocl_cmd)
+		return wmi_handle->ops->send_ocl_cmd(wmi_handle, param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+

+ 42 - 0
wmi/src/wmi_unified_sta_tlv.c

@@ -2376,6 +2376,47 @@ static QDF_STATUS send_peer_unmap_conf_cmd_tlv(wmi_unified_t wmi,
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * send_ocl_cmd_tlv() - send ocl command to fw
+ * @wmi_handle: wmi handle
+ * @param: pointer to coex config param
+ *
+ * Return: 0 for success or error code
+ */
+static QDF_STATUS
+send_ocl_cmd_tlv(wmi_unified_t wmi_handle, struct ocl_cmd_params *param)
+{
+	wmi_set_ocl_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	QDF_STATUS ret;
+	int32_t len;
+
+	len = sizeof(*cmd);
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf)
+		return QDF_STATUS_E_FAILURE;
+
+	cmd = (wmi_set_ocl_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_set_ocl_cmd_fixed_param,
+		       WMITLV_GET_STRUCT_TLVLEN(
+		       wmi_set_ocl_cmd_fixed_param));
+
+	cmd->vdev_id = param->vdev_id;
+	cmd->en_dis_chain = param->en_dis_chain;
+
+	wmi_mtrace(WMI_SET_OCL_CMDID, cmd->vdev_id, 0);
+	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
+				   WMI_SET_OCL_CMDID);
+
+	if (ret != 0) {
+		WMI_LOGE("Sending OCL CMD failed");
+		wmi_buf_free(buf);
+	}
+
+	return ret;
+}
+
 void wmi_sta_attach_tlv(wmi_unified_t wmi_handle)
 {
 	struct wmi_ops *ops = wmi_handle->ops;
@@ -2417,6 +2458,7 @@ void wmi_sta_attach_tlv(wmi_unified_t wmi_handle)
 	ops->send_set_arp_stats_req_cmd = send_set_arp_stats_req_cmd_tlv;
 	ops->send_get_arp_stats_req_cmd = send_get_arp_stats_req_cmd_tlv;
 	ops->send_peer_unmap_conf_cmd = send_peer_unmap_conf_cmd_tlv;
+	ops->send_ocl_cmd = send_ocl_cmd_tlv;
 
 	wmi_tdls_attach_tlv(wmi_handle);
 	wmi_policy_mgr_attach_tlv(wmi_handle);