1 2 /* 3 * Copyright (c) 2018 The Linux Foundation. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 /** 20 * DOC: Implement API's specific to TWT component. 21 */ 22 23 #ifndef _WMI_UNIFIED_TWT_API_H_ 24 #define _WMI_UNIFIED_TWT_API_H_ 25 26 #include "wmi_unified_twt_param.h" 27 28 29 /** 30 * wmi_unified_twt_enable_cmd() - Send WMI command to Enable TWT 31 * @wmi_hdl: wmi handle 32 * @params: Parameters to be configured 33 * 34 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 35 */ 36 QDF_STATUS wmi_unified_twt_enable_cmd(void *wmi_hdl, 37 struct wmi_twt_enable_param *params); 38 39 /** 40 * wmi_unified_twt_disable_cmd() - Send WMI command to disable TWT 41 * @wmi_hdl: wmi handle 42 * @params: Parameters to be configured 43 * 44 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 45 */ 46 QDF_STATUS wmi_unified_twt_disable_cmd(void *wmi_hdl, 47 struct wmi_twt_disable_param *params); 48 49 /** 50 * wmi_unified_twt_add_dialog_cmd() - Send WMI command to add TWT dialog 51 * @wmi_hdl: wmi handle 52 * @params: Parameters to be configured 53 * 54 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 55 */ 56 QDF_STATUS wmi_unified_twt_add_dialog_cmd(void *wmi_hdl, 57 struct wmi_twt_add_dialog_param *params); 58 59 /** 60 * wmi_unified_twt_del_dialog_cmd() - Send WMI command to delete TWT dialog 61 * @wmi_hdl: wmi handle 62 * @params: Parameters to be configured 63 * 64 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 65 */ 66 QDF_STATUS wmi_unified_twt_del_dialog_cmd(void *wmi_hdl, 67 struct wmi_twt_del_dialog_param *params); 68 69 /** 70 * wmi_unified_twt_pause_dialog_cmd() - Send WMI command to pause TWT dialog 71 * @wmi_hdl: wmi handle 72 * @params: Parameters to be configured 73 * 74 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 75 */ 76 QDF_STATUS wmi_unified_twt_pause_dialog_cmd(void *wmi_hdl, 77 struct wmi_twt_pause_dialog_cmd_param *params); 78 79 /** 80 * wmi_unified_twt_resume_dialog_cmd() - Send WMI command to resume TWT dialog 81 * @wmi_hdl: wmi handle 82 * @params: Parameters to be configured 83 * 84 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 85 */ 86 QDF_STATUS wmi_unified_twt_resume_dialog_cmd(void *wmi_hdl, 87 struct wmi_twt_resume_dialog_cmd_param *params); 88 89 /** 90 * wmi_extract_twt_enable_comp_event() - Extract WMI event params for TWT enable 91 * completion event 92 * @wmi_hdl: wmi handle 93 * @evt_buf: Pointer event buffer 94 * @params: Parameters to extract 95 * 96 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 97 */ 98 QDF_STATUS wmi_extract_twt_enable_comp_event(void *wmi_hdl, 99 uint8_t *evt_buf, 100 struct wmi_twt_enable_complete_event_param *params); 101 102 /** 103 * wmi_extract_twt_disable_comp_event() - Extract WMI event params for TWT 104 * disable completion event 105 * @wmi_hdl: wmi handle 106 * @evt_buf: Pointer event buffer 107 * @params: Parameters to extract 108 * 109 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 110 */ 111 QDF_STATUS wmi_extract_twt_disable_comp_event(void *wmi_hdl, 112 uint8_t *evt_buf, 113 struct wmi_twt_disable_complete_event *params); 114 115 /** 116 * wmi_extract_twt_add_dialog_comp_event() - Extract WMI event params for TWT 117 * add dialog completion event 118 * @wmi_hdl: wmi handle 119 * @evt_buf: Pointer event buffer 120 * @params: Parameters to extract 121 * 122 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 123 */ 124 QDF_STATUS wmi_extract_twt_add_dialog_comp_event(void *wmi_hdl, 125 uint8_t *evt_buf, 126 struct wmi_twt_add_dialog_complete_event_param *params); 127 128 /** 129 * wmi_extract_twt_del_dialog_comp_event() - Extract WMI event params for TWT 130 * delete dialog completion event 131 * @wmi_hdl: wmi handle 132 * @evt_buf: Pointer event buffer 133 * @params: Parameters to extract 134 * 135 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 136 */ 137 QDF_STATUS wmi_extract_twt_del_dialog_comp_event(void *wmi_hdl, 138 uint8_t *evt_buf, 139 struct wmi_twt_del_dialog_complete_event_param *params); 140 141 /** 142 * wmi_extract_twt_pause_dialog_comp_event() - Extract WMI event params for TWT 143 * pause dialog completion event 144 * @wmi_hdl: wmi handle 145 * @evt_buf: Pointer event buffer 146 * @params: Parameters to extract 147 * 148 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 149 */ 150 QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(void *wmi_hdl, 151 uint8_t *evt_buf, 152 struct wmi_twt_pause_dialog_complete_event_param *params); 153 154 /** 155 * wmi_extract_twt_resume_dialog_comp_event() - Extract WMI event params for TWT 156 * resume dialog completion event 157 * @wmi_hdl: wmi handle 158 * @evt_buf: Pointer event buffer 159 * @params: Parameters to extract 160 * 161 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 162 */ 163 QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(void *wmi_hdl, 164 uint8_t *evt_buf, 165 struct wmi_twt_resume_dialog_complete_event_param *params); 166 167 #ifdef WLAN_SUPPORT_TWT 168 void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle); 169 #else 170 static void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle) 171 { 172 return; 173 } 174 #endif 175 176 #endif /* _WMI_UNIFIED_TWT_API_H_ */ 177