1 /* 2 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: Implement API's specific to STA component. 21 */ 22 23 #ifndef _WMI_UNIFIED_STA_API_H_ 24 #define _WMI_UNIFIED_STA_API_H_ 25 26 #include "wlan_disa_public_struct.h" 27 #include "wlan_tdls_public_structs.h" 28 #include "wlan_policy_mgr_public_struct.h" 29 #include "wmi_unified_sta_param.h" 30 31 struct policy_mgr_dual_mac_config; 32 33 /** 34 * wmi_unified_set_sta_sa_query_param_cmd() - set sta sa query parameters 35 * @wmi_hdl: wmi handle 36 * @vdev_id: vdev id 37 * @max_retries: max retries 38 * @retry_interval: retry interval 39 * This function sets sta query related parameters in fw. 40 * 41 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 42 */ 43 QDF_STATUS wmi_unified_set_sta_sa_query_param_cmd(void *wmi_hdl, 44 uint8_t vdev_id, 45 uint32_t max_retries, 46 uint32_t retry_interval); 47 48 /** 49 * wmi_unified_set_sta_keep_alive_cmd() - set sta keep alive parameters 50 * @wmi_hdl: wmi handle 51 * @params: sta keep alive parameter 52 * 53 * This function sets keep alive related parameters in fw. 54 * 55 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 56 */ 57 QDF_STATUS wmi_unified_set_sta_keep_alive_cmd(void *wmi_hdl, 58 struct sta_params *params); 59 60 /** 61 * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params 62 * @wmi_hdl: wmi handle 63 * @if_id: vdev id 64 * @gtx_info: GTX config params 65 * 66 * This function set GTX related params in firmware. 67 * 68 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 69 */ 70 QDF_STATUS wmi_unified_vdev_set_gtx_cfg_cmd(void *wmi_hdl, uint32_t if_id, 71 struct wmi_gtx_config *gtx_info); 72 73 #ifdef WLAN_FEATURE_DISA 74 /** 75 * wmi_unified_encrypt_decrypt_send_cmd() - send encryptdecrypt cmd to fw 76 * @wmi_hdl: wmi handle 77 * @params: encrypt/decrypt params 78 * 79 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 80 */ 81 QDF_STATUS wmi_unified_encrypt_decrypt_send_cmd(void *wmi_hdl, 82 struct disa_encrypt_decrypt_req_params *params); 83 84 /** 85 * wmi_extract_encrypt_decrypt_resp_params() - 86 * extract encrypt decrypt resp params from event buffer 87 * @wmi_handle: wmi handle 88 * @evt_buf: pointer to event buffer 89 * @resp: encrypt decrypt resp params 90 * 91 * Return: QDF_STATUS_SUCCESS for success or error code 92 */ 93 QDF_STATUS wmi_extract_encrypt_decrypt_resp_params(void *wmi_hdl, 94 uint8_t *evt_buf, 95 struct disa_encrypt_decrypt_resp_params *resp); 96 #endif /* WLAN_FEATURE_DISA */ 97 98 /** 99 * wmi_unified_process_dhcp_ind() - process dhcp indication from SME 100 * @wmi_handle: wmi handle 101 * @ta_dhcp_ind: DHCP indication parameter 102 * 103 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 104 */ 105 QDF_STATUS wmi_unified_process_dhcp_ind(void *wmi_hdl, 106 wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind); 107 108 /** 109 * wmi_unified_get_link_speed_cmd() -send command to get linkspeed 110 * @wmi_handle: wmi handle 111 * @pLinkSpeed: link speed info 112 * 113 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 114 */ 115 QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl, 116 wmi_mac_addr peer_macaddr); 117 118 /** 119 * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW 120 * @wmi_handl: wmi handle 121 * @cmd: Profiling command index 122 * @value1: parameter1 value 123 * @value2: parameter2 value 124 * 125 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 126 */ 127 QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl, 128 uint32_t cmd, uint32_t value1, uint32_t value2); 129 130 /** 131 * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter 132 * @wmi_handle: wmi handle 133 * @vdev_id: vdev id 134 * 135 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 136 */ 137 QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id); 138 139 /** 140 * wmi_unified_set_latency_config_cmd() 141 * @wmi_handle: wmi handle 142 * @param: WLM parameters 143 * 144 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 145 */ 146 QDF_STATUS wmi_unified_wlm_latency_level_cmd(void *wmi_hdl, 147 struct wlm_latency_level_param *param); 148 149 /** 150 * wmi_unified_nan_req_cmd() - to send nan request to target 151 * @wmi_handle: wmi handle 152 * @nan_req: request data which will be non-null 153 * 154 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 155 */ 156 QDF_STATUS wmi_unified_nan_req_cmd(void *wmi_hdl, 157 struct nan_req_params *nan_req); 158 159 /** 160 * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware 161 * @wmi_handle: Pointer to WMi handle 162 * @ie_data: Pointer for ie data 163 * 164 * This function sends IE information to firmware 165 * 166 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 167 */ 168 QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl, 169 struct vdev_ie_info_param *ie_info); 170 171 /** 172 * wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw 173 * @wmi_hdl: wmi handle 174 * @custom_addr: base mac address 175 * 176 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 177 */ 178 QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl, 179 uint8_t *custom_addr); 180 181 #ifdef CONVERGED_TDLS_ENABLE 182 /** 183 * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode 184 * @wmi_handle: wmi handle 185 * @chan_switch_params: Pointer to tdls channel switch parameter structure 186 * 187 * This function sets tdls off channel mode 188 * 189 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures; 190 * Negative errno otherwise 191 */ 192 QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl, 193 struct tdls_channel_switch_params *chan_switch_params); 194 195 /** 196 * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev 197 * @wmi_handle: wmi handle 198 * @pwmaTdlsparams: TDLS params 199 * 200 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 201 */ 202 QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl, 203 void *tdls_param, 204 uint8_t tdls_state); 205 206 /** 207 * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state 208 * @wmi_handle: wmi handle 209 * @peerStateParams: TDLS peer state params 210 * 211 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 212 */ 213 QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl, 214 struct tdls_peer_state_params *peerStateParams, 215 uint32_t *ch_mhz); 216 217 /** 218 * wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event 219 * @wmi_handle: wmi handle 220 * @param evt_buf: pointer to event buffer 221 * @param param: Pointer to hold vdev tdls param 222 * 223 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 224 */ 225 QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf, 226 struct tdls_event_info *param); 227 #endif /* CONVERGED_TDLS_ENABLE */ 228 229 /** 230 * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw 231 * @wmi_hdl: wmi handle 232 * @params: sar limit command params 233 * 234 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 235 */ 236 QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl, 237 struct sar_limit_cmd_params *params); 238 239 /** 240 * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW 241 * @wmi_hdl: wmi handle 242 * 243 * Return: QDF_STATUS_SUCCESS for success or error code 244 */ 245 QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl); 246 247 /** 248 * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event 249 * @wmi_hdl: wmi handle 250 * @evt_buf: event buffer received from firmware 251 * @event: SAR limit event which is to be populated by data extracted from 252 * the @evt_buf buffer 253 * 254 * Return: QDF_STATUS_SUCCESS for success or error code 255 */ 256 QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl, 257 uint8_t *evt_buf, 258 struct sar_limit_event *event); 259 260 /** 261 * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event 262 * @handle: wmi handle 263 * @event: event buffer received from firmware 264 * @len: length of the event buffer 265 * 266 * Return: QDF_STATUS_SUCCESS for success or error code 267 */ 268 QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle, 269 uint8_t *event, uint32_t len); 270 271 /* 272 * wmi_unified_set_del_pmkid_cache() - set delete PMKID 273 * @wmi_hdl: wma handle 274 * @pmksa: pointer to pmk cache entry 275 * 276 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 277 */ 278 QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl, 279 struct wmi_unified_pmk_cache *pmksa); 280 281 /** 282 * wmi_unified_del_ts_cmd() - send DELTS request to fw 283 * @wmi_handle: wmi handle 284 * @msg: delts params 285 * 286 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 287 */ 288 QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id, 289 uint8_t ac); 290 291 /** 292 * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw 293 * @wmi_handle: handle to wmi 294 * @aggr_qos_rsp_msg - combined struct for all ADD_TS requests. 295 * 296 * A function to handle WMI_AGGR_QOS_REQ. This will send out 297 * ADD_TS requestes to firmware in loop for all the ACs with 298 * active flow. 299 * 300 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 301 */ 302 QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl, 303 struct aggr_add_ts_param *aggr_qos_rsp_msg); 304 305 /** 306 * wmi_unified_add_ts_cmd() - send ADDTS request to fw 307 * @wmi_handle: wmi handle 308 * @msg: ADDTS params 309 * 310 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 311 */ 312 QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl, 313 struct add_ts_param *msg); 314 315 /** 316 * wmi_unified_process_add_periodic_tx_ptrn_cmd - add periodic tx ptrn 317 * @wmi_handle: wmi handle 318 * @pAddPeriodicTxPtrnParams: tx ptrn params 319 * 320 * Retrun: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 321 */ 322 QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd(void *wmi_hdl, 323 struct periodic_tx_pattern * 324 pAddPeriodicTxPtrnParams, 325 uint8_t vdev_id); 326 327 /** 328 * wmi_unified_process_del_periodic_tx_ptrn_cmd - del periodic tx ptrn 329 * @wmi_handle: wmi handle 330 * @vdev_id: vdev id 331 * @pattern_id: pattern id 332 * 333 * Retrun: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 334 */ 335 QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl, 336 uint8_t vdev_id, 337 uint8_t pattern_id); 338 339 /** 340 * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown 341 * timer in firmware 342 * @wmi_handle: wmi handle 343 * @timer_val: auto shutdown timer value 344 * 345 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 346 */ 347 QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl, 348 uint32_t timer_val); 349 350 /** 351 * wmi_unified_set_led_flashing_cmd() - set led flashing in fw 352 * @wmi_hdl: wmi handle 353 * @flashing: flashing request 354 * 355 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 356 */ 357 QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl, 358 struct flashing_req_params *flashing); 359 360 /** 361 * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid 362 * update request 363 * @wmi_handle: wmi handle 364 * @ch_avoid_update_req: channel avoid update params 365 * 366 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 367 */ 368 QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl); 369 370 /** 371 * wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW 372 * @wmi_hdl: wmi handle 373 * @msg: PCL structure containing the PCL and the number of channels 374 * 375 * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN 376 * firmware. The DBS Manager is the consumer of this information in the WLAN 377 * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs 378 * to migrate to a new channel without host driver involvement. An example of 379 * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will 380 * manage the channel selection without firmware involvement. 381 * 382 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 383 */ 384 QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl, 385 struct wmi_pcl_chan_weights *msg); 386 387 /** 388 * wmi_unified_soc_set_hw_mode_cmd() - Send WMI_SOC_SET_HW_MODE_CMDID to FW 389 * @wmi_hdl: wmi handle 390 * @msg: Structure containing the following parameters 391 * 392 * - hw_mode_index: The HW_Mode field is a enumerated type that is selected 393 * from the HW_Mode table, which is returned in the WMI_SERVICE_READY_EVENTID. 394 * 395 * Provides notification to the WLAN firmware that host driver is requesting a 396 * HardWare (HW) Mode change. This command is needed to support iHelium in the 397 * configurations that include the Dual Band Simultaneous (DBS) feature. 398 * 399 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 400 */ 401 QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl, 402 uint32_t hw_mode_index); 403 404 #ifdef WLAN_POLICY_MGR_ENABLE 405 /** 406 * wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW 407 * @wmi_hdl: wmi handle 408 * @msg: Dual MAC config parameters 409 * 410 * Configures WLAN firmware with the dual MAC features 411 * 412 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures. 413 */ 414 QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl, 415 struct policy_mgr_dual_mac_config *msg); 416 #endif /* WLAN_POLICY_MGR_ENABLE */ 417 418 /** 419 * wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of 420 * adaptive dwelltime configuration params 421 * @wma_handle: wma handler 422 * @dwelltime_params: pointer to dwelltime_params 423 * 424 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure 425 */ 426 QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl, 427 struct wmi_adaptive_dwelltime_params * 428 wmi_param); 429 430 /** 431 * wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of 432 * DBS scan selection configuration params 433 * @wma_handle: wma handler 434 * @dbs_scan_params: pointer to wmi_dbs_scan_sel_params 435 * 436 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure 437 */ 438 QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl, 439 struct wmi_dbs_scan_sel_params *wmi_param); 440 441 /** 442 * wmi_unified_set_arp_stats_req() - set arp stats request 443 * @wmi_hdl: wmi handle 444 * @req_buf: pointer to set_arp_stats 445 * 446 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 447 */ 448 QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl, 449 struct set_arp_stats *req_buf); 450 451 /** 452 * wmi_unified_get_arp_stats_req() - get arp stats request 453 * @wmi_hdl: wmi handle 454 * @req_buf: pointer to get_arp_stats 455 * 456 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 457 */ 458 QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl, 459 struct get_arp_stats *req_buf); 460 461 #endif /* _WMI_UNIFIED_STA_API_H_ */ 462