|
@@ -1,5 +1,6 @@
|
|
|
/*
|
|
|
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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
|
|
@@ -23,8 +24,331 @@
|
|
|
#define _WMI_UNIFIED_TWT_API_H_
|
|
|
|
|
|
#include "wmi_unified_twt_param.h"
|
|
|
+#if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
|
|
|
+#include <wlan_twt_public_structs.h>
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_enable_cmd() - Send WMI command to Enable TWT
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
|
|
|
+ struct twt_enable_param *params);
|
|
|
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_disable_cmd() - Send WMI command to disable TWT
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
|
|
|
+ struct twt_disable_param *params);
|
|
|
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_add_dialog_cmd() - Send WMI command to add TWT dialog
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
|
|
|
+ struct twt_add_dialog_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_del_dialog_cmd() - Send WMI command to delete TWT dialog
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
|
|
|
+ struct twt_del_dialog_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_pause_dialog_cmd() - Send WMI command to pause TWT dialog
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
|
|
|
+ struct twt_pause_dialog_cmd_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_nudge_dialog_cmd() - Send WMI command to nudge TWT dialog
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,
|
|
|
+ struct twt_nudge_dialog_cmd_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_resume_dialog_cmd() - Send WMI command to resume TWT dialog
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ struct twt_resume_dialog_cmd_param *params);
|
|
|
+
|
|
|
+#ifdef WLAN_SUPPORT_BCAST_TWT
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_btwt_invite_sta_cmd() - Send WMI command for bTWT sta
|
|
|
+ * invitation
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_unified_twt_btwt_invite_sta_cmd(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ struct twt_btwt_invite_sta_cmd_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_unified_twt_btwt_remove_sta_cmd() - Send WMI command for bTWT sta kickoff
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @params: Parameters to be configured
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_unified_twt_btwt_remove_sta_cmd(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ struct twt_btwt_remove_sta_cmd_param *params);
|
|
|
+#endif
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_enable_comp_event() - Extract WMI event params for TWT enable
|
|
|
+ * completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_enable_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_enable_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_disable_comp_event() - Extract WMI event params for TWT
|
|
|
+ * disable completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_disable_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_disable_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_add_dialog_comp_event() - Extract WMI event params for TWT
|
|
|
+ * add dialog completion event
|
|
|
+ * @wmi_hdl: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_add_dialog_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_add_dialog_comp_additional_params() - Extracts additional
|
|
|
+ * twt parameters, as part of add dialog completion event
|
|
|
+ * @wmi_hdl: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @evt_buf_len: length of the add dialog event buffer
|
|
|
+ * @idx: index of num_twt_params to extract
|
|
|
+ * @additional_params: additional parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
|
|
|
+ wmi_unified_t wmi_handle, uint8_t *evt_buf,
|
|
|
+ uint32_t evt_buf_len, uint32_t idx,
|
|
|
+ struct twt_add_dialog_additional_params *additional_params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_del_dialog_comp_event() - Extract WMI event params for TWT
|
|
|
+ * delete dialog completion event
|
|
|
+ * @wmi_hdl: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_del_dialog_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_pause_dialog_comp_event() - Extract WMI event params for TWT
|
|
|
+ * pause dialog completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_pause_dialog_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_nudge_dialog_comp_event() - Extract WMI event params for TWT
|
|
|
+ * nudge dialog completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_nudge_dialog_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_nudge_dialog_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_resume_dialog_comp_event() - Extract WMI event params for TWT
|
|
|
+ * resume dialog completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_resume_dialog_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_notify_event() - Extract WMI event params for TWT
|
|
|
+ * notify event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_notify_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_notify_event_param *params);
|
|
|
+
|
|
|
+#ifdef WLAN_SUPPORT_BCAST_TWT
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_btwt_invite_sta_comp_event() - Extract WMI event params for
|
|
|
+ * BTWT sta invitation completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_btwt_invite_sta_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_btwt_invite_sta_complete_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_btwt_remove_sta_comp_event() - Extract WMI event params for
|
|
|
+ * BTWT sta kickoff completion event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_btwt_remove_sta_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_btwt_remove_sta_complete_event_param *params);
|
|
|
+#endif
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_session_stats_event() - Extract WMI event params for TWT
|
|
|
+ * session stats event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_session_stats_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_session_stats_event_param *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_session_stats_data() - Extract one TWT session from TWT
|
|
|
+ * session stats event
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ * @session: Session struct to save one TWT session
|
|
|
+ * @idx: TWT session index
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_session_stats_data(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_session_stats_event_param *params,
|
|
|
+ struct twt_session_stats_info *session,
|
|
|
+ uint32_t idx);
|
|
|
+
|
|
|
+void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_cap_service_ready_ext2: Extract TWT bitmap value
|
|
|
+ * received through extended
|
|
|
+ * service ready2 event
|
|
|
+ * @wmi_handle: WMI handle
|
|
|
+ * @evt_buf: Event buffer
|
|
|
+ * @param: Pointer to TWT bitmap param
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS for success or error code
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_cap_service_ready_ext2(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct wmi_twt_cap_bitmap_params *params);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wmi_extract_twt_ack_comp_event() - Extract WMI event params for TWT ack event
|
|
|
+ *
|
|
|
+ * @wmi_handle: wmi handle
|
|
|
+ * @evt_buf: Pointer event buffer
|
|
|
+ * @params: Parameters to extract
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
|
+ */
|
|
|
+QDF_STATUS wmi_extract_twt_ack_comp_event(
|
|
|
+ wmi_unified_t wmi_handle,
|
|
|
+ uint8_t *evt_buf,
|
|
|
+ struct twt_ack_complete_event_param *param);
|
|
|
+#elif defined(WLAN_SUPPORT_TWT)
|
|
|
/**
|
|
|
* wmi_unified_twt_enable_cmd() - Send WMI command to Enable TWT
|
|
|
* @wmi_handle: wmi handle
|
|
@@ -317,14 +641,7 @@ QDF_STATUS wmi_extract_twt_session_stats_data(
|
|
|
struct wmi_host_twt_session_stats_info *session,
|
|
|
uint32_t idx);
|
|
|
|
|
|
-#ifdef WLAN_SUPPORT_TWT
|
|
|
void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle);
|
|
|
-#else
|
|
|
-static void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle)
|
|
|
-{
|
|
|
- return;
|
|
|
-}
|
|
|
-#endif
|
|
|
|
|
|
/**
|
|
|
* wmi_extract_twt_cap_service_ready_ext2: Extract TWT bitmap value
|
|
@@ -354,5 +671,9 @@ QDF_STATUS wmi_extract_twt_ack_comp_event(
|
|
|
wmi_unified_t wmi_handle,
|
|
|
uint8_t *evt_buf,
|
|
|
struct wmi_twt_ack_complete_event_param *param);
|
|
|
-
|
|
|
+#else
|
|
|
+static inline void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle)
|
|
|
+{
|
|
|
+}
|
|
|
+#endif
|
|
|
#endif /* _WMI_UNIFIED_TWT_API_H_ */
|