1 /* 2 * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 /* 19 * DOC: wlan_cm_roam_api.h 20 * 21 * Implementation for the Common Roaming interfaces. 22 */ 23 24 #ifndef WLAN_CM_ROAM_API_H__ 25 #define WLAN_CM_ROAM_API_H__ 26 27 #include "wlan_mlme_dbg.h" 28 #include "../../core/src/wlan_cm_roam_offload.h" 29 #include "wlan_mlme_main.h" 30 #include "wlan_mlme_api.h" 31 #include "wlan_reg_ucfg_api.h" 32 #include "wlan_cm_tgt_if_tx_api.h" 33 #include "wlan_connectivity_logging.h" 34 35 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) 36 /** 37 * wlan_cm_enable_roaming_on_connected_sta() - Enable roaming on other connected 38 * sta vdev 39 * @pdev: pointer to pdev object 40 * @vdev_id: vdev id on which roaming should not be enabled 41 * 42 * Return: QDF_STATUS 43 */ 44 QDF_STATUS 45 wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev, 46 uint8_t vdev_id); 47 48 /** 49 * wlan_cm_roam_send_rso_cmd() - send rso command 50 * @psoc: psoc pointer 51 * @vdev_id: vdev id 52 * @rso_command: roam command to send 53 * @reason: reason for changing roam state for the requested vdev id 54 * 55 * similar to csr_roam_offload_scan, will be used from many legacy 56 * process directly, generate a new function wlan_cm_roam_send_rso_cmd 57 * for external usage. 58 * 59 * Return: QDF_STATUS 60 */ 61 QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc, 62 uint8_t vdev_id, uint8_t rso_command, 63 uint8_t reason); 64 65 /** 66 * wlan_cm_handle_sta_sta_roaming_enablement() - Handle roaming in case 67 * of STA + STA 68 * @psoc: psoc common object 69 * @vdev_id: Vdev id 70 * 71 * Wrapper function to cm_handle_sta_sta_roaming_enablement 72 * 73 * Return: none 74 */ 75 void wlan_cm_handle_sta_sta_roaming_enablement(struct wlan_objmgr_psoc *psoc, 76 uint8_t vdev_id); 77 78 /** 79 * wlan_cm_roam_state_change() - Post roam state change to roam state machine 80 * @pdev: pdev pointer 81 * @vdev_id: vdev id 82 * @requested_state: roam state to be set 83 * @reason: reason for changing roam state for the requested vdev id 84 * 85 * This function posts roam state change to roam state machine handling 86 * 87 * Return: QDF_STATUS 88 */ 89 QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev, 90 uint8_t vdev_id, 91 enum roam_offload_state requested_state, 92 uint8_t reason); 93 94 /** 95 * wlan_roam_update_cfg() - Process RSO update cfg request 96 * @psoc: psoc context 97 * @vdev_id: vdev id 98 * @reason: reason for requesting RSO update cfg 99 * 100 * Return: QDF_STATUS 101 */ 102 QDF_STATUS 103 wlan_roam_update_cfg(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 104 uint8_t reason); 105 106 /** 107 * wlan_cm_send_beacon_miss() - initiate beacon miss 108 * @vdev_id: vdev id 109 * @rssi: AP rssi 110 * 111 * Return: void 112 */ 113 void wlan_cm_send_beacon_miss(uint8_t vdev_id, int32_t rssi); 114 115 #else 116 static inline 117 QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc, 118 uint8_t vdev_id, uint8_t rso_command, 119 uint8_t reason) 120 { 121 return QDF_STATUS_E_NOSUPPORT; 122 } 123 124 static inline void 125 wlan_cm_handle_sta_sta_roaming_enablement(struct wlan_objmgr_psoc *psoc, 126 uint8_t vdev_id) 127 { 128 } 129 130 static inline QDF_STATUS 131 wlan_roam_update_cfg(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 132 uint8_t reason) 133 { 134 return QDF_STATUS_E_NOSUPPORT; 135 } 136 137 static inline 138 QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev, 139 uint8_t vdev_id, 140 enum roam_offload_state requested_state, 141 uint8_t reason) 142 { 143 return QDF_STATUS_E_NOSUPPORT; 144 } 145 146 static inline QDF_STATUS 147 wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev, 148 uint8_t vdev_id) 149 { 150 return QDF_STATUS_E_NOSUPPORT; 151 } 152 #endif 153 154 /** 155 * cm_update_associated_ch_info() - to save channel info in mlme priv obj at 156 * the time of initial connection 157 * @vdev: Pointer to vdev 158 * @is_update: to distinguish whether update is during connection or 159 * disconnection 160 * 161 * Return: none 162 */ 163 void 164 cm_update_associated_ch_info(struct wlan_objmgr_vdev *vdev, bool is_update); 165 166 #ifdef WLAN_FEATURE_ROAM_OFFLOAD 167 #define wlan_is_roam_offload_enabled(lfr) \ 168 (lfr.lfr3_roaming_offload) 169 #else 170 #define wlan_is_roam_offload_enabled(lfr) false 171 #endif 172 173 /** 174 * wlan_cm_host_roam_in_progress() -Check if STA is in the middle of 175 * roaming states 176 * @psoc: psoc 177 * @vdev_id: vdev id 178 * 179 * Return: True or False 180 */ 181 bool wlan_cm_host_roam_in_progress(struct wlan_objmgr_psoc *psoc, 182 uint8_t vdev_id); 183 184 /** 185 * cm_roam_acquire_lock() - Wrapper for rso lock. 186 * @vdev: Pointer to vdev 187 * 188 * Return: QDF_STATUS 189 */ 190 QDF_STATUS cm_roam_acquire_lock(struct wlan_objmgr_vdev *vdev); 191 192 /** 193 * cm_roam_release_lock() - Wrapper for rso lock 194 * @vdev: Pointer to vdev 195 * 196 * Return: QDF_STATUS 197 */ 198 QDF_STATUS cm_roam_release_lock(struct wlan_objmgr_vdev *vdev); 199 200 /** 201 * cm_roam_get_requestor_string() - RSO control requestor to string api 202 * @requestor: Requestor of type enum wlan_cm_rso_control_requestor 203 * 204 * Return: Pointer to converted string 205 */ 206 char 207 *cm_roam_get_requestor_string(enum wlan_cm_rso_control_requestor requestor); 208 209 /** 210 * wlan_cm_rso_set_roam_trigger() - Send roam trigger bitmap firmware 211 * @pdev: Pointer to pdev 212 * @vdev_id: vdev id 213 * @trigger_data: Carries pointer of the object containing vdev id and 214 * roam_trigger_bitmap. 215 * 216 * Return: QDF_STATUS 217 */ 218 QDF_STATUS 219 wlan_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id, 220 struct wlan_roam_triggers *trigger_data); 221 222 /** 223 * wlan_cm_disable_rso() - Disable roam scan offload to firmware 224 * @pdev: Pointer to pdev 225 * @vdev_id: vdev id 226 * @requestor: RSO disable requestor 227 * @reason: Reason for RSO disable 228 * 229 * Return: QDF_STATUS 230 */ 231 QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id, 232 enum wlan_cm_rso_control_requestor requestor, 233 uint8_t reason); 234 235 /** 236 * wlan_cm_enable_rso() - Enable roam scan offload to firmware 237 * @pdev: Pointer to pdev 238 * @vdev_id: vdev id 239 * @requestor: RSO disable requestor 240 * @reason: Reason for RSO disable 241 * 242 * Return: QDF_STATUS 243 */ 244 QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id, 245 enum wlan_cm_rso_control_requestor requestor, 246 uint8_t reason); 247 248 /** 249 * wlan_cm_roaming_in_progress() - check if roaming is in progress 250 * @pdev: Pointer to pdev 251 * @vdev_id: vdev id 252 * 253 * Return: true or false 254 */ 255 bool 256 wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id); 257 258 /** 259 * wlan_cm_roam_stop_req() - roam stop request handling 260 * @psoc: psoc pointer 261 * @vdev_id: vdev id 262 * @reason: reason for changing roam state for the requested vdev id 263 * 264 * Return: QDF_STATUS 265 */ 266 QDF_STATUS wlan_cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 267 uint8_t reason); 268 269 /** 270 * wlan_cm_roam_cfg_get_value - Get RSO config value from mlme vdev private 271 * object 272 * @psoc: psoc pointer 273 * @vdev_id: vdev id 274 * @roam_cfg_type: Value needed 275 * @dst_config: Destination config 276 * 277 * Return: QDF_STATUS 278 */ 279 QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc, 280 uint8_t vdev_id, 281 enum roam_cfg_param roam_cfg_type, 282 struct cm_roam_values_copy *dst_config); 283 284 static inline void 285 wlan_cm_flush_roam_channel_list(struct rso_chan_info *channel_info) 286 { 287 cm_flush_roam_channel_list(channel_info); 288 } 289 290 /** 291 * wlan_cm_roam_cfg_set_value - Set RSO config value 292 * @psoc: psoc pointer 293 * @vdev_id: vdev id 294 * @roam_cfg_type: Roam configuration type to set 295 * @src_config: Source config 296 * 297 * Return: QDF_STATUS 298 */ 299 QDF_STATUS 300 wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 301 enum roam_cfg_param roam_cfg_type, 302 struct cm_roam_values_copy *src_config); 303 304 305 struct rso_config *wlan_cm_get_rso_config_fl(struct wlan_objmgr_vdev *vdev, 306 const char *func, uint32_t line); 307 308 struct rso_user_config * 309 wlan_cm_get_rso_user_config_fl(struct wlan_objmgr_vdev *vdev, 310 const char *func, uint32_t line); 311 /** 312 * wlan_cm_get_rso_config - get per vdev RSO config 313 * @vdev: vdev pointer 314 * 315 * Return: rso config pointer 316 */ 317 #define wlan_cm_get_rso_config(vdev) \ 318 wlan_cm_get_rso_config_fl(vdev, __func__, __LINE__) 319 320 /** 321 * wlan_cm_get_rso_user_config - get per vdev RSO userspace config 322 * @vdev: vdev pointer 323 * 324 * Return: rso user space config pointer 325 */ 326 #define wlan_cm_get_rso_user_config(vdev) \ 327 wlan_cm_get_rso_user_config_fl(vdev, __func__, __LINE__) 328 /** 329 * wlan_cm_set_disable_hi_rssi - set disable hi rssi config 330 * @pdev: pdev pointer 331 * @vdev_id: vdev id 332 * @value: value to set 333 * 334 * Return: void 335 */ 336 void wlan_cm_set_disable_hi_rssi(struct wlan_objmgr_pdev *pdev, 337 uint8_t vdev_id, bool value); 338 339 /** 340 * wlan_cm_set_country_code - set country code to vdev rso config 341 * @pdev: pdev pointer 342 * @vdev_id: vdev id 343 * @cc: country code 344 * 345 * Return: void 346 */ 347 void wlan_cm_set_country_code(struct wlan_objmgr_pdev *pdev, 348 uint8_t vdev_id, uint8_t *cc); 349 350 /** 351 * wlan_cm_get_country_code - get country code from vdev rso config 352 * @pdev: pdev pointer 353 * @vdev_id: vdev id 354 * @cc: country code 355 * 356 * Return: qdf status 357 */ 358 QDF_STATUS wlan_cm_get_country_code(struct wlan_objmgr_pdev *pdev, 359 uint8_t vdev_id, uint8_t *cc); 360 361 #ifdef FEATURE_WLAN_ESE 362 /** 363 * wlan_cm_set_ese_assoc - set ese assoc 364 * @pdev: pdev pointer 365 * @vdev_id: vdev 366 * @value: value to set 367 * 368 * Return: void 369 */ 370 void wlan_cm_set_ese_assoc(struct wlan_objmgr_pdev *pdev, 371 uint8_t vdev_id, bool value); 372 373 /** 374 * wlan_cm_get_ese_assoc - get ese assoc 375 * @pdev: pdev pointer 376 * @vdev_id: vdev 377 * 378 * Return: value 379 */ 380 bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev, 381 uint8_t vdev_id); 382 void wlan_cm_ese_populate_additional_ies(struct wlan_objmgr_pdev *pdev, 383 struct wlan_mlme_psoc_ext_obj *mlme_obj, 384 uint8_t vdev_id, 385 struct wlan_roam_scan_offload_params *rso_mode_cfg); 386 #else 387 static inline void wlan_cm_set_ese_assoc(struct wlan_objmgr_pdev *pdev, 388 uint8_t vdev_id, bool value) {} 389 static inline 390 bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev, 391 uint8_t vdev_id) 392 { 393 return false; 394 } 395 static inline void wlan_cm_ese_populate_additional_ies( 396 struct wlan_objmgr_pdev *pdev, 397 struct wlan_mlme_psoc_ext_obj *mlme_obj, 398 uint8_t vdev_id, 399 struct wlan_roam_scan_offload_params *rso_mode_cfg) 400 {} 401 #endif 402 403 /** 404 * wlan_roam_reset_roam_params - reset_roam params 405 * @vdev: vdev pointer 406 * 407 * Return: void 408 */ 409 void wlan_roam_reset_roam_params(struct wlan_objmgr_vdev *vdev); 410 411 /** 412 * wlan_cm_rso_config_init - initialize RSO config 413 * @vdev: vdev pointer 414 * @rso_cfg: rso config to init 415 * 416 * Return: QDF_STATUS 417 */ 418 QDF_STATUS wlan_cm_rso_config_init(struct wlan_objmgr_vdev *vdev, 419 struct rso_config *rso_cfg); 420 421 /** 422 * wlan_cm_rso_config_deinit - deinit RSO config 423 * @vdev: vdev pointer 424 * @rso_cfg: rso config to deinit 425 * 426 * Return: void 427 */ 428 void wlan_cm_rso_config_deinit(struct wlan_objmgr_vdev *vdev, 429 struct rso_config *rso_cfg); 430 431 /** 432 * wlan_cm_fill_crypto_filter_from_vdev() - fill scan filter crypto from vdev 433 * given vdev id 434 * @vdev: vdev 435 * @filter: filetr to fill 436 * 437 * Return: void 438 */ 439 void wlan_cm_fill_crypto_filter_from_vdev(struct wlan_objmgr_vdev *vdev, 440 struct scan_filter *filter); 441 442 /** 443 * wlan_cm_init_occupied_ch_freq_list - init occupied chan freq list 444 * @pdev: pdev pointer 445 * @psoc: psoc 446 * @vdev_id: vdev_id of vdev for which init is required 447 * 448 * Return: void 449 */ 450 void wlan_cm_init_occupied_ch_freq_list(struct wlan_objmgr_pdev *pdev, 451 struct wlan_objmgr_psoc *psoc, 452 uint8_t vdev_id); 453 454 uint32_t cm_crypto_authmode_to_wmi_authmode(int32_t authmodeset, 455 int32_t akm, 456 int32_t ucastcipherset); 457 uint8_t *wlan_cm_get_rrm_cap_ie_data(void); 458 459 /** 460 * wlan_cm_append_assoc_ies() - Append specific IE to assoc IE's buffer 461 * @rso_mode_cfg: Pointer to Roam offload scan request 462 * @ie_id: IE ID to be appended 463 * @ie_len: IE length to be appended 464 * @ie_data: IE data to be appended 465 * 466 * Return: None 467 */ 468 void wlan_cm_append_assoc_ies(struct wlan_roam_scan_offload_params *rso_mode_cfg, 469 uint8_t ie_id, uint8_t ie_len, 470 const uint8_t *ie_data); 471 /** 472 * wlan_add_supported_5Ghz_channels()- Add valid 5Ghz channels 473 * in Join req. 474 * @psoc: psoc ptr 475 * @pdev: pdev 476 * @chan_list: Pointer to channel list buffer to populate 477 * @num_chnl: Pointer to number of channels value to update 478 * @supp_chan_ie: Boolean to check if we need to populate as IE 479 * 480 * This function is called to update valid 5Ghz channels 481 * in Join req. If @supp_chan_ie is true, supported channels IE 482 * format[chan num 1, num of channels 1, chan num 2, num of 483 * channels 2, ..] is populated. Else, @chan_list would be a list 484 * of supported channels[chan num 1, chan num 2..] 485 * 486 * Return: void 487 */ 488 void wlan_add_supported_5Ghz_channels(struct wlan_objmgr_psoc *psoc, 489 struct wlan_objmgr_pdev *pdev, 490 uint8_t *chan_list, 491 uint8_t *num_chnl, 492 bool supp_chan_ie); 493 #ifdef WLAN_ADAPTIVE_11R 494 /** 495 * wlan_get_adaptive_11r_enabled() - Function to check if adaptive 11r 496 * ini is enabled or disabled 497 * @lfr_cfg: LFR configuration 498 * 499 * Return: true if adaptive 11r is enabled 500 */ 501 static inline bool 502 wlan_get_adaptive_11r_enabled(struct wlan_mlme_lfr_cfg *lfr_cfg) 503 { 504 return lfr_cfg->enable_adaptive_11r; 505 } 506 #else 507 static inline bool 508 wlan_get_adaptive_11r_enabled(struct wlan_mlme_lfr_cfg *lfr_cfg) 509 { 510 return false; 511 } 512 #endif 513 514 #ifdef WLAN_FEATURE_FILS_SK 515 /** 516 * wlan_cm_get_fils_connection_info - Copy fils connection information from 517 * mlme vdev private object 518 * @psoc: Pointer to psoc object 519 * @vdev_id: vdev id 520 * 521 * Return: QDF_STATUS 522 */ 523 struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info( 524 struct wlan_objmgr_psoc *psoc, 525 uint8_t vdev_id); 526 527 /** 528 * wlan_cm_update_mlme_fils_info - Update FILS connection info 529 * to mlme vdev private object 530 * @vdev: Pointer to pdev object 531 * @src_fils_info: Current profile FILS connection information 532 * 533 * Return: QDF_STATUS 534 */ 535 QDF_STATUS 536 wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev, 537 struct wlan_fils_con_info *src_fils_info); 538 539 /** 540 * wlan_cm_update_fils_ft - Update the FILS FT derived to mlme 541 * @psoc: Psoc pointer 542 * @vdev_id: vdev id 543 * @fils_ft: Pointer to FILS FT 544 * @fils_ft_len: FILS FT length 545 * 546 * Return: QDF_STATUS 547 */ 548 QDF_STATUS wlan_cm_update_fils_ft(struct wlan_objmgr_psoc *psoc, 549 uint8_t vdev_id, uint8_t *fils_ft, 550 uint8_t fils_ft_len); 551 552 /** 553 * wlan_cm_update_hlp_info - API to save HLP IE 554 * @psoc: Pointer to psoc 555 * @gen_ie: IE buffer to store 556 * @len: length of the IE buffer @gen_ie 557 * @vdev_id: vdev id 558 * @flush: Flush the older saved HLP if any 559 * 560 * Return: None 561 */ 562 void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc, 563 const uint8_t *gen_ie, uint16_t len, 564 uint8_t vdev_id, bool flush); 565 #else 566 static inline 567 struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info( 568 struct wlan_objmgr_psoc *psoc, 569 uint8_t vdev_id) 570 { 571 return NULL; 572 } 573 574 static inline void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc, 575 const uint8_t *gen_ie, uint16_t len, 576 uint8_t vdev_id, bool flush) 577 {} 578 #endif 579 580 static inline 581 bool wlan_cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj, 582 struct wlan_objmgr_vdev *vdev, 583 bool mdie_present) 584 { 585 return cm_is_auth_type_11r(mlme_obj, vdev, mdie_present); 586 } 587 588 static inline bool cm_is_open_mode(struct wlan_objmgr_vdev *vdev) 589 { 590 return wlan_vdev_is_open_mode(vdev); 591 } 592 593 #ifdef WLAN_FEATURE_SAE 594 /** 595 * cm_is_auth_type_sae() - is vdev SAE auth type 596 * @vdev: pointer to vdev 597 * 598 * Return: true if vdev is SAE auth type 599 */ 600 static inline bool cm_is_auth_type_sae(struct wlan_objmgr_vdev *vdev) 601 { 602 return wlan_vdev_is_sae_auth_type(vdev); 603 } 604 #else 605 static inline bool cm_is_auth_type_sae(struct wlan_objmgr_vdev *vdev) 606 { 607 return false; 608 } 609 #endif 610 611 #ifdef FEATURE_WLAN_ESE 612 bool 613 cm_ese_open_present(struct wlan_objmgr_vdev *vdev, 614 struct wlan_mlme_psoc_ext_obj *mlme_obj, 615 bool ese_version_present); 616 bool 617 cm_is_ese_connection(struct wlan_objmgr_vdev *vdev, bool ese_version_present); 618 #else 619 static inline bool 620 cm_ese_open_present(struct wlan_objmgr_vdev *vdev, 621 struct wlan_mlme_psoc_ext_obj *mlme_obj, 622 bool ese_version_present) 623 { 624 return false; 625 } 626 static inline bool 627 cm_is_ese_connection(struct wlan_objmgr_vdev *vdev, bool ese_version_present) 628 { 629 return false; 630 } 631 #endif 632 633 /** 634 * cm_roam_start_init_on_connect() - init roaming 635 * @pdev: pdev pointer 636 * @vdev_id: vdev_id 637 * 638 * Return: void 639 */ 640 void cm_roam_start_init_on_connect(struct wlan_objmgr_pdev *pdev, 641 uint8_t vdev_id); 642 643 void cm_update_session_assoc_ie(struct wlan_objmgr_psoc *psoc, 644 uint8_t vdev_id, 645 struct element_info *assoc_ie); 646 647 /** 648 * wlan_cm_roam_invoke() - Validate and send Roam invoke req to CM 649 * @pdev: Pdev pointer 650 * @vdev_id: vdev_id 651 * @bssid: Target bssid 652 * @chan_freq: channel frequency on which reassoc should be send 653 * @source: source of roam 654 * 655 * Return: QDF_STATUS 656 */ 657 QDF_STATUS 658 wlan_cm_roam_invoke(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id, 659 struct qdf_mac_addr *bssid, qdf_freq_t chan_freq, 660 enum wlan_cm_source source); 661 662 /** 663 * cm_is_fast_roam_enabled() - check fast roam enabled or not 664 * @psoc: psoc pointer 665 * 666 * Return: true or false 667 */ 668 bool cm_is_fast_roam_enabled(struct wlan_objmgr_psoc *psoc); 669 670 /** 671 * cm_is_rsn_or_8021x_sha256_auth_type() - check whether auth type is rsn 672 * or 8021x_sha256 or not 673 * @vdev: vdev object pointer 674 * 675 * Return: true, if auth type is rsn/8021x_sha256, false otherwise 676 */ 677 bool cm_is_rsn_or_8021x_sha256_auth_type(struct wlan_objmgr_vdev *vdev); 678 679 #ifdef WLAN_FEATURE_HOST_ROAM 680 /** 681 * wlan_cm_host_roam_start() - fw host roam start handler 682 * @msg: msg pointer 683 * 684 * Return: QDF_STATUS 685 */ 686 QDF_STATUS wlan_cm_host_roam_start(struct scheduler_msg *msg); 687 688 /** 689 * cm_mlme_roam_preauth_fail() - roam preauth fail 690 * @vdev: VDEV object 691 * @req: Connection manager roam request 692 * @reason: connection manager connect fail reason 693 * 694 * Return: QDF_STATUS 695 */ 696 QDF_STATUS 697 cm_mlme_roam_preauth_fail(struct wlan_objmgr_vdev *vdev, 698 struct wlan_cm_roam_req *req, 699 enum wlan_cm_connect_fail_reason reason); 700 701 /** 702 * cm_free_preauth_req() - free preauth request related memory 703 * @preauth_req: preauth request 704 * 705 * Return: void 706 */ 707 void cm_free_preauth_req(struct wlan_preauth_req *preauth_req); 708 709 /** 710 * cm_handle_preauth_rsp() - Process vdev preauth rsp and send to CM 711 * @msg: scheduler message 712 * 713 * Process preauth rsp and send it to CM SM. 714 * 715 * Return: QDF_STATUS 716 */ 717 QDF_STATUS cm_handle_preauth_rsp(struct scheduler_msg *msg); 718 719 /** 720 * cm_reassoc_timer_callback() - reassoc timer callback, gets called at time out 721 * @context: context 722 * 723 * Timer callback for the timer that is started between the preauth completion 724 * and reassoc request. In this interval, it is expected that the 725 * pre-auth response and RIC IEs are passed up to the WPA supplicant and 726 * received back the necessary FTIEs required to be sent in the reassoc request 727 * 728 * Return: None 729 */ 730 void cm_reassoc_timer_callback(void *context); 731 #else 732 static inline QDF_STATUS wlan_cm_host_roam_start(struct scheduler_msg *msg) 733 { 734 if (msg && msg->bodyptr) 735 qdf_mem_free(msg->bodyptr); 736 737 return QDF_STATUS_SUCCESS; 738 } 739 #endif 740 741 /** 742 * wlan_cm_get_associated_ch_info() - get associated channel info 743 * @psoc: psoc pointer 744 * @vdev_id: vdev id 745 * @scanned_ch_width: channel width as per scan response 746 * @assoc_chan_info: channel info to get 747 * 748 * Return: none 749 */ 750 void wlan_cm_get_associated_ch_info(struct wlan_objmgr_psoc *psoc, 751 uint8_t vdev_id, 752 enum phy_ch_width scanned_ch_width, 753 struct assoc_channel_info *assoc_chan_info); 754 755 #ifdef WLAN_FEATURE_ROAM_OFFLOAD 756 /** 757 * wlan_cm_fw_roam_abort_req() - roam abort request handling 758 * @psoc: psoc pointer 759 * @vdev_id: vdev id 760 * 761 * Return: QDF_STATUS 762 */ 763 QDF_STATUS 764 wlan_cm_fw_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id); 765 766 /** 767 * wlan_cm_get_roam_band_value - Get roam band value from RSO config 768 * @psoc: psoc pointer 769 * @vdev: Pointer to vdev 770 * 771 * Return: Roam Band 772 */ 773 uint32_t wlan_cm_get_roam_band_value(struct wlan_objmgr_psoc *psoc, 774 struct wlan_objmgr_vdev *vdev); 775 776 /** 777 * wlan_cm_roam_activate_pcl_per_vdev() - Set the PCL command to be sent per 778 * vdev instead of pdev. 779 * @psoc: PSOC pointer 780 * @vdev_id: VDEV id 781 * @pcl_per_vdev: Activate vdev PCL type. 1- VDEV PCL, 0- PDEV PCL 782 * 783 * pcl_per_vdev will be set when: 784 * STA + STA is connected in DBS mode and roaming init is done on 785 * the 2nd STA. 786 * 787 * pcl_per_vdev will be false when only 1 sta connection exists or 788 * when 2nd sta gets disconnected 789 * 790 * Return: None 791 */ 792 void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc, 793 uint8_t vdev_id, 794 bool pcl_per_vdev); 795 796 /** 797 * wlan_cm_roam_is_pcl_per_vdev_active() - API to know if the pcl command needs 798 * to be sent per vdev or not 799 * @psoc: PSOC pointer 800 * @vdev_id: VDEV id 801 * 802 * Return: PCL level 803 */ 804 bool wlan_cm_roam_is_pcl_per_vdev_active(struct wlan_objmgr_psoc *psoc, 805 uint8_t vdev_id); 806 807 /** 808 * wlan_cm_dual_sta_roam_update_connect_channels() - Fill the allowed channels 809 * for connection of the 2nd STA based on the 1st STA connected band if dual 810 * sta roaming is enabled. 811 * @psoc: Pointer to PSOC object 812 * @filter: Pointer to scan filter 813 * 814 * Return: None 815 */ 816 void 817 wlan_cm_dual_sta_roam_update_connect_channels(struct wlan_objmgr_psoc *psoc, 818 struct scan_filter *filter); 819 /** 820 * wlan_cm_roam_set_vendor_btm_params() - API to set vendor btm params 821 * @psoc: PSOC pointer 822 * @param: vendor configured roam trigger param 823 * 824 * Return: none 825 */ 826 void 827 wlan_cm_roam_set_vendor_btm_params(struct wlan_objmgr_psoc *psoc, 828 struct wlan_cm_roam_vendor_btm_params 829 *param); 830 /** 831 * wlan_cm_roam_get_vendor_btm_params() - API to get vendor btm param 832 * @psoc: PSOC pointer 833 * @param: vendor configured roam trigger param 834 * 835 * Return: none 836 */ 837 void wlan_cm_roam_get_vendor_btm_params( 838 struct wlan_objmgr_psoc *psoc, 839 struct wlan_cm_roam_vendor_btm_params *param); 840 841 /** 842 * wlan_cm_roam_get_score_delta_params() - API to get roam score delta param 843 * @psoc: PSOC pointer 844 * @params: roam trigger param 845 * 846 * Return: none 847 */ 848 void 849 wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc, 850 struct wlan_roam_triggers *params); 851 852 /** 853 * wlan_cm_roam_get_min_rssi_params() - API to get roam trigger min rssi param 854 * @psoc: PSOC pointer 855 * @params: roam trigger param 856 * 857 * Return: none 858 */ 859 void 860 wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc, 861 struct wlan_roam_triggers *params); 862 863 /** 864 * wlan_cm_update_roam_scan_scheme_bitmap() - Set roam scan scheme bitmap for 865 * each vdev 866 * @psoc: PSOC pointer 867 * @vdev_id: VDEV id 868 * @roam_scan_scheme_bitmap: bitmap of roam triggers for which partial roam 869 * scan needs to be enabled 870 * 871 * Return: QDF_STATUS 872 */ 873 QDF_STATUS 874 wlan_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc, 875 uint8_t vdev_id, 876 uint32_t roam_scan_scheme_bitmap); 877 878 /** 879 * wlan_cm_set_roam_band_bitmask() - Set roam band bitmask for vdev 880 * @psoc: psoc pointer 881 * @vdev_id: vdev id 882 * @roam_band_bitmask: bitmask of roam band for which roam scan needs to be 883 * enabled in fw 884 * 885 * Return: QDF_STATUS 886 */ 887 QDF_STATUS wlan_cm_set_roam_band_bitmask(struct wlan_objmgr_psoc *psoc, 888 uint8_t vdev_id, 889 uint32_t roam_band_bitmask); 890 891 #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER 892 /** 893 * struct roam_link_speed_cfg - link speed state config 894 * @psoc: pointer to psoc 895 * @vdev_id: vdev id 896 * @is_link_speed_good: true means link speed good, false means bad 897 */ 898 struct roam_link_speed_cfg { 899 struct wlan_objmgr_psoc *psoc; 900 uint8_t vdev_id; 901 uint8_t is_link_speed_good; 902 }; 903 904 /** 905 * wlan_cm_send_roam_linkspeed_state() - Send link speed state to target 906 * @msg: Pointer to schedule message 907 * 908 * Return: QDF_STATUS 909 */ 910 QDF_STATUS wlan_cm_send_roam_linkspeed_state(struct scheduler_msg *msg); 911 912 /** 913 * wlan_cm_roam_link_speed_update() - Update link speed state for roaming 914 * @psoc: psoc pointer 915 * @vdev_id: vdev id 916 * @is_link_speed_good: true means link speed good, false means bad 917 * 918 * Return: None 919 */ 920 void wlan_cm_roam_link_speed_update(struct wlan_objmgr_psoc *psoc, 921 uint8_t vdev_id, 922 bool is_link_speed_good); 923 924 /** 925 * wlan_cm_is_linkspeed_roam_trigger_supported() - Get roam linkspeed check 926 * @psoc: pointer to psoc object 927 * 928 * Return: bool, true: Linkspeed check for low rssi roaming supported 929 */ 930 bool wlan_cm_is_linkspeed_roam_trigger_supported(struct wlan_objmgr_psoc *psoc); 931 #endif 932 933 /** 934 * wlan_cm_set_roam_band_update() - send rso update on set band 935 * @psoc: psoc pointer 936 * @vdev_id: vdev id 937 * 938 * Return: QDF_STATUS 939 */ 940 QDF_STATUS wlan_cm_set_roam_band_update(struct wlan_objmgr_psoc *psoc, 941 uint8_t vdev_id); 942 943 /** 944 * wlan_cm_get_roam_scan_scheme_bitmap() - Get roam scan scheme bitmap value 945 * @psoc: PSOC pointer 946 * @vdev_id: VDEV id 947 * 948 * Return: Roam scan scheme bitmap value 949 */ 950 uint32_t wlan_cm_get_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc, 951 uint8_t vdev_id); 952 953 /** 954 * wlan_cm_update_roam_states() - Set roam states for the vdev 955 * @psoc: PSOC pointer 956 * @vdev_id: VDEV id 957 * @value: Value to update 958 * @states: type of value to update 959 * 960 * Return: QDF_STATUS 961 */ 962 QDF_STATUS 963 wlan_cm_update_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 964 uint32_t value, enum roam_fail_params states); 965 966 /** 967 * wlan_cm_get_roam_states() - Get roam states value 968 * @psoc: PSOC pointer 969 * @vdev_id: VDEV id 970 * @states: For which action get roam states 971 * 972 * Return: Roam fail reason value 973 */ 974 uint32_t 975 wlan_cm_get_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 976 enum roam_fail_params states); 977 978 void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev, 979 uint8_t vdev_id, uint8_t *psk_pmk, 980 uint8_t pmk_len); 981 982 void wlan_cm_get_psk_pmk(struct wlan_objmgr_pdev *pdev, 983 uint8_t vdev_id, uint8_t *psk_pmk, 984 uint8_t *pmk_len); 985 986 /** 987 * cm_akm_roam_allowed() - check if roam allowed for some akm type 988 * roaming using single pmk 989 * with same pmk or not 990 * @psoc: psoc 991 * @vdev: vdev pointer 992 * 993 * Return: QDF_STATUS: QDF_STATUS_SUCCESS is allowed 994 */ 995 QDF_STATUS 996 cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc, 997 struct wlan_objmgr_vdev *vdev); 998 999 /** 1000 * cm_invalid_roam_reason_handler() - Handler for invalid roam reason 1001 * @vdev_id: vdev id 1002 * @notif: roam notification of type enum cm_roam_notif 1003 * @reason: Notif param value from the roam event that carries trigger reason 1004 * 1005 * Return: QDF_STATUS 1006 */ 1007 void cm_invalid_roam_reason_handler(uint32_t vdev_id, enum cm_roam_notif notif, 1008 uint32_t reason); 1009 1010 /** 1011 * cm_handle_roam_reason_ho_failed() - Handler for roam due to ho failure 1012 * @vdev_id: vdev id 1013 * @bssid: carries the BSSID mac address 1014 * @hw_mode_trans_ind: hw_mode transition indication 1015 * 1016 * Return: None 1017 */ 1018 void 1019 cm_handle_roam_reason_ho_failed(uint8_t vdev_id, struct qdf_mac_addr bssid, 1020 struct cm_hw_mode_trans_ind *hw_mode_trans_ind); 1021 1022 /** 1023 * cm_handle_scan_ch_list_data() - Roam scan ch evt wrapper for wma 1024 * @data: roam scan channel event data 1025 * 1026 * Return: QDF_STATUS 1027 */ 1028 QDF_STATUS 1029 cm_handle_scan_ch_list_data(struct cm_roam_scan_ch_resp *data); 1030 1031 /** 1032 * wlan_cm_free_roam_synch_frame_ind() - Free the bcn_probe_rsp, reassoc_req, 1033 * reassoc_rsp received as part of the ROAM_SYNC_FRAME event 1034 * 1035 * @rso_cfg: RSO configuration to be freed 1036 * 1037 * This API is used to free the buffer allocated during the ROAM_SYNC_FRAME 1038 * event 1039 * 1040 * Return: QDF_STATUS 1041 */ 1042 QDF_STATUS wlan_cm_free_roam_synch_frame_ind(struct rso_config *rso_cfg); 1043 1044 /** 1045 * cm_roam_sync_event_handler() - CM handler for roam sync event 1046 * 1047 * @psoc: psoc objmgr ptr 1048 * @event: event ptr 1049 * @len: event buff length 1050 * @sync_ind: sync indication data 1051 * 1052 * This API is used to handle the buffer allocated during the ROAM_SYNC_EVENT 1053 * event 1054 * 1055 * Return: QDF_STATUS 1056 */ 1057 QDF_STATUS cm_roam_sync_event_handler(struct wlan_objmgr_psoc *psoc, 1058 uint8_t *event, 1059 uint32_t len, 1060 struct roam_offload_synch_ind *sync_ind); 1061 1062 /** 1063 * cm_roam_sync_frame_event_handler() - CM handler for roam sync frame event 1064 * 1065 * @psoc: psoc objmgr ptr 1066 * @frame_ind: ptr to roam sync frame struct 1067 * 1068 * This API is used to handle the buffer allocated during the ROAM_SYNC_FRAME 1069 * event 1070 * 1071 * Return: QDF_STATUS 1072 */ 1073 QDF_STATUS 1074 cm_roam_sync_frame_event_handler(struct wlan_objmgr_psoc *psoc, 1075 struct roam_synch_frame_ind *frame_ind); 1076 1077 /** 1078 * cm_roam_sync_event_handler_cb() - CM callback handler for roam 1079 * sync event 1080 * 1081 * @vdev: vdev objmgr ptr 1082 * @event: event ptr 1083 * @len: event data len 1084 * 1085 * This API is used to handle the buffer allocated during the ROAM_SYNC 1086 * event 1087 * 1088 * Return: QDF_STATUS 1089 */ 1090 QDF_STATUS cm_roam_sync_event_handler_cb(struct wlan_objmgr_vdev *vdev, 1091 uint8_t *event, 1092 uint32_t len); 1093 1094 /** 1095 * wlan_cm_update_roam_rt_stats() - Store roam event stats command params 1096 * @psoc: PSOC pointer 1097 * @value: Value to update 1098 * @stats: type of value to update 1099 * 1100 * Return: QDF_STATUS 1101 */ 1102 QDF_STATUS 1103 wlan_cm_update_roam_rt_stats(struct wlan_objmgr_psoc *psoc, 1104 uint8_t value, enum roam_rt_stats_params stats); 1105 1106 /** 1107 * wlan_cm_get_roam_rt_stats() - Get roam event stats value 1108 * @psoc: PSOC pointer 1109 * @stats: Get roam event command param for specific attribute 1110 * 1111 * Return: Roam events stats param value 1112 */ 1113 uint8_t 1114 wlan_cm_get_roam_rt_stats(struct wlan_objmgr_psoc *psoc, 1115 enum roam_rt_stats_params stats); 1116 1117 /** 1118 * cm_report_roam_rt_stats - Gathers/Sends the roam events stats 1119 * @psoc: Pointer to psoc structure 1120 * @vdev_id: Vdev ID 1121 * @events: Event/Notif type from roam event/roam stats event 1122 * @roam_info: Roam stats from the roam stats event 1123 * @value: Notif param value from the roam event 1124 * @idx: TLV index in roam stats event 1125 * @reason: Notif param value from the roam event that carries trigger reason 1126 * 1127 * Gathers the roam stats from the roam event and the roam stats event and 1128 * sends them to hdd for filling the vendor attributes. 1129 * 1130 * Return: none 1131 */ 1132 void cm_report_roam_rt_stats(struct wlan_objmgr_psoc *psoc, 1133 uint8_t vdev_id, 1134 enum roam_rt_stats_type events, 1135 struct roam_stats_event *roam_info, 1136 uint32_t value, uint8_t idx, uint32_t reason); 1137 /** 1138 * cm_roam_candidate_event_handler() - CM callback to save roam 1139 * candidate entry in scan db 1140 * 1141 * @psoc: psoc objmgr ptr 1142 * @candidate: roam scan candidate info 1143 */ 1144 QDF_STATUS 1145 cm_roam_candidate_event_handler(struct wlan_objmgr_psoc *psoc, 1146 struct roam_scan_candidate_frame *candidate); 1147 1148 /** 1149 * wlan_cm_is_roam_sync_in_progress() - Check if the vdev is in roam sync 1150 * substate 1151 * @psoc: psoc pointer 1152 * @vdev_id: vdev_id 1153 * 1154 * Return: bool 1155 */ 1156 bool wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc, 1157 uint8_t vdev_id); 1158 1159 /** 1160 * wlan_cm_set_roam_offload_bssid() - Set the roam offload bssid of the sae 1161 * roam candidate 1162 * @vdev: pointer to vdev 1163 * @bssid: bssid 1164 * 1165 * Return: None 1166 */ 1167 void 1168 wlan_cm_set_roam_offload_bssid(struct wlan_objmgr_vdev *vdev, 1169 struct qdf_mac_addr *bssid); 1170 1171 /** 1172 * wlan_cm_get_roam_offload_bssid() - Get the roam offload bssid of the sae 1173 * roam candidate 1174 * @vdev: pointer to vdev 1175 * @bssid: bssid 1176 * 1177 * Return: None 1178 */ 1179 void 1180 wlan_cm_get_roam_offload_bssid(struct wlan_objmgr_vdev *vdev, 1181 struct qdf_mac_addr *bssid); 1182 1183 /** 1184 * wlan_cm_set_roam_offload_ssid() - Set the roam offload candidate ssid 1185 * 1186 * @vdev: pointer to vdev 1187 * @ssid: ssid of candidate 1188 * @len: length of ssid 1189 * 1190 * Return: None 1191 */ 1192 void 1193 wlan_cm_set_roam_offload_ssid(struct wlan_objmgr_vdev *vdev, 1194 uint8_t *ssid, uint8_t len); 1195 1196 /** 1197 * wlan_cm_get_roam_offload_ssid() - Get the roam offload candidate ssid 1198 * 1199 * @psoc: pointer to psoc 1200 * @vdev_id: vdev id 1201 * @ssid: ssid of the candidate 1202 * @len: length of the ssid 1203 * 1204 * Return: None 1205 */ 1206 void 1207 wlan_cm_get_roam_offload_ssid(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1208 uint8_t *ssid, uint8_t *len); 1209 1210 /** 1211 * wlan_cm_roam_set_ho_delay_config() - Set roam hand-off delay 1212 * @psoc: PSOC pointer 1213 * @roam_ho_delay: vendor configured roam HO delay value 1214 * 1215 * Return: none 1216 */ 1217 void 1218 wlan_cm_roam_set_ho_delay_config(struct wlan_objmgr_psoc *psoc, 1219 uint16_t roam_ho_delay); 1220 1221 /** 1222 * wlan_cm_roam_get_ho_delay_config() - Get roam hand-off delay 1223 * @psoc: PSOC pointer 1224 * 1225 * Return: Roam HO delay value 1226 */ 1227 uint16_t 1228 wlan_cm_roam_get_ho_delay_config(struct wlan_objmgr_psoc *psoc); 1229 1230 /** 1231 * wlan_cm_set_exclude_rm_partial_scan_freq() - set value to include/exclude 1232 * the partial scan channels in roam full scan. 1233 * @psoc: PSOC pointer 1234 * @exclude_rm_partial_scan_freq: Include/exclude the channels in roam full scan 1235 * that are already scanned as part of partial scan. 1236 * 1237 * Return: none 1238 */ 1239 void 1240 wlan_cm_set_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc, 1241 uint8_t exclude_rm_partial_scan_freq); 1242 1243 /** 1244 * wlan_cm_get_exclude_rm_partial_scan_freq() - Get value to include/exclude 1245 * the partial scan channels in roam full scan. 1246 * @psoc: PSOC pointer 1247 * 1248 * Return: value to include/exclude the partial scan channels in roam full scan 1249 */ 1250 uint8_t 1251 wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc); 1252 1253 /** 1254 * wlan_cm_roam_set_full_scan_6ghz_on_disc() - set value to include the 6 GHz 1255 * channels in roam full scan only on prior discovery of any 6 GHz support in 1256 * the environment. 1257 * @psoc: PSOC pointer 1258 * @roam_full_scan_6ghz_on_disc: Include the 6 GHz channels in roam full scan: 1259 * 1 - Include only on prior discovery of any 6 GHz support in the environment 1260 * 0 - Include all the supported 6 GHz channels by default 1261 * 1262 * Return: none 1263 */ 1264 void 1265 wlan_cm_roam_set_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc, 1266 uint8_t roam_full_scan_6ghz_on_disc); 1267 1268 /** 1269 * wlan_cm_roam_get_full_scan_6ghz_on_disc() - Get value to include the 6 GHz 1270 * channels in roam full scan only on prior discovery of any 6 GHz support in 1271 * the environment. 1272 * @psoc: PSOC pointer 1273 * 1274 * Return: 1275 * 1 - Include only on prior discovery of any 6 GHz support in the environment 1276 * 0 - Include all the supported 6 GHz channels by default 1277 */ 1278 uint8_t wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc); 1279 1280 /** 1281 * wlan_cm_set_roam_scan_high_rssi_offset() - Set the delta change in high RSSI 1282 * at which roam scan is triggered in 2.4/5 GHz. 1283 * @psoc: PSOC pointer 1284 * @roam_high_rssi_delta: Set the High RSSI delta for roam scan trigger 1285 * * 1-16 - Set an offset value in this range 1286 * * 0 - Disable 1287 * 1288 * Return: none 1289 */ 1290 void 1291 wlan_cm_set_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc, 1292 uint8_t roam_high_rssi_delta); 1293 1294 /** 1295 * wlan_cm_get_roam_scan_high_rssi_offset() - Get the delta change in high RSSI 1296 * at which roam scan is triggered in 2.4/5 GHz. 1297 * @psoc: PSOC pointer 1298 * 1299 * Return: High RSSI delta for roam scan trigger 1300 */ 1301 uint8_t wlan_cm_get_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc); 1302 1303 #ifdef WLAN_FEATURE_ROAM_INFO_STATS 1304 /** 1305 * mlme_cm_alloc_roam_stats_info() - alloc roam stats info buffer 1306 * @vdev_mlme: MLME-private vdev context 1307 * 1308 * Return: None 1309 */ 1310 void mlme_cm_alloc_roam_stats_info(struct vdev_mlme_obj *vdev_mlme); 1311 1312 /** 1313 * mlme_cm_free_roam_stats_info() - free roam stats info buffer in 1314 * struct mlme_legacy_priv 1315 * @ext_hdl: mlme_legacy_priv pointer 1316 * 1317 * Return: None 1318 */ 1319 void mlme_cm_free_roam_stats_info(mlme_vdev_ext_t *ext_hdl); 1320 1321 /** 1322 * wlan_cm_roam_stats_info_get() - get vdev roam stats info 1323 * 1324 * @vdev: pointer to vdev 1325 * @roam_info: pointer to buffer to copy roam stats info 1326 * @roam_num: pointer to valid roam stats num 1327 * 1328 * Return: QDF_STATUS 1329 */ 1330 1331 QDF_STATUS 1332 wlan_cm_roam_stats_info_get(struct wlan_objmgr_vdev *vdev, 1333 struct enhance_roam_info **roam_info, 1334 uint32_t *roam_num); 1335 #else 1336 static inline 1337 void mlme_cm_alloc_roam_stats_info(struct vdev_mlme_obj *vdev_mlme) 1338 { 1339 } 1340 1341 static inline 1342 void mlme_cm_free_roam_stats_info(mlme_vdev_ext_t *ext_hdl) 1343 { 1344 } 1345 #endif 1346 1347 /** 1348 * wlan_cm_update_offload_ssid_from_candidate() - Set the roam offload ssid of 1349 * the roam candidate into the mlme priv 1350 * 1351 * @pdev: pointer to pdev 1352 * @vdev_id: vdev id 1353 * @ap_bssid: roam candidate bssid 1354 * 1355 * Get the scan entry corresponding to the bssid and save the ssid 1356 * in the mlme priv of the STA vdev 1357 * 1358 * Return: QDF_STATUS 1359 */ 1360 QDF_STATUS 1361 wlan_cm_update_offload_ssid_from_candidate(struct wlan_objmgr_pdev *pdev, 1362 uint8_t vdev_id, 1363 struct qdf_mac_addr *ap_bssid); 1364 1365 /** 1366 * wlan_cm_add_frame_to_scan_db() - Add the frame to scan db 1367 * 1368 * @psoc: PSOC pointer 1369 * @frame: frame to be added to scan db 1370 * 1371 * Fetch the channel from frame and add the frame to scan db 1372 * 1373 * Return: QDF_STATUS 1374 */ 1375 QDF_STATUS 1376 wlan_cm_add_frame_to_scan_db(struct wlan_objmgr_psoc *psoc, 1377 struct roam_scan_candidate_frame *frame); 1378 1379 /** 1380 * wlan_cm_add_all_link_probe_rsp_to_scan_db() - Parse and generate 1381 * probe responses for each of the per-sta profile 1382 * 1383 * @psoc: psoc objmgr ptr 1384 * @candidate: roam scan candidate info 1385 */ 1386 QDF_STATUS 1387 wlan_cm_add_all_link_probe_rsp_to_scan_db(struct wlan_objmgr_psoc *psoc, 1388 struct roam_scan_candidate_frame *candidate); 1389 1390 /** 1391 * wlan_cm_is_mbo_ap_without_pmf() - Check if the connected AP is MBO without 1392 * PMF 1393 * @psoc: PSOC pointer 1394 * @vdev_id: vdev id 1395 * 1396 * Return: True if connected AP is MBO capable without PMF 1397 */ 1398 bool wlan_cm_is_mbo_ap_without_pmf(struct wlan_objmgr_psoc *psoc, 1399 uint8_t vdev_id); 1400 1401 /** 1402 * wlan_cm_roam_btm_block_event() - Send BTM block/drop logging event 1403 * @vdev_id: vdev id 1404 * @token: BTM token 1405 * @reason: Reason for dropping the BTM frame 1406 * 1407 * This is wrapper for cm_roam_btm_block_event() 1408 * 1409 * Return: QDF_STATUS 1410 */ 1411 QDF_STATUS 1412 wlan_cm_roam_btm_block_event(uint8_t vdev_id, uint8_t token, 1413 enum wlan_diag_btm_block_reason reason); 1414 #else 1415 static inline 1416 void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc, 1417 uint8_t vdev_id, 1418 bool pcl_per_vdev) 1419 {} 1420 1421 static inline 1422 uint32_t wlan_cm_get_roam_band_value(struct wlan_objmgr_psoc *psoc, 1423 struct wlan_objmgr_vdev *vdev) 1424 { 1425 uint32_t current_band; 1426 1427 ucfg_reg_get_band(wlan_vdev_get_pdev(vdev), ¤t_band); 1428 1429 return current_band; 1430 } 1431 1432 static inline 1433 bool wlan_cm_roam_is_pcl_per_vdev_active(struct wlan_objmgr_psoc *psoc, 1434 uint8_t vdev_id) 1435 { 1436 return false; 1437 } 1438 1439 static inline void 1440 wlan_cm_dual_sta_roam_update_connect_channels(struct wlan_objmgr_psoc *psoc, 1441 struct scan_filter *filter) 1442 {} 1443 1444 static inline QDF_STATUS 1445 wlan_cm_roam_extract_btm_response(wmi_unified_t wmi, void *evt_buf, 1446 struct roam_btm_response_data *dst, 1447 uint8_t idx) 1448 { 1449 return QDF_STATUS_E_NOSUPPORT; 1450 } 1451 1452 static inline QDF_STATUS 1453 wlan_cm_roam_extract_frame_info(wmi_unified_t wmi, void *evt_buf, 1454 struct roam_frame_info *dst, uint8_t idx) 1455 { 1456 return QDF_STATUS_E_NOSUPPORT; 1457 } 1458 1459 static inline QDF_STATUS 1460 wlan_cm_roam_extract_roam_initial_info(wmi_unified_t wmi, void *evt_buf, 1461 struct roam_initial_data *dst, 1462 uint8_t idx) 1463 { 1464 return QDF_STATUS_E_NOSUPPORT; 1465 } 1466 1467 static inline QDF_STATUS 1468 wlan_cm_roam_extract_roam_msg_info(wmi_unified_t wmi, void *evt_buf, 1469 struct roam_msg_info *dst, uint8_t idx) 1470 { 1471 return QDF_STATUS_E_NOSUPPORT; 1472 } 1473 1474 static inline void 1475 wlan_cm_roam_disable_vendor_btm(struct wlan_objmgr_psoc *psoc) 1476 {} 1477 1478 static inline void 1479 wlan_cm_roam_set_vendor_btm_params(struct wlan_objmgr_psoc *psoc, 1480 struct wlan_cm_roam_vendor_btm_params *param) 1481 {} 1482 1483 static inline void 1484 wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc, 1485 uint8_t vdev_id, 1486 struct roam_trigger_score_delta *param) 1487 {} 1488 1489 static inline void 1490 wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc, 1491 struct wlan_roam_triggers *params) 1492 {} 1493 1494 static inline QDF_STATUS 1495 wlan_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc, 1496 uint8_t vdev_id, 1497 uint32_t roam_scan_scheme_bitmap) 1498 { 1499 return QDF_STATUS_E_NOSUPPORT; 1500 } 1501 1502 static inline QDF_STATUS 1503 wlan_cm_set_roam_band_bitmask(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1504 uint32_t roam_band_bitmask) 1505 { 1506 return QDF_STATUS_E_NOSUPPORT; 1507 } 1508 1509 static inline 1510 uint32_t wlan_cm_get_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc, 1511 uint8_t vdev_id) 1512 { 1513 return 0; 1514 } 1515 1516 static inline QDF_STATUS 1517 wlan_cm_update_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1518 uint32_t value, enum roam_fail_params states) 1519 { 1520 return QDF_STATUS_SUCCESS; 1521 } 1522 1523 static inline uint32_t 1524 wlan_cm_get_roam_states(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1525 enum roam_fail_params states) 1526 { 1527 return 0; 1528 } 1529 1530 static inline void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev, 1531 uint8_t vdev_id, uint8_t *psk_pmk, 1532 uint8_t pmk_len) 1533 {} 1534 1535 static inline QDF_STATUS 1536 cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc, 1537 struct wlan_objmgr_vdev *vdev) 1538 { 1539 return false; 1540 } 1541 1542 static inline void 1543 cm_handle_roam_reason_ho_failed(uint8_t vdev_id, struct qdf_mac_addr bssid, 1544 struct cm_hw_mode_trans_ind *hw_mode_trans_ind) 1545 {} 1546 1547 static inline QDF_STATUS 1548 cm_handle_scan_ch_list_data(struct cm_roam_scan_ch_resp *data) 1549 { 1550 return QDF_STATUS_E_NOSUPPORT; 1551 } 1552 1553 static inline QDF_STATUS 1554 wlan_cm_update_roam_rt_stats(struct wlan_objmgr_psoc *psoc, 1555 uint8_t value, enum roam_rt_stats_params stats) 1556 { 1557 return QDF_STATUS_SUCCESS; 1558 } 1559 1560 static inline uint8_t 1561 wlan_cm_get_roam_rt_stats(struct wlan_objmgr_psoc *psoc, 1562 enum roam_rt_stats_params stats) 1563 { 1564 return 0; 1565 } 1566 1567 static inline void 1568 cm_report_roam_rt_stats(struct wlan_objmgr_psoc *psoc, 1569 uint8_t vdev_id, enum roam_rt_stats_type events, 1570 struct roam_stats_event *roam_info, 1571 uint32_t value, uint8_t idx, uint32_t reason) 1572 {} 1573 1574 static inline QDF_STATUS 1575 cm_roam_candidate_event_handler(struct wlan_objmgr_psoc *psoc, 1576 struct roam_scan_candidate_frame *candidate) 1577 { 1578 return QDF_STATUS_SUCCESS; 1579 } 1580 1581 static inline QDF_STATUS 1582 cm_roam_sync_event_handler(struct wlan_objmgr_psoc *psoc, 1583 uint8_t *event, uint32_t len, 1584 struct roam_offload_synch_ind *sync_ind) 1585 { 1586 return QDF_STATUS_SUCCESS; 1587 } 1588 1589 static inline QDF_STATUS 1590 cm_roam_sync_frame_event_handler(struct wlan_objmgr_psoc *psoc, 1591 struct roam_synch_frame_ind *frame_ind) 1592 { 1593 return QDF_STATUS_SUCCESS; 1594 } 1595 1596 static inline bool 1597 wlan_cm_is_roam_sync_in_progress(struct wlan_objmgr_psoc *psoc, 1598 uint8_t vdev_id) 1599 { 1600 return false; 1601 } 1602 1603 static inline void 1604 wlan_cm_set_roam_offload_bssid(struct wlan_objmgr_vdev *vdev, 1605 struct qdf_mac_addr *bssid) 1606 { 1607 } 1608 1609 static inline void 1610 wlan_cm_get_roam_offload_bssid(struct wlan_objmgr_vdev *vdev, 1611 struct qdf_mac_addr *bssid) 1612 { 1613 } 1614 1615 static inline void 1616 wlan_cm_set_roam_offload_ssid(struct wlan_objmgr_vdev *vdev, 1617 uint8_t *ssid, uint8_t len) 1618 { 1619 } 1620 1621 static inline void 1622 wlan_cm_get_roam_offload_ssid(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1623 uint8_t *ssid, uint8_t *len) 1624 { 1625 } 1626 1627 static inline uint16_t 1628 wlan_cm_roam_get_ho_delay_config(struct wlan_objmgr_psoc *psoc) 1629 { 1630 return 0; 1631 } 1632 1633 static inline uint8_t 1634 wlan_cm_get_exclude_rm_partial_scan_freq(struct wlan_objmgr_psoc *psoc) 1635 { 1636 return 0; 1637 } 1638 1639 static inline uint8_t 1640 wlan_cm_roam_get_full_scan_6ghz_on_disc(struct wlan_objmgr_psoc *psoc) 1641 { 1642 return 0; 1643 } 1644 1645 static inline 1646 void mlme_cm_alloc_roam_stats_info(struct vdev_mlme_obj *vdev_mlme) 1647 { 1648 } 1649 1650 static inline 1651 void mlme_cm_free_roam_stats_info(mlme_vdev_ext_t *ext_hdl) 1652 { 1653 } 1654 1655 static inline QDF_STATUS 1656 wlan_cm_update_offload_ssid_from_candidate(struct wlan_objmgr_pdev *pdev, 1657 uint8_t vdev_id, 1658 struct qdf_mac_addr *ap_bssid) 1659 { 1660 return QDF_STATUS_SUCCESS; 1661 } 1662 1663 static inline QDF_STATUS 1664 wlan_cm_add_frame_to_scan_db(struct wlan_objmgr_psoc *psoc, 1665 struct roam_scan_candidate_frame *frame) 1666 { 1667 return QDF_STATUS_SUCCESS; 1668 } 1669 1670 static inline QDF_STATUS 1671 wlan_cm_add_all_link_probe_rsp_to_scan_db(struct wlan_objmgr_psoc *psoc, 1672 struct roam_scan_candidate_frame *candidate) 1673 { 1674 return QDF_STATUS_SUCCESS; 1675 } 1676 1677 static inline uint8_t 1678 wlan_cm_get_roam_scan_high_rssi_offset(struct wlan_objmgr_psoc *psoc) 1679 { 1680 return 0; 1681 } 1682 1683 static inline 1684 bool wlan_cm_is_mbo_ap_without_pmf(struct wlan_objmgr_psoc *psoc, 1685 uint8_t vdev_id) 1686 { 1687 return false; 1688 } 1689 1690 static inline QDF_STATUS 1691 wlan_cm_roam_btm_block_event(uint8_t vdev_id, uint8_t token, 1692 enum wlan_diag_btm_block_reason reason) 1693 { 1694 return QDF_STATUS_E_NOSUPPORT; 1695 } 1696 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ 1697 1698 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD) 1699 /** 1700 * cm_roam_sync_key_event_handler() - Handle roam sync key event and 1701 * store the keys in crypto module 1702 * @psoc: Pointer to psoc object 1703 * @keys: Pointer to the keys 1704 * @num_keys: Number of links for which keys entries are available 1705 * 1706 * Return: QDF_STATUS 1707 */ 1708 QDF_STATUS cm_roam_sync_key_event_handler(struct wlan_objmgr_psoc *psoc, 1709 struct wlan_crypto_key_entry *keys, 1710 uint8_t num_keys); 1711 #else 1712 static inline 1713 QDF_STATUS cm_roam_sync_key_event_handler(struct wlan_objmgr_psoc *psoc, 1714 struct wlan_crypto_key_entry *keys, 1715 uint8_t num_keys) 1716 { 1717 return QDF_STATUS_E_NOSUPPORT; 1718 } 1719 #endif 1720 1721 #ifdef WLAN_FEATURE_FIPS 1722 /** 1723 * cm_roam_pmkid_req_ind() - Function to handle 1724 * roam event from firmware for pmkid generation. 1725 * @psoc: psoc pointer 1726 * @vdev_id: Vdev id 1727 * @bss_list: candidate AP bssid list 1728 */ 1729 QDF_STATUS 1730 cm_roam_pmkid_req_ind(struct wlan_objmgr_psoc *psoc, 1731 uint8_t vdev_id, struct roam_pmkid_req_event *bss_list); 1732 #else /* WLAN_FEATURE_FIPS */ 1733 static inline QDF_STATUS 1734 cm_roam_pmkid_req_ind(struct wlan_objmgr_psoc *psoc, 1735 uint8_t vdev_id, struct roam_pmkid_req_event *bss_list) 1736 { 1737 return QDF_STATUS_SUCCESS; 1738 } 1739 #endif /* WLAN_FEATURE_FIPS */ 1740 1741 /** 1742 * wlan_get_chan_by_bssid_from_rnr: get chan from rnr through bssid 1743 * @vdev: vdev 1744 * @cm_id: connect manager id 1745 * @link_addr: bssid of given link 1746 * @chan: chan to get 1747 * @op_class: operation class 1748 * 1749 * Return: QDF_STATUS 1750 */ 1751 QDF_STATUS wlan_get_chan_by_bssid_from_rnr(struct wlan_objmgr_vdev *vdev, 1752 wlan_cm_id cm_id, 1753 struct qdf_mac_addr *link_addr, 1754 uint8_t *chan, uint8_t *op_class); 1755 1756 /** 1757 * wlan_get_chan_by_link_id_from_rnr: get chan from rnr through link id 1758 * @vdev: vdev 1759 * @cm_id: connect manager id 1760 * @link_id: link id of given link 1761 * @chan: chan to get 1762 * @op_class: operation class 1763 * 1764 * Return: QDF_STATUS 1765 */ 1766 #ifdef WLAN_FEATURE_11BE_MLO 1767 QDF_STATUS wlan_get_chan_by_link_id_from_rnr(struct wlan_objmgr_vdev *vdev, 1768 wlan_cm_id cm_id, 1769 uint8_t link_id, 1770 uint8_t *chan, uint8_t *op_class); 1771 #endif 1772 1773 /** 1774 * cm_rso_cmd_status_event_handler() - Handler for rso cmd status 1775 * @vdev_id: vdev id 1776 * @notif: roam notification of type enum cm_roam_notif 1777 * 1778 * Return: QDF_STATUS 1779 */ 1780 int cm_rso_cmd_status_event_handler(uint8_t vdev_id, enum cm_roam_notif notif); 1781 1782 /** 1783 * cm_handle_roam_reason_invoke_roam_fail() - Handler for roam invoke fail event 1784 * @vdev_id: vdev id 1785 * @notif_params: contains roam invoke fail reason from wmi_roam_invoke_error_t 1786 * @trans_ind: hw_mode transition indication 1787 * 1788 * Return: None 1789 */ 1790 void 1791 cm_handle_roam_reason_invoke_roam_fail(uint8_t vdev_id, uint32_t notif_params, 1792 struct cm_hw_mode_trans_ind *trans_ind); 1793 1794 /** 1795 * cm_handle_roam_sync_update_hw_mode() - Handler for roam sync hw mode update 1796 * @trans_ind: hw_mode transition indication 1797 * 1798 * Return: None 1799 */ 1800 void 1801 cm_handle_roam_sync_update_hw_mode(struct cm_hw_mode_trans_ind *trans_ind); 1802 1803 /** 1804 * cm_handle_roam_reason_deauth() - Handler for roam due to deauth from AP 1805 * @vdev_id: vdev id 1806 * @notif_params: contains roam invoke fail reason from wmi_roam_invoke_error_t 1807 * @deauth_disassoc_frame: Disassoc or deauth frame 1808 * @frame_len: Contains the length of @deauth_disassoc_frame 1809 * 1810 * Return: None 1811 */ 1812 void cm_handle_roam_reason_deauth(uint8_t vdev_id, uint32_t notif_params, 1813 uint8_t *deauth_disassoc_frame, 1814 uint32_t frame_len); 1815 1816 /** 1817 * cm_handle_roam_reason_btm() - Handler for roam due to btm from AP 1818 * @vdev_id: vdev id 1819 * 1820 * Return: None 1821 */ 1822 void cm_handle_roam_reason_btm(uint8_t vdev_id); 1823 1824 /** 1825 * cm_handle_roam_reason_bmiss() - Handler for roam due to bmiss 1826 * @vdev_id: vdev id 1827 * @rssi: RSSI value 1828 * 1829 * Return: None 1830 */ 1831 void cm_handle_roam_reason_bmiss(uint8_t vdev_id, uint32_t rssi); 1832 1833 /** 1834 * cm_handle_roam_reason_better_ap() - Handler for roam due to better AP 1835 * @vdev_id: vdev id 1836 * @rssi: RSSI value 1837 * 1838 * Return: None 1839 */ 1840 void cm_handle_roam_reason_better_ap(uint8_t vdev_id, uint32_t rssi); 1841 1842 /** 1843 * cm_handle_roam_reason_suitable_ap() - Handler for roam due to suitable AP 1844 * @vdev_id: vdev id 1845 * @rssi: RSSI value 1846 * 1847 * Return: None 1848 */ 1849 void cm_handle_roam_reason_suitable_ap(uint8_t vdev_id, uint32_t rssi); 1850 1851 /** 1852 * cm_roam_event_handler() - Carries extracted roam info 1853 * @roam_event: data carried by roam event 1854 * 1855 * Return: QDF_STATUS 1856 */ 1857 QDF_STATUS 1858 cm_roam_event_handler(struct roam_offload_roam_event *roam_event); 1859 1860 /** 1861 * cm_btm_denylist_event_handler() - Deny list the given BSSID due to btm 1862 * @psoc: PSOC pointer 1863 * @list: Roam denylist info 1864 * 1865 * Return: QDF_STATUS 1866 */ 1867 QDF_STATUS 1868 cm_btm_denylist_event_handler(struct wlan_objmgr_psoc *psoc, 1869 struct roam_denylist_event *list); 1870 1871 /** 1872 * cm_vdev_disconnect_event_handler() - disconnect evt handler for target_if 1873 * @data: disconnect event data 1874 * 1875 * Return: QDF_STATUS 1876 */ 1877 QDF_STATUS 1878 cm_vdev_disconnect_event_handler(struct vdev_disconnect_event_data *data); 1879 1880 /** 1881 * cm_handle_disconnect_reason() - disconnect reason evt wrapper for wma 1882 * @data: disconnect event data 1883 * 1884 * Return: QDF_STATUS 1885 */ 1886 QDF_STATUS 1887 cm_handle_disconnect_reason(struct vdev_disconnect_event_data *data); 1888 1889 /** 1890 * cm_roam_scan_ch_list_event_handler() - Roam scan ch evt handler for target_if 1891 * @data: roam scan channel event data 1892 * 1893 * Return: QDF_STATUS 1894 */ 1895 QDF_STATUS 1896 cm_roam_scan_ch_list_event_handler(struct cm_roam_scan_ch_resp *data); 1897 1898 /** 1899 * cm_roam_stats_event_handler() - Carries extracted roam stats info 1900 * @psoc: PSOC pointer 1901 * @stats_info: stats data carried by roam_stats_event 1902 * 1903 * Return: QDF_STATUS 1904 */ 1905 QDF_STATUS 1906 cm_roam_stats_event_handler(struct wlan_objmgr_psoc *psoc, 1907 struct roam_stats_event *stats_info); 1908 1909 /** 1910 * cm_handle_auth_offload() - auth offload evt wrapper for wma 1911 * @auth_event: auth offload event data 1912 * 1913 * Return: QDF_STATUS 1914 */ 1915 QDF_STATUS 1916 cm_handle_auth_offload(struct auth_offload_event *auth_event); 1917 1918 /** 1919 * cm_roam_auth_offload_event_handler() - Handler for auth offload event 1920 * @auth_event: Authentication event 1921 * 1922 * Return: QDF_STATUS 1923 */ 1924 QDF_STATUS 1925 cm_roam_auth_offload_event_handler(struct auth_offload_event *auth_event); 1926 1927 /* 1928 * cm_roam_pmkid_request_handler() - Carries extracted pmkid list info 1929 * @data: Pmkid event with entries 1930 * 1931 * Return: QDF_STATUS 1932 */ 1933 QDF_STATUS 1934 cm_roam_pmkid_request_handler(struct roam_pmkid_req_event *data); 1935 1936 #ifdef WLAN_VENDOR_HANDOFF_CONTROL 1937 /** 1938 * cm_roam_vendor_handoff_event_handler() - vendor handoff event handler 1939 * @psoc: psoc object 1940 * @data: vendor handoff params 1941 * 1942 * Return: None 1943 */ 1944 void 1945 cm_roam_vendor_handoff_event_handler(struct wlan_objmgr_psoc *psoc, 1946 struct roam_vendor_handoff_params *data); 1947 #endif 1948 1949 /** 1950 * cm_roam_update_vdev() - Update the STA and BSS 1951 * @sync_ind: Information needed for roam sync propagation 1952 * @vdev_id: vdev id 1953 * 1954 * This function will perform all the vdev related operations with 1955 * respect to the self sta and the peer after roaming and completes 1956 * the roam synch propagation with respect to WMA layer. 1957 * 1958 * Return: None 1959 */ 1960 void cm_roam_update_vdev(struct roam_offload_synch_ind *sync_ind, 1961 uint8_t vdev_id); 1962 1963 /** 1964 * cm_roam_pe_sync_callback() - Callback registered at pe, gets invoked when 1965 * ROAM SYNCH event is received from firmware 1966 * @sync_ind: Structure with roam synch parameters 1967 * @vdev_id: vdev id 1968 * @len: length for bss_description 1969 * 1970 * This is a PE level callback called from CM to complete the roam synch 1971 * propagation at PE level and also fill the BSS descriptor which will be 1972 * helpful further to complete the roam synch propagation. 1973 * 1974 * Return: QDF_STATUS 1975 */ 1976 QDF_STATUS 1977 cm_roam_pe_sync_callback(struct roam_offload_synch_ind *sync_ind, 1978 uint8_t vdev_id, uint16_t len); 1979 1980 /** 1981 * cm_update_phymode_on_roam() - Update new phymode after 1982 * ROAM SYNCH event is received from firmware 1983 * @vdev_id: roamed vdev id 1984 * @sync_ind: Structure with roam synch parameters 1985 * 1986 * This api will update the phy mode after roam sync is received. 1987 * 1988 * Return: none 1989 */ 1990 void 1991 cm_update_phymode_on_roam(uint8_t vdev_id, 1992 struct roam_offload_synch_ind *sync_ind); 1993 1994 /** 1995 * wlan_cm_fw_to_host_phymode() - Convert fw phymode to host 1996 * @phymode: wmi phymode 1997 * 1998 * This api will convert the phy mode from fw to host type. 1999 * 2000 * Return: wlan phymode 2001 */ 2002 enum wlan_phymode 2003 wlan_cm_fw_to_host_phymode(WMI_HOST_WLAN_PHY_MODE phymode); 2004 2005 /** 2006 * wlan_cm_sta_mlme_vdev_roam_notify() - STA mlme vdev roam notify 2007 * @vdev_mlme: MLME-private vdev context 2008 * @data_len: Length of @data 2009 * @data: Roam data 2010 * 2011 * This function will handle the roam notify event 2012 * 2013 * Return: QDF_STATUS 2014 */ 2015 QDF_STATUS 2016 wlan_cm_sta_mlme_vdev_roam_notify(struct vdev_mlme_obj *vdev_mlme, 2017 uint16_t data_len, void *data); 2018 2019 /** 2020 * wlan_cm_same_band_sta_allowed() - check if same band STA +STA is allowed 2021 * 2022 * @psoc: psoc ptr 2023 * 2024 * Return: true if same band STA+STA is allowed 2025 */ 2026 bool wlan_cm_same_band_sta_allowed(struct wlan_objmgr_psoc *psoc); 2027 2028 /** 2029 * cm_cleanup_mlo_link() - Cleanup the MLO link 2030 * 2031 * @vdev: MLO link vdev 2032 * 2033 * This posts the event WLAN_CM_SM_EV_ROAM_LINK_DOWN to CM to cleanup the 2034 * resources allocated for MLO link e.g. vdev, pe_session, etc.. 2035 * This gets called when MLO to non-MLO roaming happens 2036 * 2037 * Return: qdf_status 2038 */ 2039 QDF_STATUS cm_cleanup_mlo_link(struct wlan_objmgr_vdev *vdev); 2040 2041 /** 2042 * wlan_is_roaming_enabled() - Check if Roaming is enabled 2043 * 2044 * @pdev: pointer to pdev object 2045 * @vdev_id : Vdev id 2046 * 2047 * Check if the ROAM enable vdev param (WMI_VDEV_PARAM_ROAM_FW_OFFLOAD) 2048 * is sent to firmware or not. 2049 * 2050 * Return: True if RSO state is not DEINIT, which indicates that vdev param 2051 * WMI_VDEV_PARAM_ROAM_FW_OFFLOAD is sent to firmware. 2052 */ 2053 bool wlan_is_roaming_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id); 2054 2055 /** 2056 * wlan_is_rso_enabled() - Check if RSO state is enabled 2057 * 2058 * @pdev: pointer to pdev object 2059 * @vdev_id : Vdev id 2060 * 2061 * Check if the ROAM SCAN OFFLOAD enable is sent to firmware. Host driver tracks 2062 * this through RSO state machine and the states can be WLAN_ROAM_RSO_ENABLED/ 2063 * WLAN_ROAMING_IN_PROG/WLAN_ROAM_SYNCH_IN_PROG/WLAN_MLO_ROAM_SYNCH_IN_PROG. 2064 * 2065 * Return: True if RSO state is any of the above mentioned states. 2066 */ 2067 bool wlan_is_rso_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id); 2068 2069 /** 2070 * wlan_cm_set_sae_auth_ta() - Set SAE auth tx address 2071 * @pdev: pdev object 2072 * @vdev_id : Vdev id 2073 * @sae_auth_ta: SAE auth tx address 2074 * 2075 * Return: QDF_STATUS 2076 */ 2077 QDF_STATUS 2078 wlan_cm_set_sae_auth_ta(struct wlan_objmgr_pdev *pdev, 2079 uint8_t vdev_id, 2080 struct qdf_mac_addr sae_auth_ta); 2081 2082 /** 2083 * wlan_cm_get_sae_auth_ta() - Get SAE auth tx address 2084 * @pdev: pdev object 2085 * @vdev_id: Vdev id 2086 * @sae_auth_ta: SAE auth tx address 2087 * 2088 * Return: QDF_STATUS 2089 */ 2090 QDF_STATUS 2091 wlan_cm_get_sae_auth_ta(struct wlan_objmgr_pdev *pdev, 2092 uint8_t vdev_id, 2093 struct qdf_mac_addr *sae_auth_ta); 2094 2095 /** 2096 * wlan_cm_set_assoc_btm_cap() - Set the assoc BTM capability 2097 * @vdev: pointer to vdev 2098 * @val: BTM cap 2099 * 2100 * Return: None 2101 */ 2102 void 2103 wlan_cm_set_assoc_btm_cap(struct wlan_objmgr_vdev *vdev, bool val); 2104 2105 /** 2106 * wlan_cm_get_assoc_btm_cap() - Get the assoc BTM capability 2107 * @vdev: pointer to vdev 2108 * 2109 * Return: BTM cap 2110 */ 2111 bool 2112 wlan_cm_get_assoc_btm_cap(struct wlan_objmgr_vdev *vdev); 2113 2114 /** 2115 * wlan_cm_is_self_mld_roam_supported() - Is self mld roam supported 2116 * @psoc: pointer to psoc object 2117 * 2118 * Return: bool, true: self mld roam supported 2119 */ 2120 bool wlan_cm_is_self_mld_roam_supported(struct wlan_objmgr_psoc *psoc); 2121 2122 /** 2123 * wlan_cm_set_force_20mhz_in_24ghz() - Sets the config to (dis)allow 2124 * the 40 MHz connection in 2.4 GHz 2125 * 2126 * @vdev: pointer to vdev 2127 * @is_40mhz_cap: is 40 MHz supported 2128 * 2129 * Return: None 2130 */ 2131 void 2132 wlan_cm_set_force_20mhz_in_24ghz(struct wlan_objmgr_vdev *vdev, 2133 bool is_40mhz_cap); 2134 2135 /** 2136 * wlan_cm_get_force_20mhz_in_24ghz - Gets the 40 MHz (dis)allowed on 2.4 GHz 2137 * config 2138 * @vdev: pointer to vdev 2139 * 2140 * Return: 40 MHz allowed on 2.4 GHz 2141 */ 2142 bool 2143 wlan_cm_get_force_20mhz_in_24ghz(struct wlan_objmgr_vdev *vdev); 2144 2145 /** 2146 * cm_send_ies_for_roam_invoke - Send IEs to firmware based on the reassoc 2147 * req received from the userspace 2148 * @vdev: vdev 2149 * @dot11_mode: dot11 mode 2150 * 2151 * Return: QDF_STATUS 2152 */ 2153 QDF_STATUS 2154 cm_send_ies_for_roam_invoke(struct wlan_objmgr_vdev *vdev, uint16_t dot11_mode); 2155 2156 #ifdef WLAN_FEATURE_11BE_MLO 2157 /** 2158 * wlan_cm_is_sae_auth_addr_conversion_required() - check whether address 2159 * conversion is required or not. 2160 * @vdev: pointer to vdev 2161 * 2162 * This API checks the address conversion (mld to link and vice-versa) for sae 2163 * auth frames for below listed scenarios when mlo sae auth external conversion 2164 * is true. 2165 * 2166 * Connected AP Roam AP Connection Conversion 2167 * (MLO vdev) 2168 * non-ML non-ML initial FALSE 2169 * non-ML ML initial FALSE 2170 * non-ML non-ML roam FALSE 2171 * non-ML ML roam TRUE 2172 * ML non-ML initial TRUE 2173 * ML ML initial TRUE 2174 * ML non-ML roam FALSE 2175 * ML ML roam TRUE 2176 * 2177 * Return: true if address conversion required, otherwise false. 2178 */ 2179 bool 2180 wlan_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev *vdev); 2181 #else 2182 static inline bool 2183 wlan_cm_is_sae_auth_addr_conversion_required(struct wlan_objmgr_vdev *vdev) 2184 { 2185 return false; 2186 } 2187 #endif /* WLAN_FEATURE_11BE_MLO */ 2188 2189 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD) 2190 /** 2191 * wlan_cm_store_mlo_roam_peer_address() - cache peer mld and link address 2192 * while roaming 2193 * @pdev: pdev object 2194 * @auth_event: auth offload event data 2195 * 2196 * Return: void 2197 */ 2198 void 2199 wlan_cm_store_mlo_roam_peer_address(struct wlan_objmgr_pdev *pdev, 2200 struct auth_offload_event *auth_event); 2201 2202 /** 2203 * wlan_cm_roaming_get_peer_mld_addr() - retrieve the peer mld address for 2204 * roaming. 2205 * @vdev: vdev pointer 2206 * 2207 * Return: pointer to struct qdf_mac_addr 2208 */ 2209 struct qdf_mac_addr * 2210 wlan_cm_roaming_get_peer_mld_addr(struct wlan_objmgr_vdev *vdev); 2211 2212 /** 2213 * wlan_cm_roaming_get_peer_link_addr() - get peer link address for roaming 2214 * @vdev: vdev pointer 2215 * 2216 * Return: pointer to struct qdf_mac_addr 2217 */ 2218 struct qdf_mac_addr * 2219 wlan_cm_roaming_get_peer_link_addr(struct wlan_objmgr_vdev *vdev); 2220 2221 /** 2222 * wlan_cm_roam_is_mlo_ap() - to check whether vdev will be roam to ml ap 2223 * @vdev: object manager vdev 2224 * 2225 * this function check whether roaming vdev will be connected to ml ap or not. 2226 * 2227 * Return: true if roam ap is ml capable otherwise false 2228 */ 2229 bool 2230 wlan_cm_roam_is_mlo_ap(struct wlan_objmgr_vdev *vdev); 2231 2232 /** 2233 * wlan_cm_link_switch_notif_cb() - MLME CM link switch notifier callback 2234 * @vdev: object manager vdev 2235 * @req: Link switch request 2236 * @notify_reason: Notify reason 2237 * 2238 * Return: QDF_STATUS 2239 */ 2240 QDF_STATUS wlan_cm_link_switch_notif_cb(struct wlan_objmgr_vdev *vdev, 2241 struct wlan_mlo_link_switch_req *req, 2242 enum wlan_mlo_link_switch_notify_reason notify_reason); 2243 #else 2244 static inline void 2245 wlan_cm_store_mlo_roam_peer_address(struct wlan_objmgr_pdev *pdev, 2246 struct auth_offload_event *auth_event) 2247 { 2248 } 2249 2250 static inline struct qdf_mac_addr * 2251 wlan_cm_roaming_get_mld_addr(struct wlan_objmgr_vdev *vdev) 2252 { 2253 return NULL; 2254 } 2255 2256 static inline struct qdf_mac_addr * 2257 wlan_cm_roaming_get_peer_link_addr(struct wlan_objmgr_vdev *vdev) 2258 { 2259 return NULL; 2260 } 2261 2262 static inline bool 2263 wlan_cm_roam_is_mlo_ap(struct wlan_objmgr_vdev *vdev) 2264 { 2265 return false; 2266 } 2267 2268 static inline 2269 QDF_STATUS wlan_cm_link_switch_notif_cb(struct wlan_objmgr_vdev *vdev, 2270 struct wlan_mlo_link_switch_req *req, 2271 enum wlan_mlo_link_switch_notify_reason notify_reason) 2272 { 2273 return QDF_STATUS_E_NOSUPPORT; 2274 } 2275 #endif /* WLAN_FEATURE_11BE_MLO && WLAN_FEATURE_ROAM_OFFLOAD */ 2276 2277 /** 2278 * wlan_update_peer_phy_mode() - update phymode in peer object 2279 * @des_chan: wlan_channel pointer contain new ch_freq 2280 * @vdev: vdev pointer 2281 * 2282 * Return: QDF_STATUS_SUCCESS if peer object phymode is set otherwise 2283 * QDF_STATUS_E_INVAL 2284 */ 2285 QDF_STATUS 2286 wlan_update_peer_phy_mode(struct wlan_channel *des_chan, 2287 struct wlan_objmgr_vdev *vdev); 2288 2289 #endif /* WLAN_CM_ROAM_API_H__ */ 2290