Browse Source

qcacmn: Add modules to handle and extract NAN events

As part of supporting NAN DBS, new WMI TLVs are defined so
that Host can maintain the status of NAN Discovery in sync
with the Firmware. Move the older handlers into the NAN
related files. Also add modules to extract information from
the new TLV's and fill up the event parameters to pass
them to the NAN component. add support for explicitly
disabling NAN due to concurrencies.

Add modules to handle and extract the info from NAN events.

Change-Id: Ic03baaaef45106353c211a813e11e33a90cd41ca
CRs-Fixed: 2338059
Nachiket Kukade 6 years ago
parent
commit
9daf211a16
4 changed files with 57 additions and 48 deletions
  1. 49 11
      wmi_unified_nan_api.h
  2. 8 15
      wmi_unified_priv.h
  3. 0 12
      wmi_unified_sta_api.h
  4. 0 10
      wmi_unified_sta_param.h

+ 49 - 11
wmi_unified_nan_api.h

@@ -25,6 +25,26 @@
 
 #include <nan_public_structs.h>
 
+/**
+ * wmi_unified_nan_req_cmd() - to send nan request to target
+ * @wmi_handle: wmi handle
+ * @nan_req: request data which will be non-null
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_nan_req_cmd(wmi_unified_t wmi_handle,
+				   struct nan_msg_params *nan_req);
+
+/**
+ * wmi_unified_nan_disable_req_cmd() - to send nan disable request to target
+ * @wmi_handle: wmi handle
+ * @nan_req: pointer to NAN Disable request structure
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_nan_disable_req_cmd(wmi_unified_t wmi_handle,
+					   struct nan_disable_req *nan_req);
+
 /**
  * wmi_unified_ndp_initiator_req_cmd_send - api to send initiator request to FW
  * @wmi_hdl: wmi handle
@@ -32,8 +52,9 @@
  *
  * Return: status of operation
  */
-QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
-				struct nan_datapath_initiator_req *req);
+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
@@ -42,8 +63,9 @@ QDF_STATUS wmi_unified_ndp_initiator_req_cmd_send(void *wmi_hdl,
  *
  * Return: status of operation
  */
-QDF_STATUS wmi_unified_ndp_responder_req_cmd_send(void *wmi_hdl,
-				struct nan_datapath_responder_req *req);
+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
@@ -63,8 +85,9 @@ QDF_STATUS wmi_unified_ndp_end_req_cmd_send(void *wmi_hdl,
  *
  * 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);
+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
@@ -96,8 +119,9 @@ QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
  *
  * 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);
+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
@@ -118,7 +142,8 @@ QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
  *
  * Return: status of operation
  */
-QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
+QDF_STATUS
+wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
 			struct nan_datapath_end_indication_event **ind);
 
 /**
@@ -129,7 +154,20 @@ QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
  *
  * Return: status of operation
  */
-QDF_STATUS wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
-				struct nan_datapath_sch_update_event *ind);
+QDF_STATUS
+wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
+			   struct nan_datapath_sch_update_event *ind);
 
+/**
+ * wmi_extract_nan_event_rsp - api to extract nan event into event parameters
+ * @wmi_hdl: wmi handle
+ * @wvt_buf: pointer to the event buffer
+ * @temp_evt_params: Pointer to a temporary parameters structure to populate
+ * @nan_msg_buf: Pointer to the NAN Message buffer encapsulated in the event
+ *
+ * Return: status of operation
+ */
+QDF_STATUS wmi_extract_nan_event_rsp(wmi_unified_t wmi_handle, void *evt_buf,
+				     struct nan_event_params *temp_evt_params,
+				     uint8_t **nan_msg_buf);
 #endif /* _WMI_UNIFIED_NAN_API_H_ */

+ 8 - 15
wmi_unified_priv.h

@@ -832,7 +832,14 @@ QDF_STATUS (*send_set_auto_shutdown_timer_cmd)(wmi_unified_t wmi_handle,
 
 #ifdef WLAN_FEATURE_NAN
 QDF_STATUS (*send_nan_req_cmd)(wmi_unified_t wmi_handle,
-			struct nan_req_params *nan_req);
+			struct nan_msg_params *nan_req);
+
+QDF_STATUS (*send_nan_disable_req_cmd)(wmi_unified_t wmi_handle,
+				       struct nan_disable_req *nan_msg);
+
+QDF_STATUS (*extract_nan_event_rsp)(wmi_unified_t wmi_handle, void *evt_buf,
+				    struct nan_event_params *evt_params,
+				    uint8_t **msg_buf);
 #endif
 
 QDF_STATUS (*send_process_ch_avoid_update_cmd)(wmi_unified_t wmi_handle);
@@ -2239,20 +2246,6 @@ static inline void wmi_sta_attach_tlv(struct wmi_unified *wmi_handle)
 }
 #endif
 
-#ifdef WLAN_FEATURE_NAN
-/**
- * wmi_nan_feature_attach_tlv() - set NAN feature wmi callback
- * @wmi_handle: wmi handle
- *
- * Return: none
- */
-void wmi_nan_feature_attach_tlv(struct wmi_unified *wmi_handle);
-#else
-static inline void wmi_nan_feature_attach_tlv(struct wmi_unified *wmi_handle)
-{
-}
-#endif
-
 /**
  * wmi_align() - provides word aligned parameter
  * @param: parameter to be aligned

+ 0 - 12
wmi_unified_sta_api.h

@@ -146,18 +146,6 @@ QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id);
 QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl,
 					struct wlm_latency_level_param *param);
 
-#ifdef WLAN_FEATURE_NAN
-/**
- * wmi_unified_nan_req_cmd() - to send nan request to target
- * @wmi_handle: wmi handle
- * @nan_req: request data which will be non-null
- *
- * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
- */
-QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl,
-				   struct nan_req_params *nan_req);
-#endif
-
 /**
  * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware
  * @wmi_handle:    Pointer to WMi handle

+ 0 - 10
wmi_unified_sta_param.h

@@ -99,16 +99,6 @@ struct wlm_latency_level_param {
 	uint16_t vdev_id;
 };
 
-/**
- * struct nan_req_params - NAN request params
- * @request_data_len: request data length
- * @request_data: request data
- */
-struct nan_req_params {
-	uint16_t request_data_len;
-	uint8_t request_data[];
-};
-
 #ifndef CONVERGED_TDLS_ENABLE
 /**
  * struct tdls_chan_switch_params - channel switch parameter structure