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_process_set_ie_info_cmd() - Function to send IE info to firmware 151 * @wmi_handle: Pointer to WMi handle 152 * @ie_data: Pointer for ie data 153 * 154 * This function sends IE information to firmware 155 * 156 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 157 */ 158 QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl, 159 struct vdev_ie_info_param *ie_info); 160 161 /** 162 * wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw 163 * @wmi_hdl: wmi handle 164 * @custom_addr: base mac address 165 * 166 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 167 */ 168 QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl, 169 uint8_t *custom_addr); 170 171 #ifdef CONVERGED_TDLS_ENABLE 172 /** 173 * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode 174 * @wmi_handle: wmi handle 175 * @chan_switch_params: Pointer to tdls channel switch parameter structure 176 * 177 * This function sets tdls off channel mode 178 * 179 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures; 180 * Negative errno otherwise 181 */ 182 QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd(void *wmi_hdl, 183 struct tdls_channel_switch_params *chan_switch_params); 184 185 /** 186 * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev 187 * @wmi_handle: wmi handle 188 * @tdls_param: TDLS params 189 * @tdls_state: TDLS state 190 * 191 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 192 */ 193 QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(void *wmi_hdl, 194 struct tdls_info *tdls_param, 195 enum wmi_tdls_state tdls_state); 196 197 /** 198 * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state 199 * @wmi_handle: wmi handle 200 * @peerStateParams: TDLS peer state params 201 * 202 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 203 */ 204 QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(void *wmi_hdl, 205 struct tdls_peer_state_params *peerStateParams, 206 uint32_t *ch_mhz); 207 208 /** 209 * wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event 210 * @wmi_handle: wmi handle 211 * @param evt_buf: pointer to event buffer 212 * @param param: Pointer to hold vdev tdls param 213 * 214 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 215 */ 216 QDF_STATUS wmi_extract_vdev_tdls_ev_param(void *wmi_hdl, void *evt_buf, 217 struct tdls_event_info *param); 218 #endif /* CONVERGED_TDLS_ENABLE */ 219 220 /** 221 * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw 222 * @wmi_hdl: wmi handle 223 * @params: sar limit command params 224 * 225 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 226 */ 227 QDF_STATUS wmi_unified_send_sar_limit_cmd(void *wmi_hdl, 228 struct sar_limit_cmd_params *params); 229 230 /** 231 * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW 232 * @wmi_hdl: wmi handle 233 * 234 * Return: QDF_STATUS_SUCCESS for success or error code 235 */ 236 QDF_STATUS wmi_unified_get_sar_limit_cmd(void *wmi_hdl); 237 238 /** 239 * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event 240 * @wmi_hdl: wmi handle 241 * @evt_buf: event buffer received from firmware 242 * @event: SAR limit event which is to be populated by data extracted from 243 * the @evt_buf buffer 244 * 245 * Return: QDF_STATUS_SUCCESS for success or error code 246 */ 247 QDF_STATUS wmi_unified_extract_sar_limit_event(void *wmi_hdl, 248 uint8_t *evt_buf, 249 struct sar_limit_event *event); 250 251 /** 252 * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event 253 * @handle: wmi handle 254 * @event: event buffer received from firmware 255 * @len: length of the event buffer 256 * 257 * Return: QDF_STATUS_SUCCESS for success or error code 258 */ 259 QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle, 260 uint8_t *event, uint32_t len); 261 262 /* 263 * wmi_unified_set_del_pmkid_cache() - set delete PMKID 264 * @wmi_hdl: wma handle 265 * @pmksa: pointer to pmk cache entry 266 * 267 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 268 */ 269 QDF_STATUS wmi_unified_set_del_pmkid_cache(void *wmi_hdl, 270 struct wmi_unified_pmk_cache *pmksa); 271 272 /** 273 * wmi_unified_del_ts_cmd() - send DELTS request to fw 274 * @wmi_handle: wmi handle 275 * @msg: delts params 276 * 277 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 278 */ 279 QDF_STATUS wmi_unified_del_ts_cmd(void *wmi_hdl, uint8_t vdev_id, 280 uint8_t ac); 281 282 /** 283 * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw 284 * @wmi_handle: handle to wmi 285 * @aggr_qos_rsp_msg - combined struct for all ADD_TS requests. 286 * 287 * A function to handle WMI_AGGR_QOS_REQ. This will send out 288 * ADD_TS requestes to firmware in loop for all the ACs with 289 * active flow. 290 * 291 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 292 */ 293 QDF_STATUS wmi_unified_aggr_qos_cmd(void *wmi_hdl, 294 struct aggr_add_ts_param *aggr_qos_rsp_msg); 295 296 /** 297 * wmi_unified_add_ts_cmd() - send ADDTS request to fw 298 * @wmi_handle: wmi handle 299 * @msg: ADDTS params 300 * 301 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 302 */ 303 QDF_STATUS wmi_unified_add_ts_cmd(void *wmi_hdl, 304 struct add_ts_param *msg); 305 306 /** 307 * wmi_unified_process_add_periodic_tx_ptrn_cmd() - add periodic tx pattern 308 * @wmi_handle: wmi handle 309 * @pattern: tx pattern parameters 310 * @vdev_id: vdev id 311 * 312 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 313 */ 314 QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd( 315 wmi_unified_t wmi_handle, 316 struct periodic_tx_pattern *pattern, 317 uint8_t vdev_id); 318 319 /** 320 * wmi_unified_process_del_periodic_tx_ptrn_cmd() - del periodic tx ptrn 321 * @wmi_handle: wmi handle 322 * @vdev_id: vdev id 323 * @pattern_id: pattern id 324 * 325 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 326 */ 327 QDF_STATUS wmi_unified_process_del_periodic_tx_ptrn_cmd(void *wmi_hdl, 328 uint8_t vdev_id, 329 uint8_t pattern_id); 330 331 /** 332 * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown 333 * timer in firmware 334 * @wmi_handle: wmi handle 335 * @timer_val: auto shutdown timer value 336 * 337 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 338 */ 339 QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(void *wmi_hdl, 340 uint32_t timer_val); 341 342 /** 343 * wmi_unified_set_led_flashing_cmd() - set led flashing in fw 344 * @wmi_hdl: wmi handle 345 * @flashing: flashing request 346 * 347 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 348 */ 349 QDF_STATUS wmi_unified_set_led_flashing_cmd(void *wmi_hdl, 350 struct flashing_req_params *flashing); 351 352 /** 353 * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid 354 * update request 355 * @wmi_handle: wmi handle 356 * @ch_avoid_update_req: channel avoid update params 357 * 358 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 359 */ 360 QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(void *wmi_hdl); 361 362 /** 363 * wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW 364 * @wmi_hdl: wmi handle 365 * @msg: PCL structure containing the PCL and the number of channels 366 * 367 * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN 368 * firmware. The DBS Manager is the consumer of this information in the WLAN 369 * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs 370 * to migrate to a new channel without host driver involvement. An example of 371 * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will 372 * manage the channel selection without firmware involvement. 373 * 374 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 375 */ 376 QDF_STATUS wmi_unified_pdev_set_pcl_cmd(void *wmi_hdl, 377 struct wmi_pcl_chan_weights *msg); 378 379 /** 380 * wmi_unified_soc_set_hw_mode_cmd() - Send WMI_SOC_SET_HW_MODE_CMDID to FW 381 * @wmi_hdl: wmi handle 382 * @msg: Structure containing the following parameters 383 * 384 * - hw_mode_index: The HW_Mode field is a enumerated type that is selected 385 * from the HW_Mode table, which is returned in the WMI_SERVICE_READY_EVENTID. 386 * 387 * Provides notification to the WLAN firmware that host driver is requesting a 388 * HardWare (HW) Mode change. This command is needed to support iHelium in the 389 * configurations that include the Dual Band Simultaneous (DBS) feature. 390 * 391 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 392 */ 393 QDF_STATUS wmi_unified_soc_set_hw_mode_cmd(void *wmi_hdl, 394 uint32_t hw_mode_index); 395 396 #ifdef WLAN_POLICY_MGR_ENABLE 397 /** 398 * wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW 399 * @wmi_hdl: wmi handle 400 * @msg: Dual MAC config parameters 401 * 402 * Configures WLAN firmware with the dual MAC features 403 * 404 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures. 405 */ 406 QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd(void *wmi_hdl, 407 struct policy_mgr_dual_mac_config *msg); 408 #endif /* WLAN_POLICY_MGR_ENABLE */ 409 410 /** 411 * wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of 412 * adaptive dwelltime configuration params 413 * @wma_handle: wma handler 414 * @dwelltime_params: pointer to dwelltime_params 415 * 416 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure 417 */ 418 QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl, 419 struct wmi_adaptive_dwelltime_params * 420 wmi_param); 421 422 /** 423 * wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of 424 * DBS scan selection configuration params 425 * @wma_handle: wma handler 426 * @dbs_scan_params: pointer to wmi_dbs_scan_sel_params 427 * 428 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure 429 */ 430 QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd(void *wmi_hdl, 431 struct wmi_dbs_scan_sel_params *wmi_param); 432 433 /** 434 * wmi_unified_set_arp_stats_req() - set arp stats request 435 * @wmi_hdl: wmi handle 436 * @req_buf: pointer to set_arp_stats 437 * 438 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 439 */ 440 QDF_STATUS wmi_unified_set_arp_stats_req(void *wmi_hdl, 441 struct set_arp_stats *req_buf); 442 443 /** 444 * wmi_unified_get_arp_stats_req() - get arp stats request 445 * @wmi_hdl: wmi handle 446 * @req_buf: pointer to get_arp_stats 447 * 448 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 449 */ 450 QDF_STATUS wmi_unified_get_arp_stats_req(void *wmi_hdl, 451 struct get_arp_stats *req_buf); 452 453 /** 454 * wmi_unified_peer_unmap_conf_send() - send PEER unmap conf command to fw 455 * @wmi: wmi handle 456 * @vdev_id: vdev id 457 * @peer_id_cnt: number of peer id 458 * @peer_id_list: list of peer ids 459 * 460 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 461 */ 462 QDF_STATUS wmi_unified_peer_unmap_conf_send(void *wmi_hdl, 463 uint8_t vdev_id, 464 uint32_t peer_id_cnt, 465 uint16_t *peer_id_list); 466 467 #endif /* _WMI_UNIFIED_STA_API_H_ */ 468