1 /* 2 * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /* 21 * 22 * This file lim_api.h contains the definitions exported by 23 * LIM module. 24 * Author: Chandra Modumudi 25 * Date: 02/11/02 26 * History:- 27 * Date Modified by Modification Information 28 * -------------------------------------------------------------------- 29 * 30 */ 31 #ifndef __LIM_API_H 32 #define __LIM_API_H 33 #include "wni_api.h" 34 #include "sir_api.h" 35 #include "ani_global.h" 36 #include "sir_mac_prot_def.h" 37 #include "sir_common.h" 38 #include "sir_debug.h" 39 #include "sch_global.h" 40 #include "utils_api.h" 41 #include "lim_global.h" 42 #include "wma_if.h" 43 #include "wma_types.h" 44 #include "scheduler_api.h" 45 #include "spatial_reuse_api.h" 46 47 /* Macro to count heartbeat */ 48 #define limResetHBPktCount(pe_session) (pe_session->LimRxedBeaconCntDuringHB = 0) 49 50 /* Useful macros for fetching various states in mac->lim */ 51 /* gLimSystemRole */ 52 #define GET_LIM_SYSTEM_ROLE(pe_session) (pe_session->limSystemRole) 53 #define LIM_IS_AP_ROLE(pe_session) (GET_LIM_SYSTEM_ROLE(pe_session) == eLIM_AP_ROLE) 54 #define LIM_IS_STA_ROLE(pe_session) (GET_LIM_SYSTEM_ROLE(pe_session) == eLIM_STA_ROLE) 55 #define LIM_IS_UNKNOWN_ROLE(pe_session) (GET_LIM_SYSTEM_ROLE(pe_session) == eLIM_UNKNOWN_ROLE) 56 #define LIM_IS_P2P_DEVICE_ROLE(pe_session) (GET_LIM_SYSTEM_ROLE(pe_session) == eLIM_P2P_DEVICE_ROLE) 57 #define LIM_IS_P2P_DEVICE_GO(pe_session) (GET_LIM_SYSTEM_ROLE(pe_session) == eLIM_P2P_DEVICE_GO) 58 #define LIM_IS_NDI_ROLE(pe_session) \ 59 (GET_LIM_SYSTEM_ROLE(pe_session) == eLIM_NDI_ROLE) 60 /* gLimSmeState */ 61 #define GET_LIM_SME_STATE(mac) (mac->lim.gLimSmeState) 62 #define SET_LIM_SME_STATE(mac, state) (mac->lim.gLimSmeState = state) 63 /* gLimMlmState */ 64 #define GET_LIM_MLM_STATE(mac) (mac->lim.gLimMlmState) 65 #define SET_LIM_MLM_STATE(mac, state) (mac->lim.gLimMlmState = state) 66 /*tpdphHashNode mlmStaContext*/ 67 #define GET_LIM_STA_CONTEXT_MLM_STATE(sta) (sta->mlmStaContext.mlmState) 68 #define SET_LIM_STA_CONTEXT_MLM_STATE(sta, state) (sta->mlmStaContext.mlmState = state) 69 #define LIM_IS_CONNECTION_ACTIVE(pe_session) (pe_session->LimRxedBeaconCntDuringHB) 70 /*mac->lim.gLimProcessDefdMsgs*/ 71 #define GET_LIM_PROCESS_DEFD_MESGS(mac) (mac->lim.gLimProcessDefdMsgs) 72 73 #ifdef WLAN_FEATURE_SR 74 /** 75 * enum sr_status_of_roamed_ap - SR(Spatial Reuse) status of roamed AP 76 * SR_DISALLOW: SR not supported by roamed AP 77 * SR_THRESHOLD_IN_RANGE: SR is supported by roamed AP/after param change 78 * in beacon/probe resp and the configured threshold is in range. 79 * SR_THRESHOLD_NOT_IN_RANGE: SR is supported by roamed AP/after param change 80 * in beacon/probe resp and configured threshold is not in range. 81 */ 82 enum sr_status_of_roamed_ap { 83 SR_DISALLOW, 84 SR_THRESHOLD_IN_RANGE, 85 SR_THRESHOLD_NOT_IN_RANGE, 86 }; 87 #endif 88 89 /** 90 * lim_post_msg_api() - post normal priority PE message 91 * @mac: mac context 92 * @msg: message to be posted 93 * 94 * This function is called to post a message to the tail of the PE 95 * message queue to be processed in the MC Thread with normal 96 * priority. 97 * 98 * Return: QDF_STATUS_SUCCESS on success, other QDF_STATUS on error 99 */ 100 QDF_STATUS lim_post_msg_api(struct mac_context *mac, struct scheduler_msg *msg); 101 102 static inline void 103 lim_post_msg_to_process_deferred_queue(struct mac_context *mac) 104 { 105 struct scheduler_msg msg = {0}; 106 QDF_STATUS status; 107 108 if (!mac->lim.gLimProcessDefdMsgs || !mac->lim.gLimDeferredMsgQ.size) 109 return; 110 111 msg.type = SIR_LIM_PROCESS_DEFERRED_QUEUE; 112 msg.bodyptr = NULL; 113 msg.bodyval = 0; 114 115 status = lim_post_msg_api(mac, &msg); 116 if (QDF_IS_STATUS_ERROR(status)) 117 pe_err("Failed to post lim msg:0x%x", msg.type); 118 } 119 120 #define SET_LIM_PROCESS_DEFD_MESGS(mac, val) \ 121 mac->lim.gLimProcessDefdMsgs = val; \ 122 pe_debug("Defer LIM msg %d", val); \ 123 lim_post_msg_to_process_deferred_queue(mac); 124 125 /* LIM exported function templates */ 126 #define LIM_MIN_BCN_PR_LENGTH 12 127 #define LIM_BCN_PR_CAPABILITY_OFFSET 10 128 #define LIM_ASSOC_REQ_IE_OFFSET 4 129 130 /** 131 * enum lim_vendor_ie_access_policy - vendor ie access policy 132 * @LIM_ACCESS_POLICY_NONE: access policy not valid 133 * @LIM_ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT: respond only if vendor ie 134 * is present in probe request and assoc request frames 135 * @LIM_ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT: do not respond if vendor 136 * ie is present in probe request or assoc request frames 137 */ 138 enum lim_vendor_ie_access_policy { 139 LIM_ACCESS_POLICY_NONE, 140 LIM_ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT, 141 LIM_ACCESS_POLICY_DONOT_RESPOND_IF_IE_IS_PRESENT, 142 }; 143 144 typedef enum eMgmtFrmDropReason { 145 eMGMT_DROP_NO_DROP, 146 eMGMT_DROP_NOT_LAST_IBSS_BCN, 147 eMGMT_DROP_INFRA_BCN_IN_IBSS, 148 eMGMT_DROP_SCAN_MODE_FRAME, 149 eMGMT_DROP_NON_SCAN_MODE_FRAME, 150 eMGMT_DROP_INVALID_SIZE, 151 eMGMT_DROP_SPURIOUS_FRAME, 152 eMGMT_DROP_DUPLICATE_AUTH_FRAME, 153 eMGMT_DROP_EXCESSIVE_MGMT_FRAME, 154 eMGMT_DROP_DEAUTH_DURING_ROAM_STARTED, 155 } tMgmtFrmDropReason; 156 157 /** 158 * Function to initialize LIM state machines. 159 * This called upon LIM thread creation. 160 */ 161 QDF_STATUS lim_initialize(struct mac_context *); 162 QDF_STATUS pe_open(struct mac_context *mac, struct cds_config_info *cds_cfg); 163 QDF_STATUS pe_close(struct mac_context *mac); 164 QDF_STATUS lim_start(struct mac_context *mac); 165 QDF_STATUS pe_start(struct mac_context *mac); 166 void pe_stop(struct mac_context *mac); 167 168 /** 169 * is_mgmt_protected - check RMF enabled for the peer 170 * @vdev_id: vdev id 171 * @peer_mac_addr: peer mac address 172 * 173 * Return: True if RMF enabled and key is installed 174 */ 175 bool is_mgmt_protected(uint32_t vdev_id, const uint8_t *peer_mac_addr); 176 177 /** 178 * lim_stop_pmfcomeback_timer() - stop pmf comeback timer 179 * @session: Pointer to PE session 180 * 181 * Return: None 182 */ 183 void lim_stop_pmfcomeback_timer(struct pe_session *session); 184 185 /** 186 * pe_register_mgmt_rx_frm_callback() - registers callback for receiving 187 * mgmt rx frames 188 * @mac_ctx: mac global ctx 189 * 190 * This function registers a PE function to mgmt txrx component and a WMA 191 * function to WMI layer as event handler for receiving mgmt frames. 192 * 193 * Return: None 194 */ 195 void pe_register_mgmt_rx_frm_callback(struct mac_context *mac_ctx); 196 197 /** 198 * pe_deregister_mgmt_rx_frm_callback() - degisters callback for receiving 199 * mgmt rx frames 200 * @mac_ctx: mac global ctx 201 * 202 * This function deregisters the PE function registered to mgmt txrx component 203 * and the WMA function registered to WMI layer as event handler for receiving 204 * mgmt frames. 205 * 206 * Return: None 207 */ 208 void pe_deregister_mgmt_rx_frm_callback(struct mac_context *mac_ctx); 209 210 /** 211 * pe_register_callbacks_with_wma() - register SME and PE callback functions to 212 * WMA. 213 * @mac: mac global ctx 214 * @ready_req: Ready request parameters, containing callback pointers 215 * 216 * Return: None 217 */ 218 void pe_register_callbacks_with_wma(struct mac_context *mac, 219 struct sme_ready_req *ready_req); 220 221 /** 222 * Function to cleanup LIM state. 223 * This called upon reset/persona change etc 224 */ 225 void lim_cleanup(struct mac_context *); 226 227 /** 228 * lim_post_msg_high_priority() - post high priority PE message 229 * @mac: mac context 230 * @msg: message to be posted 231 * 232 * This function is called to post a message to the head of the PE 233 * message queue to be processed in the MC Thread with expedited 234 * priority. 235 * 236 * Return: QDF_STATUS_SUCCESS on success, other QDF_STATUS on error 237 */ 238 QDF_STATUS lim_post_msg_high_priority(struct mac_context *mac, 239 struct scheduler_msg *msg); 240 241 /** 242 * Function to process messages posted to LIM thread 243 * and dispatch to various sub modules within LIM module. 244 */ 245 void lim_message_processor(struct mac_context *, struct scheduler_msg *); 246 247 /* / Function used by other Sirius modules to read global SME state */ 248 static inline tLimSmeStates lim_get_sme_state(struct mac_context *mac) 249 { 250 return mac->lim.gLimSmeState; 251 } 252 253 /** 254 * lim_received_hb_handler() - This function is called by 255 * sch_beacon_process() upon receiving a Beacon on STA. This 256 * also gets called upon receiving Probe Response after heat 257 * beat failure is detected. 258 * 259 * @mac - global mac structure 260 * @chan_freq - channel frequency indicated in Beacon, Probe 261 * 262 * Response return - none 263 */ 264 void lim_received_hb_handler(struct mac_context *, uint32_t, 265 struct pe_session *); 266 267 /* / Function that triggers STA context deletion */ 268 void lim_trigger_sta_deletion(struct mac_context *mac, tpDphHashNode sta, 269 struct pe_session *pe_session); 270 271 #ifdef FEATURE_WLAN_TDLS 272 /* Function that sends TDLS Del Sta indication to SME */ 273 void lim_send_sme_tdls_del_sta_ind(struct mac_context *mac, tpDphHashNode sta, 274 struct pe_session *pe_session, 275 uint16_t reasonCode); 276 #endif 277 278 /** 279 * lim_detect_change_in_ap_capabilities() - Detect any change in AP's 280 * capabilities. 281 * @mac: Pointer to Global MAC structure 282 * @pBeacon: Pointer to parsed Beacon/probe rsp structure 283 * @session: pe session 284 * @is_bcn: if passed pointer is beacon or probe 285 * 286 * Return: void 287 */ 288 void lim_detect_change_in_ap_capabilities(struct mac_context *mac, 289 tpSirProbeRespBeacon pBeacon, 290 struct pe_session *session, 291 bool is_bcn); 292 293 QDF_STATUS lim_update_short_slot(struct mac_context *mac, 294 tpSirProbeRespBeacon pBeacon, 295 tpUpdateBeaconParams pBeaconParams, 296 struct pe_session *); 297 298 /** 299 * lim_ps_offload_handle_missed_beacon_ind() - handle missed beacon indication 300 * @mac: global mac context 301 * @msg: message 302 * 303 * This function process the SIR_HAL_MISSED_BEACON_IND 304 * message from HAL, to do active AP probing. 305 * 306 * Return: void 307 */ 308 void lim_ps_offload_handle_missed_beacon_ind(struct mac_context *mac, 309 struct scheduler_msg *msg); 310 311 void lim_send_heart_beat_timeout_ind(struct mac_context *mac, struct pe_session *pe_session); 312 tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(struct mac_context *mac, 313 uint8_t *pRxPacketInfo, 314 uint32_t subType); 315 316 bool lim_is_sb_disconnect_allowed_fl(struct pe_session *session, 317 const char *func, uint32_t line); 318 319 /** 320 * lim_is_sb_disconnect_allowed() - check pe session state to see if disconnect 321 * is already in progress. 322 * @session: pe session 323 * 324 * Return: false if disconnect is already in progress 325 */ 326 #define lim_is_sb_disconnect_allowed(session) \ 327 lim_is_sb_disconnect_allowed_fl(session, __func__, __LINE__) 328 329 #ifdef WLAN_FEATURE_ROAM_OFFLOAD 330 /** 331 * pe_roam_synch_callback() - Callback registered at wma, gets invoked when 332 * ROAM SYNCH event is received from firmware 333 * @mac_ctx: global mac context 334 * @vdev_id: VDEV id 335 * @roam_sync_ind_ptr: Structure with roam synch parameters 336 * @ie_len: ie length 337 * @reason: Operation to be done by the callback 338 * 339 * This is a PE level callback called from WMA to complete the roam synch 340 * propagation at PE level and also fill the BSS descriptor which will be 341 * helpful further to complete the roam synch propagation. 342 * 343 * Return: QDF_STATUS 344 */ 345 QDF_STATUS 346 pe_roam_synch_callback(struct mac_context *mac_ctx, 347 uint8_t vdev_id, 348 struct roam_offload_synch_ind *roam_sync_ind_ptr, 349 uint16_t ie_len, 350 enum sir_roam_op_code reason); 351 352 void 353 lim_check_ft_initial_im_association(struct roam_offload_synch_ind *roam_synch, 354 struct pe_session *session_entry); 355 356 /** 357 * pe_disconnect_callback() - Callback to handle deauth event is received 358 * from firmware 359 * @mac: pointer to global mac context 360 * @vdev_id: VDEV in which the event was received 361 * @deauth_disassoc_frame: Deauth/disassoc frame received from firmware 362 * @deauth_disassoc_frame_len: Length of @deauth_disassoc_frame 363 * @reason_code: Fw sent reason code if disassoc/deauth frame is not 364 * available 365 * 366 * Return: QDF_STATUS 367 */ 368 QDF_STATUS 369 pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id, 370 uint8_t *deauth_disassoc_frame, 371 uint16_t deauth_disassoc_frame_len, 372 uint16_t reason_code); 373 374 QDF_STATUS 375 pe_set_ie_for_roam_invoke(struct mac_context *mac_ctx, uint8_t vdev_id, 376 uint16_t dot11_mode, enum QDF_OPMODE opmode); 377 378 #else 379 static inline QDF_STATUS 380 pe_roam_synch_callback(struct mac_context *mac_ctx, 381 uint8_t vdev_id, 382 struct roam_offload_synch_ind *roam_sync_ind_ptr, 383 uint16_t ie_len, 384 enum sir_roam_op_code reason) 385 { 386 return QDF_STATUS_E_NOSUPPORT; 387 } 388 389 static inline QDF_STATUS 390 pe_disconnect_callback(struct mac_context *mac, uint8_t vdev_id, 391 uint8_t *deauth_disassoc_frame, 392 uint16_t deauth_disassoc_frame_len, 393 uint16_t reason_code) 394 { 395 return QDF_STATUS_E_NOSUPPORT; 396 } 397 398 static inline QDF_STATUS 399 pe_set_ie_for_roam_invoke(struct mac_context *mac_ctx, uint8_t vdev_id, 400 uint16_t dot11_mode, enum QDF_OPMODE opmode) 401 { 402 return QDF_STATUS_E_NOSUPPORT; 403 } 404 #endif 405 406 /** 407 * lim_update_lost_link_info() - update lost link information to SME 408 * @mac: global MAC handle 409 * @session: PE session 410 * @rssi: rssi value from the received frame 411 * 412 * Return: None 413 */ 414 void lim_update_lost_link_info(struct mac_context *mac, struct pe_session *session, 415 int32_t rssi); 416 417 /** 418 * lim_mon_init_session() - create PE session for monitor mode operation 419 * @mac_ptr: mac pointer 420 * @msg: Pointer to struct sir_create_session type. 421 * 422 * Return: NONE 423 */ 424 void lim_mon_init_session(struct mac_context *mac_ptr, 425 struct sir_create_session *msg); 426 427 /** 428 * lim_mon_deinit_session() - delete PE session for monitor mode operation 429 * @mac_ptr: mac pointer 430 * @msg: Pointer to struct sir_delete_session type. 431 * 432 * Return: NONE 433 */ 434 void lim_mon_deinit_session(struct mac_context *mac_ptr, 435 struct sir_delete_session *msg); 436 437 #define limGetQosMode(pe_session, pVal) (*(pVal) = (pe_session)->limQosEnabled) 438 #define limGetWmeMode(pe_session, pVal) (*(pVal) = (pe_session)->limWmeEnabled) 439 #define limGetWsmMode(pe_session, pVal) (*(pVal) = (pe_session)->limWsmEnabled) 440 /* ----------------------------------------------------------------------- */ 441 static inline void lim_get_phy_mode(struct mac_context *mac, uint32_t *phyMode, 442 struct pe_session *pe_session) 443 { 444 *phyMode = 445 pe_session ? pe_session->gLimPhyMode : mac->lim.gLimPhyMode; 446 } 447 448 /* ----------------------------------------------------------------------- */ 449 static inline void lim_get_rf_band_new(struct mac_context *mac, 450 enum reg_wifi_band *band, 451 struct pe_session *pe_session) 452 { 453 *band = pe_session ? pe_session->limRFBand : REG_BAND_UNKNOWN; 454 } 455 456 /** 457 * pe_mc_process_handler() - Message Processor for PE 458 * @msg: Pointer to the message structure 459 * 460 * Verifies the system is in a mode where messages are expected to be 461 * processed, and if so, routes the message to the appropriate handler 462 * based upon message type. 463 * 464 * Return: QDF_STATUS_SUCCESS if the message was handled, otherwise an 465 * appropriate QDF_STATUS error code 466 */ 467 QDF_STATUS pe_mc_process_handler(struct scheduler_msg *msg); 468 469 /** ------------------------------------------------------------- 470 \fn pe_free_msg 471 \brief Called by CDS scheduler (function cds_sched_flush_mc_mqs) 472 \ to free a given PE message on the TX and MC thread. 473 \ This happens when there are messages pending in the PE 474 \ queue when system is being stopped and reset. 475 \param struct mac_context *mac 476 \param struct scheduler_msg pMsg 477 \return none 478 -----------------------------------------------------------------*/ 479 void pe_free_msg(struct mac_context *mac, struct scheduler_msg *pMsg); 480 481 /** 482 * lim_process_abort_scan_ind() - abort the scan which is presently being run 483 * 484 * @mac_ctx: Pointer to Global MAC structure 485 * @vdev_id: vdev_id 486 * @scan_id: Scan ID from the scan request 487 * @scan_requesor_id: Entity requesting the scan 488 * 489 * @return: None 490 */ 491 void lim_process_abort_scan_ind(struct mac_context *mac, uint8_t vdev_id, 492 uint32_t scan_id, uint32_t scan_requestor_id); 493 494 void __lim_process_sme_assoc_cnf_new(struct mac_context *, uint32_t, uint32_t *); 495 496 /** 497 * lim_handle_frame_genby_mbssid() - wrapper for beacon and probe response 498 * @frame: the pointer of frame data 499 * @frame_len: the length of frame data 500 * @frm_subtype: frame type 501 * @bssid: the pointer to bssid 502 * 503 * This function is used as wrapper to handle the beacon and probe response 504 * frames which is generated by MBSSID frame. 505 * 506 * Return: QDF_STATUS 507 */ 508 QDF_STATUS lim_handle_frame_genby_mbssid(uint8_t *frame, uint32_t frame_len, 509 uint8_t frm_subtype, char *bssid); 510 511 /** 512 * lim_process_sme_addts_rsp_timeout(): Send addts rsp timeout to SME 513 * @mac: Pointer to Global MAC structure 514 * @param: Addts rsp timer count 515 * 516 * This function is used to reset the addts sent flag and 517 * send addts rsp timeout to SME 518 * 519 * Return: None 520 */ 521 void lim_process_sme_addts_rsp_timeout(struct mac_context *mac, uint32_t param); 522 QDF_STATUS lim_update_ext_cap_ie(struct mac_context *mac_ctx, uint8_t *ie_data, 523 uint8_t *local_ie_buf, uint16_t *local_ie_len, 524 struct pe_session *session); 525 526 /** 527 * lim_handle_sap_beacon(): Handle the beacon received from scan module for SAP 528 * @pdev: pointer to the pdev object 529 * @scan_entry: pointer to the scan cache entry for the beacon 530 * 531 * Registered as callback to the scan module for handling beacon frames. 532 * This API filters the and allows beacons for SAP protection mechanisms 533 * if there are active SAP sessions and the received beacon's channel 534 * matches the SAP active channel 535 * 536 * Return: None 537 */ 538 void lim_handle_sap_beacon(struct wlan_objmgr_pdev *pdev, 539 struct scan_cache_entry *scan_entry); 540 541 /** 542 * lim_translate_rsn_oui_to_akm_type() - translate RSN OUI to AKM type 543 * @auth_suite: auth suite 544 * 545 * Return: AKM type 546 */ 547 enum ani_akm_type lim_translate_rsn_oui_to_akm_type(uint8_t auth_suite[4]); 548 549 #ifdef WLAN_SUPPORT_TWT 550 /** 551 * lim_fill_roamed_peer_twt_caps() - Update Peer TWT capabilities 552 * @mac_ctx: Pointer to mac context 553 * @vdev_id: vdev id 554 * @roam_synch: Pointer to roam synch indication 555 * 556 * Return: None 557 */ 558 void lim_fill_roamed_peer_twt_caps(struct mac_context *mac_ctx, uint8_t vdev_id, 559 struct roam_offload_synch_ind *roam_synch); 560 561 /** 562 * lim_set_twt_peer_capabilities() - Update Peer TWT capabilities 563 * @mac_ctx: Pointer to mac context 564 * @peer_mac: peer mac address 565 * @he_cap: pointer to HE capabilities IE 566 * @he_op: pointer to HE IE 567 * 568 * Based on the peer IE capabilities, update the TWT peer private object 569 * 570 * Return: None 571 */ 572 void lim_set_twt_peer_capabilities(struct mac_context *mac_ctx, 573 struct qdf_mac_addr *peer_mac, 574 tDot11fIEhe_cap *he_cap, 575 tDot11fIEhe_op *he_op); 576 577 /** 578 * lim_set_twt_ext_capabilities() - Update twt caps for 11n devices 579 * @mac_ctx: Pointer to mac context 580 * @peer_mac: peer mac address 581 * @ext_cap: pointer to Extended capabilities IE 582 * 583 */ 584 void lim_set_twt_ext_capabilities(struct mac_context *mac_ctx, 585 struct qdf_mac_addr *peer_mac, 586 struct s_ext_cap *ext_cap); 587 #else 588 static inline 589 void lim_fill_roamed_peer_twt_caps(struct mac_context *mac_ctx, uint8_t vdev_id, 590 struct roam_offload_synch_ind *roam_synch) 591 {} 592 593 static inline 594 void lim_set_twt_peer_capabilities(struct mac_context *mac_ctx, 595 struct qdf_mac_addr *peer_mac, 596 tDot11fIEhe_cap *he_cap, 597 tDot11fIEhe_op *he_op) 598 {} 599 600 static inline 601 void lim_set_twt_ext_capabilities(struct mac_context *mac_ctx, 602 struct qdf_mac_addr *peer_mac, 603 struct s_ext_cap *ext_cap) 604 {} 605 #endif 606 607 /** 608 * lim_get_basic_rates() - Get basic rates for the given frequency 609 * @b_rates: Pointer to rates 610 * @chan_freq: frequency for which rates are required 611 * 612 * This api will get basic rates for the given frequency 613 * 614 * Return: void 615 */ 616 void lim_get_basic_rates(tSirMacRateSet *b_rates, uint32_t chan_freq); 617 618 #define FW_CTS2SELF_PROFILE 34 619 620 /** 621 * lim_enable_cts_to_self_for_exempted_iot_ap() - enable cts to self for iot ap 622 * @mac_ctx: mac context 623 * @session: pe session 624 * @ie_ptr: ie pointer 625 * @ie_len: ie length 626 * 627 * Return: true on success else false 628 */ 629 bool lim_enable_cts_to_self_for_exempted_iot_ap( 630 struct mac_context *mac_ctx, 631 struct pe_session *session, 632 uint8_t *ie_ptr, 633 uint16_t ie_len); 634 635 /** 636 * lim_fill_pe_session() - Lim fill pe session 637 * @mac_ctx: Pointer to mac context 638 * @session: pe session 639 * @bss_desc: Pointer to bss description 640 * 641 * This api will fill lim pe session with info 642 * from bss description 643 * 644 * Return: qdf status 645 */ 646 QDF_STATUS 647 lim_fill_pe_session(struct mac_context *mac_ctx, 648 struct pe_session *session, 649 struct bss_description *bss_desc); 650 651 #ifdef WLAN_FEATURE_11BE_MLO 652 /** 653 * lim_update_mlo_mgr_info() - API to update mlo_mgr link info 654 * @mac_ctx: Pointer to mac context 655 * @vdev: vdev 656 * @link_addr: link address 657 * @link_id: Link id 658 * @freq: chan freq 659 * 660 * This api will update link sp[ecific info into mlo_mgr 661 * 662 * Return: qdf_status 663 */ 664 QDF_STATUS 665 lim_update_mlo_mgr_info(struct mac_context *mac_ctx, 666 struct wlan_objmgr_vdev *vdev, 667 struct qdf_mac_addr *link_addr, uint8_t link_id, 668 uint16_t freq); 669 /** 670 * lim_gen_link_specific_probe_rsp() - Generate link specific prb response 671 * @mac_ctx: Pointer to mac context 672 * @session_entry: pe session 673 * @rcvd_probe_resp: Pointer to received prb resp from AP. 674 * @probe_rsp: ptr to prb rsp 675 * @probe_rsp_len: length of prb rsp 676 * @rssi : rssi for link 677 * 678 * This api will generate link specific probe response 679 * and save in scan database. 680 * 681 * Return: qdf status 682 */ 683 QDF_STATUS 684 lim_gen_link_specific_probe_rsp(struct mac_context *mac_ctx, 685 struct pe_session *session_entry, 686 tpSirProbeRespBeacon rcvd_probe_resp, 687 uint8_t *probe_rsp, 688 uint32_t probe_rsp_len, 689 int32_t rssi); 690 /** 691 * lim_check_for_ml_probe_req() - check if ml probe req is sent 692 * @session: pe session 693 * 694 * Return qdf status 695 */ 696 QDF_STATUS lim_check_for_ml_probe_req(struct pe_session *session); 697 698 /** 699 * lim_process_cu_for_probe_rsp() - process critical update for probe response 700 * @mac_ctx: Pointer to mac context 701 * @session: pe session 702 * @probe_rsp: ptr to probe response 703 * @probe_rsp_len: length of probe response 704 * 705 * This api will generate link specific probe response and invoke function 706 * to process critical update IEs 707 * 708 * Return: qdf status 709 */ 710 QDF_STATUS 711 lim_process_cu_for_probe_rsp(struct mac_context *mac_ctx, 712 struct pe_session *session, 713 uint8_t *probe_rsp, 714 uint32_t probe_rsp_len); 715 716 #else 717 static inline QDF_STATUS 718 lim_update_mlo_mgr_info(struct mac_context *mac_ctx, 719 struct wlan_objmgr_vdev *vdev, 720 struct qdf_mac_addr *link_addr, uint8_t link_id, 721 uint16_t freq) 722 { 723 return QDF_STATUS_SUCCESS; 724 } 725 726 static inline QDF_STATUS 727 lim_gen_link_specific_probe_rsp(struct mac_context *mac_ctx, 728 struct pe_session *session_entry, 729 tpSirProbeRespBeacon rcvd_probe_resp, 730 uint8_t *probe_rsp, 731 uint32_t probe_rsp_len, 732 int32_t rssi) 733 { 734 return QDF_STATUS_SUCCESS; 735 } 736 737 static inline QDF_STATUS 738 lim_check_for_ml_probe_req(struct pe_session *session) 739 { 740 return QDF_STATUS_E_NOSUPPORT; 741 } 742 743 static inline QDF_STATUS 744 lim_process_cu_for_probe_rsp(struct mac_context *mac_ctx, 745 struct pe_session *session, 746 uint8_t *probe_rsp, 747 uint32_t probe_rsp_len) 748 { 749 return QDF_STATUS_SUCCESS; 750 } 751 #endif 752 753 #ifdef WLAN_FEATURE_SR 754 755 /** 756 * lim_update_vdev_sr_elements() - Update VDEV variable with 757 * parsed values received in SRP IE 758 * @session_entry: pe session 759 * @sta_ds: STA node 760 * 761 * Return void 762 */ 763 void lim_update_vdev_sr_elements(struct pe_session *session_entry, 764 tpDphHashNode sta_ds); 765 766 /** 767 * lim_process_srp_ie() - process srp ie during re/association 768 * @tpSirAssocRsp: assoc response 769 * @tpDphHashNode: sta node 770 * 771 * Return: success/failure 772 */ 773 QDF_STATUS lim_process_srp_ie(tpSirAssocRsp ar, tpDphHashNode sta_ds); 774 775 /** 776 * lim_handle_sr_cap() - To handle SR(Spatial Reuse) capability 777 * of roamed AP 778 * @vdev: objmgr vdev 779 * @reason: reason for the update 780 * 781 * This function is to check and compare SR cap of previous and 782 * roamed AP and takes decision to send event to userspace. 783 * 784 * Return: None 785 */ 786 void lim_handle_sr_cap(struct wlan_objmgr_vdev *vdev, 787 enum sr_osif_reason_code reason); 788 789 #else 790 static inline void 791 lim_update_vdev_sr_elements(struct pe_session *session_entry, 792 tpDphHashNode sta_ds) 793 { 794 } 795 796 static inline 797 QDF_STATUS lim_process_srp_ie(tpSirAssocRsp ar, tpDphHashNode sta_ds) 798 { 799 return QDF_STATUS_SUCCESS; 800 } 801 802 static inline void 803 lim_handle_sr_cap(struct wlan_objmgr_vdev *vdev, 804 enum sr_osif_reason_code reason) 805 { 806 } 807 #endif 808 809 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(WLAN_FEATURE_11BE_MLO) 810 /** 811 * lim_cm_roam_create_session() - Create pe session for legacy to MLO roaming 812 * @mac_ctx: Pointer to mac context 813 * @vdev_id: vdev id 814 * @roam_synch: Pointer to roam synch indication 815 * 816 * This api will check if vdev is link vdev and create a new pe session 817 * for legacy to MLO roaming case. 818 * 819 * Return: pe session 820 */ 821 struct pe_session * 822 lim_cm_roam_create_session(struct mac_context *mac_ctx, 823 uint8_t vdev_id, 824 struct roam_offload_synch_ind *sync_ind); 825 826 /** 827 * lim_create_and_fill_link_session() - handler for legacy to mlo roaming 828 * @mac_ctx: Pointer to mac context 829 * @vdev_id: vdev id 830 * @roam_synch: Pointer to roam synch indication 831 * @ie_len: ie length 832 * 833 * This is a lim level api called to handle legacy to MLO roaming scenario. 834 * 835 * Return: qdf status 836 */ 837 QDF_STATUS 838 lim_create_and_fill_link_session(struct mac_context *mac_ctx, 839 uint8_t vdev_id, 840 struct roam_offload_synch_ind *sync_ind, 841 uint16_t ie_len); 842 843 /** 844 * lim_cm_fill_link_session() - Update link session parameters 845 * @mac_ctx: Pointer to mac context 846 * @vdev_id: vdev id 847 * @pe_session: Pointer to pe session 848 * @roam_synch: Pointer to roam synch indication 849 * @ie_len: ie length 850 * 851 * This api will fill pe session and also fill the BSS descriptor 852 * which will be helpful further to complete the roam synch propagation. 853 * 854 * Return: qdf status 855 */ 856 QDF_STATUS 857 lim_cm_fill_link_session(struct mac_context *mac_ctx, 858 uint8_t vdev_id, 859 struct pe_session *pe_session, 860 struct roam_offload_synch_ind *sync_ind, 861 uint16_t ie_len); 862 863 /** 864 * lim_roam_mlo_create_peer() - Create roam mlo peer 865 * @mac_ctx: Pointer to mac context 866 * @sync_ind: Pointer to roam synch indication 867 * @vdev_id: vdev id 868 * @peer_mac: Peer mac pointer 869 * 870 * This api will create mlo peer called during mlo roaming scenario 871 * 872 * Return: none 873 */ 874 void lim_roam_mlo_create_peer(struct mac_context *mac, 875 struct roam_offload_synch_ind *sync_ind, 876 uint8_t vdev_id, 877 uint8_t *peer_mac); 878 879 /** 880 * lim_mlo_roam_delete_link_peer() - Delete mlo link peer 881 * @pe_session: Pointer to pe session 882 * @sta_ds: sta state node 883 * 884 * This api will delete mlo link peer called during mlo roaming scenario 885 * 886 * Return: none 887 */ 888 void 889 lim_mlo_roam_delete_link_peer(struct pe_session *pe_session, 890 tpDphHashNode sta_ds); 891 #else 892 static inline struct pe_session * 893 lim_cm_roam_create_session(struct mac_context *mac_ctx, 894 uint8_t vdev_id, 895 struct roam_offload_synch_ind *sync_ind) 896 { 897 return NULL; 898 } 899 900 static inline QDF_STATUS 901 lim_create_and_fill_link_session(struct mac_context *mac_ctx, 902 uint8_t vdev_id, 903 struct roam_offload_synch_ind *sync_ind, 904 uint16_t ie_len) 905 { 906 return QDF_STATUS_E_NOSUPPORT; 907 } 908 909 static inline QDF_STATUS 910 lim_cm_fill_link_session(struct mac_context *mac_ctx, 911 uint8_t vdev_id, 912 struct pe_session *pe_session, 913 struct roam_offload_synch_ind *sync_ind, 914 uint16_t ie_len) 915 { 916 return QDF_STATUS_E_NOSUPPORT; 917 } 918 919 static inline void 920 lim_roam_mlo_create_peer(struct mac_context *mac, 921 struct roam_offload_synch_ind *sync_ind, 922 uint8_t vdev_id, 923 uint8_t *peer_mac) 924 { 925 } 926 927 static inline void 928 lim_mlo_roam_delete_link_peer(struct pe_session *pe_session, 929 tpDphHashNode sta_ds) 930 { 931 } 932 #endif /* WLAN_FEATURE_ROAM_OFFLOAD && WLAN_FEATURE_11BE_MLO */ 933 934 enum ani_akm_type 935 lim_get_connected_akm(struct pe_session *session, int32_t ucast_cipher, 936 int32_t auth_mode, int32_t akm); 937 938 /** 939 * lim_get_encrypt_ed_type() - Get encrypt type 940 * @ucast_cipher: Ucast cipher 941 * 942 * Return: Encryption type enum 943 */ 944 tAniEdType lim_get_encrypt_ed_type(int32_t ucast_cipher); 945 /************************************************************/ 946 #endif /* __LIM_API_H */ 947