Browse Source

qcacmn: Avoid WMI TLV structures in NAN target_if

Refactor NAN target_if to make it wmi-type agnostic. Specifically
do not access wmi structures in NAN target_if. All the access to
wmi structures should happen in tlv and non-tlv specific wmi files.

Change-Id: I944b678fc501723d7cd26c9b21c4cc6ddb7fda4e
CRs-Fixed: 2159876
Naveen Rawat 7 years ago
parent
commit
79a787cb41
2 changed files with 132 additions and 2 deletions
  1. 104 1
      wmi_unified_api.h
  2. 28 1
      wmi_unified_priv.h

+ 104 - 1
wmi_unified_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -49,6 +49,10 @@
 #endif
 #include "wlan_scan_public_structs.h"
 
+#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+#include "nan_public_structs.h"
+#endif
+
 typedef qdf_nbuf_t wmi_buf_t;
 #define wmi_buf_data(_buf) qdf_nbuf_data(_buf)
 
@@ -1756,4 +1760,103 @@ QDF_STATUS wmi_unified_send_dump_wds_table_cmd(void *wmi_hdl);
 
 QDF_STATUS wmi_extract_wds_entry(void *wmi_hdl, uint8_t *evt_buf,
 			struct wdsentry *wds_entry, u_int32_t idx);
+
+#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+/**
+ * wmi_unified_ndp_initiator_req_cmd_send - api to send initiator request to FW
+ * @wmi_hdl: wma handle
+ * @req: pointer to request buffer
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
+				struct nan_datapath_initiator_req *req);
+
+/**
+ * wmi_unified_ndp_responder_req_cmd_send - api to send responder request to FW
+ * @wmi_hdl: wma handle
+ * @req: pointer to request buffer
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_unified_ndp_responder_req_cmd_send(void *wmi_hdl,
+				struct nan_datapath_responder_req *req);
+
+/**
+ * wmi_unified_ndp_end_req_cmd_send - api to send end request to FW
+ * @wmi_hdl: wma handle
+ * @req: pointer to request buffer
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_unified_ndp_end_req_cmd_send(void *wmi_hdl,
+				struct nan_datapath_end_req *req);
+
+/**
+ * wmi_extract_ndp_initiator_rsp - api to extract initiator rsp from even buffer
+ * @wmi_hdl: wma handle
+ * @data: event buffer
+ * @rsp: buffer to populate
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle,
+			uint8_t *data, struct nan_datapath_initiator_rsp **rsp);
+
+/**
+ * wmi_extract_ndp_ind - api to extract ndp indication struct from even buffer
+ * @wmi_hdl: wma handle
+ * @data: event buffer
+ * @ind: buffer to populate
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data,
+			struct nan_datapath_indication_event **ind);
+
+/**
+ * wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer
+ * @wmi_hdl: wma handle
+ * @data: event buffer
+ * @ev: buffer to populate
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
+			struct nan_datapath_confirm_event **ev);
+
+/**
+ * wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer
+ * @wmi_hdl: wma handle
+ * @data: event buffer
+ * @rsp: buffer to populate
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle,
+			uint8_t *data, struct nan_datapath_responder_rsp **rsp);
+
+/**
+ * wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer
+ * @wmi_hdl: wma handle
+ * @data: event buffer
+ * @rsp: buffer to populate
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
+			struct nan_datapath_end_rsp_event **rsp);
+
+/**
+ * wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer
+ * @wmi_hdl: wma handle
+ * @data: event buffer
+ * @ind: buffer to populate
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
+			struct nan_datapath_end_indication_event **ind);
+
+#endif
 #endif /* _WMI_UNIFIED_API_H_ */

+ 28 - 1
wmi_unified_priv.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -50,6 +50,10 @@
 #endif
 #include <qdf_threads.h>
 
+#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+#include "nan_public_structs.h"
+#endif
+
 #define WMI_UNIFIED_MAX_EVENT 0x100
 #define WMI_MAX_CMDS 1024
 
@@ -1452,6 +1456,29 @@ QDF_STATUS (*extract_wds_entry)(wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wdsentry *wds_entry,
 		u_int32_t idx);
+
+#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+QDF_STATUS (*send_ndp_initiator_req_cmd)(wmi_unified_t wmi_handle,
+				struct nan_datapath_initiator_req *req);
+QDF_STATUS (*send_ndp_responder_req_cmd)(wmi_unified_t wmi_handle,
+				struct nan_datapath_responder_req *req);
+QDF_STATUS (*send_ndp_end_req_cmd)(wmi_unified_t wmi_handle,
+				struct nan_datapath_end_req *req);
+
+QDF_STATUS (*extract_ndp_initiator_rsp)(wmi_unified_t wmi_handle,
+		uint8_t *data, struct nan_datapath_initiator_rsp **rsp);
+QDF_STATUS (*extract_ndp_ind)(wmi_unified_t wmi_handle,
+		uint8_t *data, struct nan_datapath_indication_event **ind);
+QDF_STATUS (*extract_ndp_confirm)(wmi_unified_t wmi_handle,
+		uint8_t *data, struct nan_datapath_confirm_event **ev);
+QDF_STATUS (*extract_ndp_responder_rsp)(wmi_unified_t wmi_handle,
+		uint8_t *data, struct nan_datapath_responder_rsp **rsp);
+QDF_STATUS (*extract_ndp_end_rsp)(wmi_unified_t wmi_handle,
+		uint8_t *data, struct nan_datapath_end_rsp_event **rsp);
+QDF_STATUS (*extract_ndp_end_ind)(wmi_unified_t wmi_handle,
+		uint8_t *data, struct nan_datapath_end_indication_event **ind);
+
+#endif
 };
 
 /* Forward declartion for psoc*/