Эх сурвалжийг харах

qcacmn: Add WMI support for WMI_PEER_UNMAP_CONF_CMDID

Add WMI support to send WMI_PEER_UNMAP_CONF_CMDID to FW
for peer unmap confirmation.

Change-Id: I1a260f840ed28f90568d9cba912cc5e5128c8c7d
CRs-Fixed: 2358066
Alok Kumar 6 жил өмнө
parent
commit
4ac000e88e

+ 14 - 0
wmi_unified_sta_api.c

@@ -491,3 +491,17 @@ QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS wmi_unified_peer_unmap_conf_send(void *wmi_hdl,
+					    uint8_t vdev_id,
+					    uint32_t peer_id_cnt,
+					    uint16_t *peer_id_list)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->send_peer_unmap_conf_cmd)
+		return wmi_handle->ops->send_peer_unmap_conf_cmd(wmi_handle,
+				  vdev_id, peer_id_cnt, peer_id_list);
+
+	return QDF_STATUS_E_FAILURE;
+}
+

+ 71 - 0
wmi_unified_sta_tlv.c

@@ -2468,6 +2468,76 @@ error:
 	return status;
 }
 
+/**
+ * send_peer_unmap_conf_cmd_tlv() - send PEER UNMAP conf command to fw
+ * @wmi: wmi handle
+ * @vdev_id: vdev id
+ * @peer_id_cnt: no. of peer ids
+ * @peer_id_list: list of peer ids
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static QDF_STATUS send_peer_unmap_conf_cmd_tlv(wmi_unified_t wmi,
+					       uint8_t vdev_id,
+					       uint32_t peer_id_cnt,
+					       uint16_t *peer_id_list)
+{
+	int i;
+	wmi_buf_t buf;
+	uint8_t *buf_ptr;
+	A_UINT32 *peer_ids;
+	wmi_peer_unmap_response_cmd_fixed_param *cmd;
+	uint32_t peer_id_list_len;
+	uint32_t len = sizeof(*cmd);
+
+	if (!peer_id_cnt || !peer_id_list)
+		return QDF_STATUS_E_FAILURE;
+
+	len += WMI_TLV_HDR_SIZE;
+
+	peer_id_list_len = peer_id_cnt * sizeof(A_UINT32);
+
+	len += peer_id_list_len;
+
+	buf = wmi_buf_alloc(wmi, len);
+
+	if (!buf) {
+		WMI_LOGP("%s: wmi_buf_alloc failed", __func__);
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	cmd = (wmi_peer_unmap_response_cmd_fixed_param *)wmi_buf_data(buf);
+	buf_ptr = (uint8_t *)wmi_buf_data(buf);
+
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_peer_unmap_response_cmd_fixed_param,
+		       WMITLV_GET_STRUCT_TLVLEN
+			       (wmi_peer_unmap_response_cmd_fixed_param));
+
+	buf_ptr += sizeof(wmi_peer_unmap_response_cmd_fixed_param);
+
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
+		       peer_id_list_len);
+
+	peer_ids = (A_UINT32 *)(buf_ptr + WMI_TLV_HDR_SIZE);
+
+	for (i = 0; i < peer_id_cnt; i++)
+		peer_ids[i] = peer_id_list[i];
+
+	WMI_LOGD("%s: vdev_id %d peer_id_cnt %d", __func__,
+		 vdev_id, peer_id_cnt);
+	wmi_mtrace(WMI_PEER_UNMAP_RESPONSE_CMDID, vdev_id, 0);
+	if (wmi_unified_cmd_send(wmi, buf, len,
+				 WMI_PEER_UNMAP_RESPONSE_CMDID)) {
+		WMI_LOGP("%s: Failed to send peer delete conf command",
+			 __func__);
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 void wmi_sta_attach_tlv(wmi_unified_t wmi_handle)
 {
 	struct wmi_ops *ops = wmi_handle->ops;
@@ -2509,6 +2579,7 @@ void wmi_sta_attach_tlv(wmi_unified_t wmi_handle)
 		send_dbs_scan_sel_params_cmd_tlv;
 	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;
 
 	wmi_tdls_attach_tlv(wmi_handle);
 	wmi_disa_attach_tlv(wmi_handle);

+ 6 - 0
wmi_unified_tlv.c

@@ -6360,6 +6360,10 @@ void wmi_copy_resource_config(wmi_resource_config *resource_cfg,
 			resource_cfg->flag1, 1);
 	}
 
+	if (tgt_res_cfg->peer_unmap_conf_support)
+		WMI_RSRC_CFG_FLAG_PEER_UNMAP_RESPONSE_SUPPORT_SET(
+			resource_cfg->flag1, 1);
+
 	wmi_copy_twt_resource_config(resource_cfg, tgt_res_cfg);
 	resource_cfg->peer_map_unmap_v2_support =
 		tgt_res_cfg->peer_map_unmap_v2;
@@ -11947,6 +11951,8 @@ static void populate_tlv_service(uint32_t *wmi_service)
 			WMI_SERVICE_PER_VDEV_CHAINMASK_CONFIG_SUPPORT;
 	wmi_service[wmi_service_new_htt_msg_format] =
 			WMI_SERVICE_HTT_H2T_NO_HTC_HDR_LEN_IN_MSG_LEN;
+	wmi_service[wmi_service_peer_unmap_cnf_support] =
+			WMI_SERVICE_PEER_UNMAP_RESPONSE_SUPPORT;
 
 }