Files
android_kernel_samsung_sm86…/wmi/inc/wmi_unified_twt_api.h
Jyoti Kumari fc3c62d771 qcacmn: Add support for TWT ack event
In case if TWT command (i.e setup, terminate, pause, resume,
nudge) comes from userspace and if the firmware is in below mode
1. scan in progress
2. roam in progress
3. CSA is in progress or
4. Any other error
then the command needs to be rejected in userspace context.

Synchronize the TWT command so that whenever command goes from
driver to firmware, then driver will receive ack event first
followed by respective event (i.e add dialog, delete dialog,
pause, resume, nudge) with below condition
1. If driver receives the ack event as successful then driver
   waits for this ack event, respective event with status of the
   TWT action frame over the air is expected.
2. If driver receives the ack event as failure then it will
   rejects the TWT command in userspace context.

Change-Id: Ie885d98ecf2dad98d34676d889fd70e4c84f0a05
CRs-Fixed: 2987904
2021-07-20 11:09:21 -07:00

359 行
12 KiB
C

/*
* Copyright (c) 2018-2021 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
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: Implement API's specific to TWT component.
*/
#ifndef _WMI_UNIFIED_TWT_API_H_
#define _WMI_UNIFIED_TWT_API_H_
#include "wmi_unified_twt_param.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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_twt_disable_complete_event *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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_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 wmi_twt_session_stats_event_param *params,
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
* 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 wmi_twt_ack_complete_event_param *param);
#endif /* _WMI_UNIFIED_TWT_API_H_ */