1 /* 2 * Copyright (c) 2013-2020 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_handle: 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(wmi_unified_t wmi_handle, 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_handle: 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 58 wmi_unified_set_sta_keep_alive_cmd(wmi_unified_t wmi_handle, 59 struct sta_keep_alive_params *params); 60 61 /** 62 * wmi_unified_vdev_set_gtx_cfg_cmd() - set GTX params 63 * @wmi_handle: wmi handle 64 * @if_id: vdev id 65 * @gtx_info: GTX config params 66 * 67 * This function set GTX related params in firmware. 68 * 69 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 70 */ 71 QDF_STATUS 72 wmi_unified_vdev_set_gtx_cfg_cmd(wmi_unified_t wmi_handle, uint32_t if_id, 73 struct wmi_gtx_config *gtx_info); 74 75 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(FEATURE_BLACKLIST_MGR) 76 /** 77 * wmi_unified_send_reject_ap_list() - send the reject ap list maintained by 78 * BLM to FW for roaming cases. 79 * @wmi_handle: wmi handle 80 * @reject_params: This contains the reject ap list, and the num of BSSIDs. 81 * 82 * Return: QDF_STATUS_SUCCESS for success or error code 83 */ 84 QDF_STATUS 85 wmi_unified_send_reject_ap_list(struct wmi_unified *wmi_handle, 86 struct reject_ap_params *reject_params); 87 #endif 88 89 /** 90 * wmi_unified_process_dhcp_ind() - process dhcp indication from SME 91 * @wmi_handle: wmi handle 92 * @ta_dhcp_ind: DHCP indication parameter 93 * 94 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 95 */ 96 QDF_STATUS wmi_unified_process_dhcp_ind( 97 wmi_unified_t wmi_handle, 98 wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind); 99 100 /** 101 * wmi_unified_get_link_speed_cmd() -send command to get linkspeed 102 * @wmi_handle: wmi handle 103 * @peer_macaddr: peer MAC address 104 * 105 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 106 */ 107 QDF_STATUS wmi_unified_get_link_speed_cmd(wmi_unified_t wmi_handle, 108 wmi_mac_addr peer_macaddr); 109 110 /** 111 * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW 112 * @wmi_handle: wmi handle 113 * @cmd: Profiling command index 114 * @value1: parameter1 value 115 * @value2: parameter2 value 116 * 117 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 118 */ 119 QDF_STATUS wmi_unified_fw_profiling_data_cmd(wmi_unified_t wmi_handle, 120 uint32_t cmd, 121 uint32_t value1, 122 uint32_t value2); 123 124 /** 125 * wmi_unified_nat_keepalive_en_cmd() - enable NAT keepalive filter 126 * @wmi_handle: wmi handle 127 * @vdev_id: vdev id 128 * 129 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 130 */ 131 QDF_STATUS wmi_unified_nat_keepalive_en_cmd(wmi_unified_t wmi_handle, 132 uint8_t vdev_id); 133 134 /** 135 * wmi_unified_wlm_latency_level_cmd() - set latency level 136 * @wmi_handle: wmi handle 137 * @param: WLM parameters 138 * 139 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 140 */ 141 QDF_STATUS 142 wmi_unified_wlm_latency_level_cmd(wmi_unified_t wmi_handle, 143 struct wlm_latency_level_param *param); 144 145 /** 146 * wmi_unified_process_set_ie_info_cmd() - Function to send IE info to firmware 147 * @wmi_handle: Pointer to WMi handle 148 * @ie_data: Pointer for ie data 149 * 150 * This function sends IE information to firmware 151 * 152 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 153 */ 154 QDF_STATUS 155 wmi_unified_process_set_ie_info_cmd(wmi_unified_t wmi_handle, 156 struct vdev_ie_info_param *ie_info); 157 158 /** 159 * wmi_unified_set_base_macaddr_indicate_cmd() - set base mac address in fw 160 * @wmi_handle: wmi handle 161 * @custom_addr: base mac address 162 * 163 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 164 */ 165 QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(wmi_unified_t wmi_handle, 166 uint8_t *custom_addr); 167 168 #ifdef FEATURE_WLAN_TDLS 169 /** 170 * wmi_unified_set_tdls_offchan_mode_cmd() - set tdls off channel mode 171 * @wmi_handle: wmi handle 172 * @chan_switch_params: Pointer to tdls channel switch parameter structure 173 * 174 * This function sets tdls off channel mode 175 * 176 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures; 177 * Negative errno otherwise 178 */ 179 QDF_STATUS wmi_unified_set_tdls_offchan_mode_cmd( 180 wmi_unified_t wmi_handle, 181 struct tdls_channel_switch_params *chan_switch_params); 182 183 /** 184 * wmi_unified_update_fw_tdls_state_cmd() - send enable/disable tdls for a vdev 185 * @wmi_handle: wmi handle 186 * @tdls_param: TDLS params 187 * @tdls_state: TDLS state 188 * 189 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 190 */ 191 QDF_STATUS wmi_unified_update_fw_tdls_state_cmd(wmi_unified_t wmi_handle, 192 struct tdls_info *tdls_param, 193 enum wmi_tdls_state tdls_state); 194 195 /** 196 * wmi_unified_update_tdls_peer_state_cmd() - update TDLS peer state 197 * @wmi_handle: wmi handle 198 * @peer_state: TDLS peer state params 199 * 200 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 201 */ 202 QDF_STATUS wmi_unified_update_tdls_peer_state_cmd(wmi_unified_t wmi_handle, 203 struct tdls_peer_update_state *peer_state, 204 uint32_t *ch_mhz); 205 206 /** 207 * wmi_extract_vdev_tdls_ev_param - extract vdev tdls param from event 208 * @wmi_handle: wmi handle 209 * @evt_buf: pointer to event buffer 210 * @param: Pointer to hold vdev tdls param 211 * 212 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 213 */ 214 QDF_STATUS wmi_extract_vdev_tdls_ev_param(wmi_unified_t wmi_handle, 215 void *evt_buf, 216 struct tdls_event_info *param); 217 #endif /* FEATURE_WLAN_TDLS */ 218 219 /** 220 * wmi_unified_send_sar_limit_cmd() - send sar limit cmd to fw 221 * @wmi_handle: wmi handle 222 * @params: sar limit command params 223 * 224 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 225 */ 226 QDF_STATUS wmi_unified_send_sar_limit_cmd(wmi_unified_t wmi_handle, 227 struct sar_limit_cmd_params *params); 228 229 /** 230 * wmi_unified_get_sar_limit_cmd() - request current SAR limits from FW 231 * @wmi_handle: wmi handle 232 * 233 * Return: QDF_STATUS_SUCCESS for success or error code 234 */ 235 QDF_STATUS wmi_unified_get_sar_limit_cmd(wmi_unified_t wmi_handle); 236 237 /** 238 * wmi_unified_extract_sar_limit_event() - extract SAR limits from FW event 239 * @wmi_handle: wmi handle 240 * @evt_buf: event buffer received from firmware 241 * @event: SAR limit event which is to be populated by data extracted from 242 * the @evt_buf buffer 243 * 244 * Return: QDF_STATUS_SUCCESS for success or error code 245 */ 246 QDF_STATUS wmi_unified_extract_sar_limit_event(wmi_unified_t wmi_handle, 247 uint8_t *evt_buf, 248 struct sar_limit_event *event); 249 250 /** 251 * wmi_unified_extract_sar2_result_event() - extract SAR limits from FW event 252 * @handle: wmi handle 253 * @event: event buffer received from firmware 254 * @len: length of the event buffer 255 * 256 * Return: QDF_STATUS_SUCCESS for success or error code 257 */ 258 QDF_STATUS wmi_unified_extract_sar2_result_event(void *handle, 259 uint8_t *event, uint32_t len); 260 261 /* 262 * wmi_unified_set_del_pmkid_cache() - set delete PMKID 263 * @wmi_handle: wma handle 264 * @pmksa: pointer to pmk cache entry 265 * 266 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 267 */ 268 QDF_STATUS 269 wmi_unified_set_del_pmkid_cache(wmi_unified_t wmi_handle, 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 * @vdev_id: vdev id 276 * @ac: ac param 277 * 278 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 279 */ 280 QDF_STATUS wmi_unified_del_ts_cmd(wmi_unified_t wmi_handle, uint8_t vdev_id, 281 uint8_t ac); 282 283 /** 284 * wmi_unified_aggr_qos_cmd() - send aggr qos request to fw 285 * @wmi_handle: handle to wmi 286 * @aggr_qos_rsp_msg: combined struct for all ADD_TS requests. 287 * 288 * A function to handle WMI_AGGR_QOS_REQ. This will send out 289 * ADD_TS requestes to firmware in loop for all the ACs with 290 * active flow. 291 * 292 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 293 */ 294 QDF_STATUS wmi_unified_aggr_qos_cmd( 295 wmi_unified_t wmi_handle, 296 struct aggr_add_ts_param *aggr_qos_rsp_msg); 297 298 /** 299 * wmi_unified_add_ts_cmd() - send ADDTS request to fw 300 * @wmi_handle: wmi handle 301 * @msg: ADDTS params 302 * 303 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 304 */ 305 QDF_STATUS wmi_unified_add_ts_cmd(wmi_unified_t wmi_handle, 306 struct add_ts_param *msg); 307 308 /** 309 * wmi_unified_process_add_periodic_tx_ptrn_cmd() - add periodic tx pattern 310 * @wmi_handle: wmi handle 311 * @pattern: tx pattern parameters 312 * @vdev_id: vdev id 313 * 314 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 315 */ 316 QDF_STATUS wmi_unified_process_add_periodic_tx_ptrn_cmd( 317 wmi_unified_t wmi_handle, 318 struct periodic_tx_pattern *pattern, 319 uint8_t vdev_id); 320 321 /** 322 * wmi_unified_process_del_periodic_tx_ptrn_cmd() - del periodic tx ptrn 323 * @wmi_handle: wmi handle 324 * @vdev_id: vdev id 325 * @pattern_id: pattern id 326 * 327 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 328 */ 329 QDF_STATUS 330 wmi_unified_process_del_periodic_tx_ptrn_cmd(wmi_unified_t wmi_handle, 331 uint8_t vdev_id, 332 uint8_t pattern_id); 333 334 /** 335 * wmi_unified_set_auto_shutdown_timer_cmd() - sets auto shutdown 336 * timer in firmware 337 * @wmi_handle: wmi handle 338 * @timer_val: auto shutdown timer value 339 * 340 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 341 */ 342 QDF_STATUS wmi_unified_set_auto_shutdown_timer_cmd(wmi_unified_t wmi_handle, 343 uint32_t timer_val); 344 345 /** 346 * wmi_unified_set_led_flashing_cmd() - set led flashing in fw 347 * @wmi_handle: wmi handle 348 * @flashing: flashing request 349 * 350 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 351 */ 352 QDF_STATUS 353 wmi_unified_set_led_flashing_cmd(wmi_unified_t wmi_handle, 354 struct flashing_req_params *flashing); 355 356 /** 357 * wmi_unified_process_ch_avoid_update_cmd() - handles channel avoid 358 * update request 359 * @wmi_handle: wmi handle 360 * 361 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 362 */ 363 QDF_STATUS wmi_unified_process_ch_avoid_update_cmd(wmi_unified_t wmi_handle); 364 365 /** 366 * wmi_unified_pdev_set_pcl_cmd() - Send WMI_SOC_SET_PCL_CMDID to FW 367 * @wmi_handle: wmi handle 368 * @msg: PCL structure containing the PCL and the number of channels 369 * 370 * WMI_SOC_SET_PCL_CMDID provides a Preferred Channel List (PCL) to the WLAN 371 * firmware. The DBS Manager is the consumer of this information in the WLAN 372 * firmware. The channel list will be used when a Virtual DEVice (VDEV) needs 373 * to migrate to a new channel without host driver involvement. An example of 374 * this behavior is Legacy Fast Roaming (LFR 3.0). Generally, the host will 375 * manage the channel selection without firmware involvement. 376 * 377 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 378 */ 379 QDF_STATUS wmi_unified_pdev_set_pcl_cmd(wmi_unified_t wmi_handle, 380 struct wmi_pcl_chan_weights *msg); 381 382 #ifdef WLAN_POLICY_MGR_ENABLE 383 /** 384 * wmi_unified_pdev_set_dual_mac_config_cmd() - Set dual mac config to FW 385 * @wmi_handle: wmi handle 386 * @msg: Dual MAC config parameters 387 * 388 * Configures WLAN firmware with the dual MAC features 389 * 390 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures. 391 */ 392 QDF_STATUS wmi_unified_pdev_set_dual_mac_config_cmd( 393 wmi_unified_t wmi_handle, 394 struct policy_mgr_dual_mac_config *msg); 395 #endif /* WLAN_POLICY_MGR_ENABLE */ 396 397 /** 398 * wmi_unified_send_adapt_dwelltime_params_cmd() - send wmi cmd of 399 * adaptive dwelltime configuration params 400 * @wma_handle: wma handler 401 * @wmi_param: pointer to dwelltime_params 402 * 403 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure 404 */ 405 QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd( 406 wmi_unified_t wmi_handle, 407 struct wmi_adaptive_dwelltime_params *wmi_param); 408 409 /** 410 * wmi_unified_send_dbs_scan_sel_params_cmd() - send wmi cmd of 411 * DBS scan selection configuration params 412 * @wma_handle: wma handler 413 * @wmi_param: pointer to wmi_dbs_scan_sel_params 414 * 415 * Return: QDF_STATUS_SUCCESS on success and QDF failure reason code for failure 416 */ 417 QDF_STATUS wmi_unified_send_dbs_scan_sel_params_cmd( 418 wmi_unified_t wmi_handle, 419 struct wmi_dbs_scan_sel_params *wmi_param); 420 421 /** 422 * wmi_unified_set_arp_stats_req() - set arp stats request 423 * @wmi_handle: wmi handle 424 * @req_buf: pointer to set_arp_stats 425 * 426 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 427 */ 428 QDF_STATUS wmi_unified_set_arp_stats_req(wmi_unified_t wmi_handle, 429 struct set_arp_stats *req_buf); 430 431 /** 432 * wmi_unified_get_arp_stats_req() - get arp stats request 433 * @wmi_handle: wmi handle 434 * @req_buf: pointer to get_arp_stats 435 * 436 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 437 */ 438 QDF_STATUS wmi_unified_get_arp_stats_req(wmi_unified_t wmi_handle, 439 struct get_arp_stats *req_buf); 440 441 /** 442 * wmi_unified_peer_unmap_conf_send() - send PEER unmap conf command to fw 443 * @wmi_handle: wmi handle 444 * @vdev_id: vdev id 445 * @peer_id_cnt: number of peer id 446 * @peer_id_list: list of peer ids 447 * 448 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 449 */ 450 QDF_STATUS wmi_unified_peer_unmap_conf_send(wmi_unified_t wmi_handle, 451 uint8_t vdev_id, 452 uint32_t peer_id_cnt, 453 uint16_t *peer_id_list); 454 455 /** 456 * wmi_unified_send_ocl_cmd() - send OCL command 457 * @wmi_handle: wmi handle 458 * @param: OCL commang parameters 459 * 460 * Send WMI_SET_OCL_CMDID parameters to fw. 461 * 462 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 463 */ 464 QDF_STATUS 465 wmi_unified_send_ocl_cmd(wmi_unified_t wmi_handle, 466 struct ocl_cmd_params *param); 467 468 #endif /* _WMI_UNIFIED_STA_API_H_ */ 469