1 /* 2 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 /** 19 * DOC: Define the peer data structure of UMAC 20 * Public APIs to perform operations on Global objects 21 */ 22 #ifndef _WLAN_OBJMGR_PEER_OBJ_H_ 23 #define _WLAN_OBJMGR_PEER_OBJ_H_ 24 25 #include <qdf_types.h> 26 #include <qdf_atomic.h> 27 #include "wlan_objmgr_vdev_obj.h" 28 #ifdef WLAN_FEATURE_11BE_MLO 29 #include "wlan_mlo_mgr_public_structs.h" 30 #endif 31 32 /* peer flags */ 33 /* authorized for data */ 34 #define WLAN_PEER_F_AUTH 0x00000001 35 /* QoS enabled */ 36 #define WLAN_PEER_F_QOS 0x00000002 37 /* ERP enabled */ 38 #define WLAN_PEER_F_ERP 0x00000004 39 /* HT enabled */ 40 #define WLAN_PEER_F_HT 0x00000008 41 /* NB: tWLANhave the same value as IEEE80211_FC1_PWR_MGT */ 42 /* power save mode enabled */ 43 #define WLAN_PEER_F_PWR_MGT 0x00000010 44 /* keytsc for node has already been updated */ 45 #define WLAN_PEER_F_TSC_SET 0x00000020 46 /* U-APSD power save enabled */ 47 #define WLAN_PEER_F_UAPSD 0x00000040 48 /* U-APSD triggerable state */ 49 #define WLAN_PEER_F_UAPSD_TRIG 0x00000080 50 /* U-APSD SP in progress */ 51 #define WLAN_PEER_F_UAPSD_SP 0x00000100 52 /* Atheros Owl or follow-on device */ 53 #define WLAN_PEER_F_ATH 0x00000200 54 /* Owl WDS workaround needed*/ 55 #define WLAN_PEER_F_OWL_WDSWAR 0x00000400 56 /* WDS link */ 57 #define WLAN_PEER_F_WDS 0x00000800 58 /* No AMPDU support */ 59 #define WLAN_PEER_F_NOAMPDU 0x00001000 60 /* wep/tkip aggregation support */ 61 #define WLAN_PEER_F_WEPTKIPAGGR 0x00002000 62 #define WLAN_PEER_F_WEPTKIP 0x00004000 63 /* temp node (not in the node table) */ 64 #define WLAN_PEER_F_TEMP 0x00008000 65 /* 2.4ng VHT interop AMSDU disabled */ 66 #define WLAN_PEER_F_11NG_VHT_INTEROP_AMSDU_DISABLE 0x00010000 67 /* 40 MHz Intolerant */ 68 #define WLAN_PEER_F_40MHZ_INTOLERANT 0x00020000 69 /* node is paused*/ 70 #define WLAN_PEER_F_PAUSED 0x00040000 71 #define WLAN_PEER_F_EXTRADELIMWAR 0x00080000 72 /* 20 MHz requesting node */ 73 #define WLAN_PEER_F_REQ_20MHZ 0x00100000 74 /* all the tid queues in ath layer are paused*/ 75 #define WLAN_PEER_F_ATH_PAUSED 0x00200000 76 /*Require credit update*/ 77 #define WLAN_PEER_F_UAPSD_CREDIT_UPDATE 0x00400000 78 /*Require send deauth when h/w queue no data*/ 79 #define WLAN_PEER_F_KICK_OUT_DEAUTH 0x00800000 80 /* RRM enabled node */ 81 #define WLAN_PEER_F_RRM 0x01000000 82 /* Wakeup node */ 83 #define WLAN_PEER_F_WAKEUP 0x02000000 84 /* VHT enabled node */ 85 #define WLAN_PEER_F_VHT 0x04000000 86 /* deauth/Disassoc wait for node cleanup till frame goes on 87 air and tx feedback received */ 88 #define WLAN_PEER_F_DELAYED_CLEANUP 0x08000000 89 /* Extended stats enabled node */ 90 #define WLAN_PEER_F_EXT_STATS 0x10000000 91 /* Prevent _ieee80211_node_leave() from reentry */ 92 #define WLAN_PEER_F_LEAVE_ONGOING 0x20000000 93 /* band steering is enabled for this node */ 94 #define WLAN_PEER_F_BSTEERING_CAPABLE 0x40000000 95 /* node is a local mesh peer */ 96 #define WLAN_PEER_F_LOCAL_MESH_PEER 0x80000000 97 98 /* MLO enabled peer */ 99 #define WLAN_PEER_FEXT_MLO 0x00000001 100 101 /** 102 * enum wlan_peer_state - peer state 103 * @WLAN_INIT_STATE: Default state 104 * @WLAN_JOIN_STATE: Station mode, STA is waiting for Join 105 * @WLAN_AUTH_STATE: AUTH in progress 106 * @WLAN_ASSOC_STATE: ASSOC in progress 107 * @WLAN_WAITKEY_STATE: 4-way KEY handshake is in progress 108 * @WLAN_CONNECTED_STATE: Connected state 109 * @WLAN_PREAUTH_STATE: Station mode: Preauth 110 * @WLAN_DISCONNECT_STATE: Disconnect is in progress 111 */ 112 enum wlan_peer_state { 113 WLAN_INIT_STATE = 1, 114 WLAN_JOIN_STATE = 2, 115 WLAN_AUTH_STATE = 3, 116 WLAN_ASSOC_STATE = 4, 117 WLAN_WAITKEY_STATE = 5, 118 WLAN_CONNECTED_STATE = 6, 119 WLAN_PREAUTH_STATE = 7, 120 WLAN_DISCONNECT_STATE = 8, 121 }; 122 123 /** 124 * struct wlan_objmgr_peer_mlme - mlme common data of peer 125 * @peer_capinfo: protocol cap info 126 * @peer_flags: PEER OP flags 127 * @peer_ext_flags: PEER OP ext flags 128 * @peer_type: Type of PEER, (STA/AP/etc.) 129 * @phymode: phy mode of station 130 * @max_rate: Max Rate supported 131 * @state: State of the peer 132 * @seq_num: Sequence number 133 * @rssi: Last received RSSI value 134 * @assoc_peer: assoc req/response is handled in this peer 135 */ 136 struct wlan_objmgr_peer_mlme { 137 uint32_t peer_capinfo; 138 uint32_t peer_flags; 139 uint32_t peer_ext_flags; 140 enum wlan_peer_type peer_type; 141 enum wlan_phymode phymode; 142 uint32_t max_rate; 143 enum wlan_peer_state state; 144 uint16_t seq_num; 145 int8_t rssi; 146 bool is_authenticated; 147 #ifdef WLAN_FEATURE_11BE_MLO 148 bool assoc_peer; 149 #endif 150 }; 151 152 /** 153 * struct wlan_objmgr_peer_objmgr - object manager data of peer 154 * @vdev: VDEV pointer to which it is associated 155 * @ref_cnt: Ref count 156 * @ref_id_dbg: Array to track Ref count 157 * @print_cnt: Count to throttle Logical delete prints 158 * @wlan_objmgr_trace: Trace ref and deref 159 */ 160 struct wlan_objmgr_peer_objmgr { 161 struct wlan_objmgr_vdev *vdev; 162 qdf_atomic_t ref_cnt; 163 #ifdef WLAN_OBJMGR_REF_ID_DEBUG 164 qdf_atomic_t ref_id_dbg[WLAN_REF_ID_MAX]; 165 #endif 166 uint8_t print_cnt; 167 #ifdef WLAN_OBJMGR_REF_ID_TRACE 168 struct wlan_objmgr_trace trace; 169 #endif 170 }; 171 172 /** 173 * struct wlan_objmgr_peer - PEER common object 174 * @psoc_peer: peer list node for psoc's qdf list 175 * @vdev_peer: peer list node for vdev's qdf list 176 * @macaddr[]: Peer MAC address 177 * @peer_mlme: Peer MLME common structure 178 * @peer_objmgr: Peer Object manager common structure 179 * @peer_comp_priv_obj[]: Component's private object pointers 180 * @obj_status[]: status of each component object 181 * @obj_state: Status of Peer object 182 * @pdev_id: Pdev ID 183 * @peer_lock: Lock for access/update peer contents 184 * @mlo_peer_ctx: Reference to MLO Peer context 185 * @mldaddr: Peer MLD MAC address 186 */ 187 struct wlan_objmgr_peer { 188 qdf_list_node_t psoc_peer; 189 qdf_list_node_t vdev_peer; 190 uint8_t macaddr[QDF_MAC_ADDR_SIZE]; 191 uint8_t pdev_id; 192 struct wlan_objmgr_peer_mlme peer_mlme; 193 struct wlan_objmgr_peer_objmgr peer_objmgr; 194 void *peer_comp_priv_obj[WLAN_UMAC_MAX_COMPONENTS]; 195 QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS]; 196 WLAN_OBJ_STATE obj_state; 197 qdf_spinlock_t peer_lock; 198 #ifdef WLAN_FEATURE_11BE_MLO 199 struct wlan_mlo_peer_context *mlo_peer_ctx; 200 uint8_t mldaddr[QDF_MAC_ADDR_SIZE]; 201 #endif 202 }; 203 204 /** 205 ** APIs to Create/Delete Global object APIs 206 */ 207 /** 208 * wlan_objmgr_peer_obj_create() - peer object create 209 * @vdev: VDEV object on which this peer gets created 210 * @peer_type: peer type (AP/STA) 211 * @macaddr: MAC address 212 * 213 * Creates Peer object, intializes with default values 214 * Attaches to psoc and vdev objects 215 * Invokes the registered notifiers to create component object 216 * 217 * Return: Handle to struct wlan_objmgr_peer on successful creation, 218 * NULL on Failure (on Mem alloc failure and Component objects 219 * Failure) 220 */ 221 struct wlan_objmgr_peer *wlan_objmgr_peer_obj_create( 222 struct wlan_objmgr_vdev *vdev, 223 enum wlan_peer_type type, 224 uint8_t macaddr[]); 225 226 /** 227 * wlan_objmgr_peer_obj_delete() - peer object delete 228 * @peer: PEER object 229 * 230 * Deletes PEER object, removes it from PSOC's, VDEV's peer list 231 * Invokes the registered notifiers to destroy component objects 232 * 233 * Return: SUCCESS/FAILURE 234 */ 235 QDF_STATUS wlan_objmgr_peer_obj_delete(struct wlan_objmgr_peer *peer); 236 237 /** 238 ** APIs to attach/detach component objects 239 */ 240 /** 241 * wlan_objmgr_peer_component_obj_attach() - attach comp object to peer 242 * @peer: PEER object 243 * @id: Component id 244 * @comp_priv_obj: component's private object pointer 245 * @status: Component's private object creation status 246 * 247 * API to be used for attaching component object with PEER common object 248 * 249 * Return: SUCCESS on successful storing of component's object in common object 250 * On FAILURE (appropriate failure codes are returned) 251 */ 252 QDF_STATUS wlan_objmgr_peer_component_obj_attach( 253 struct wlan_objmgr_peer *peer, 254 enum wlan_umac_comp_id id, 255 void *comp_priv_obj, 256 QDF_STATUS status); 257 258 /** 259 * wlan_objmgr_peer_component_obj_detach() - detach comp object from peer 260 * @peer: PEER object 261 * @id: Component id 262 * @comp_priv_obj: component's private object pointer 263 * 264 * API to be used for detaching component object with PEER common object 265 * 266 * Return: SUCCESS on successful removal of component's object from common 267 * object 268 * On FAILURE (appropriate failure codes are returned) 269 */ 270 QDF_STATUS wlan_objmgr_peer_component_obj_detach( 271 struct wlan_objmgr_peer *peer, 272 enum wlan_umac_comp_id id, 273 void *comp_priv_obj); 274 275 /** 276 ** APIs to operations on peer objects 277 */ 278 279 /** 280 * wlan_objmgr_trigger_peer_comp_priv_object_creation() - create 281 * peer comp object 282 * @peer: PEER object 283 * @id: Component id 284 * 285 * API to create component private object in run time, this would 286 * be used for features which gets enabled in run time 287 * 288 * Return: SUCCESS on successful creation 289 * On FAILURE (appropriate failure codes are returned) 290 */ 291 QDF_STATUS wlan_objmgr_trigger_peer_comp_priv_object_creation( 292 struct wlan_objmgr_peer *peer, 293 enum wlan_umac_comp_id id); 294 295 /** 296 * wlan_objmgr_trigger_peer_comp_priv_object_deletion() - destroy 297 * peer comp object 298 * @peer: PEER object 299 * @id: Component id 300 * 301 * API to destroy component private object in run time, this would 302 * be used for features which gets disabled in run time 303 * 304 * Return: SUCCESS on successful deletion 305 * On FAILURE (appropriate failure codes are returned) 306 */ 307 QDF_STATUS wlan_objmgr_trigger_peer_comp_priv_object_deletion( 308 struct wlan_objmgr_peer *peer, 309 enum wlan_umac_comp_id id); 310 311 /** 312 * wlan_objmgr_peer_get_comp_private_obj() - get peer component private object 313 * @peer: PEER object 314 * @id: Component id 315 * 316 * API to get component private object 317 * 318 * Return: void *ptr on SUCCESS 319 * NULL on Failure 320 */ 321 void *wlan_objmgr_peer_get_comp_private_obj( 322 struct wlan_objmgr_peer *peer, 323 enum wlan_umac_comp_id id); 324 325 /** 326 * wlan_peer_obj_lock() - Acquire PEER spinlock 327 * @psoc: PEER object 328 * 329 * API to acquire PEER spin lock 330 * Parent lock should not be taken in child lock context 331 * but child lock can be taken in parent lock context 332 * (for ex: psoc lock can't be invoked in pdev/vdev/peer lock context) 333 * 334 * Return: void 335 */ 336 static inline void wlan_peer_obj_lock(struct wlan_objmgr_peer *peer) 337 { 338 qdf_spin_lock_bh(&peer->peer_lock); 339 } 340 341 /** 342 * wlan_peer_obj_unlock() - Release PEER spinlock 343 * @peer: PEER object 344 * 345 * API to Release PEER spin lock 346 * 347 * Return: void 348 */ 349 static inline void wlan_peer_obj_unlock(struct wlan_objmgr_peer *peer) 350 { 351 qdf_spin_unlock_bh(&peer->peer_lock); 352 } 353 354 /** 355 * DOC: Examples to use PEER ref count APIs 356 * 357 * In all the scenarios, the pair of API should be followed 358 * other it lead to memory leak 359 * 360 * scenario 1: 361 * 362 * wlan_objmgr_peer_obj_create() 363 * ---- 364 * wlan_objmgr_peer_obj_delete() 365 * 366 * scenario 2: 367 * 368 * wlan_objmgr_peer_get_ref() 369 * ---- 370 * the operations which are done on 371 * peer object 372 * ---- 373 * wlan_objmgr_peer_release_ref() 374 * 375 * scenario 3: 376 * 377 * API to retrieve peer (xxx_get_peer_xxx()) 378 * ---- 379 * the operations which are done on 380 * peer object 381 * ---- 382 * wlan_objmgr_peer_release_ref() 383 */ 384 385 /** 386 * wlan_objmgr_peer_get_ref() - increment ref count 387 * @peer: PEER object 388 * @id: Object Manager ref debug id 389 * 390 * API to increment ref count of peer 391 * 392 * Return: void 393 */ 394 #ifdef WLAN_OBJMGR_REF_ID_TRACE 395 void wlan_objmgr_peer_get_ref_debug(struct wlan_objmgr_peer *peer, 396 wlan_objmgr_ref_dbgid id, 397 const char *func, int line); 398 399 #define wlan_objmgr_peer_get_ref(peer, dbgid) \ 400 wlan_objmgr_peer_get_ref_debug(peer, dbgid, __func__, __LINE__) 401 #else 402 void wlan_objmgr_peer_get_ref(struct wlan_objmgr_peer *peer, 403 wlan_objmgr_ref_dbgid id); 404 #endif 405 406 /** 407 * wlan_objmgr_peer_try_get_ref() - increment ref count, if allowed 408 * @peer: PEER object 409 * @id: Object Manager ref debug id 410 * 411 * API to increment ref count of peer, if object state is valid 412 * 413 * Return: void 414 */ 415 #ifdef WLAN_OBJMGR_REF_ID_TRACE 416 QDF_STATUS wlan_objmgr_peer_try_get_ref_debug(struct wlan_objmgr_peer *peer, 417 wlan_objmgr_ref_dbgid id, 418 const char *func, int line); 419 420 #define wlan_objmgr_peer_try_get_ref(peer, dbgid) \ 421 wlan_objmgr_peer_try_get_ref_debug(peer, dbgid, \ 422 __func__, __LINE__) 423 #else 424 QDF_STATUS wlan_objmgr_peer_try_get_ref(struct wlan_objmgr_peer *peer, 425 wlan_objmgr_ref_dbgid id); 426 #endif 427 428 /** 429 * wlan_objmgr_peer_release_ref() - decrement ref count 430 * @peer: PEER object 431 * @id: Object Manager ref debug id 432 * 433 * API to decrement ref count of peer, if ref count is 1, it initiates the 434 * peer deletion 435 * 436 * Return: void 437 */ 438 #ifdef WLAN_OBJMGR_REF_ID_TRACE 439 void wlan_objmgr_peer_release_ref_debug(struct wlan_objmgr_peer *peer, 440 wlan_objmgr_ref_dbgid id, 441 const char *func, int line); 442 443 #define wlan_objmgr_peer_release_ref(peer, dbgid) \ 444 wlan_objmgr_peer_release_ref_debug(peer, dbgid, \ 445 __func__, __LINE__) 446 #else 447 void wlan_objmgr_peer_release_ref(struct wlan_objmgr_peer *peer, 448 wlan_objmgr_ref_dbgid id); 449 #endif 450 451 /** 452 * wlan_peer_get_next_peer_of_psoc_ref() - get next peer to psoc peer list 453 * with lock and ref taken 454 * @peer_list: Peer list 455 * @hash_index: peer list hash index 456 * @peer: PEER object 457 * @dbg_id: Ref count debug module id 458 * 459 * API to get the next peer of given peer (of psoc's peer list) 460 * 461 * Return: 462 * @next_peer: PEER object 463 */ 464 #ifdef WLAN_OBJMGR_REF_ID_TRACE 465 struct wlan_objmgr_peer *wlan_peer_get_next_peer_of_psoc_ref_debug( 466 struct wlan_peer_list *peer_list, 467 uint8_t hash_index, 468 struct wlan_objmgr_peer *peer, 469 wlan_objmgr_ref_dbgid dbg_id, 470 const char *func, int line); 471 472 #define wlan_peer_get_next_peer_of_psoc_ref(peer_list, hash_index, peer, \ 473 dbgid) \ 474 wlan_peer_get_next_peer_of_psoc_ref_debug(peer_list, \ 475 hash_index, peer, dbgid, __func__, __LINE__) 476 #else 477 struct wlan_objmgr_peer *wlan_peer_get_next_peer_of_psoc_ref( 478 struct wlan_peer_list *peer_list, 479 uint8_t hash_index, 480 struct wlan_objmgr_peer *peer, 481 wlan_objmgr_ref_dbgid dbg_id); 482 #endif 483 484 /** 485 * wlan_peer_get_next_active_peer_of_psoc() - get next active peer to psoc peer 486 * list 487 * @peer_list: Peer list 488 * @hash_index: peer list hash index 489 * @peer: PEER object 490 * @dbg_id: Ref count debug module id 491 * 492 * API to get the next peer of given peer (of psoc's peer list) 493 * 494 * Return: 495 * @next_peer: PEER object 496 */ 497 #ifdef WLAN_OBJMGR_REF_ID_TRACE 498 struct wlan_objmgr_peer *wlan_peer_get_next_active_peer_of_psoc_debug( 499 struct wlan_peer_list *peer_list, 500 uint8_t hash_index, 501 struct wlan_objmgr_peer *peer, 502 wlan_objmgr_ref_dbgid dbg_id, 503 const char *func, int line); 504 505 #define wlan_peer_get_next_active_peer_of_psoc(peer_list, hash_index, \ 506 peer, dbgid) \ 507 wlan_peer_get_next_active_peer_of_psoc_debug(peer_list, \ 508 hash_index, peer, dbgid, __func__, __LINE__) 509 #else 510 struct wlan_objmgr_peer *wlan_peer_get_next_active_peer_of_psoc( 511 struct wlan_peer_list *peer_list, 512 uint8_t hash_index, 513 struct wlan_objmgr_peer *peer, 514 wlan_objmgr_ref_dbgid dbg_id); 515 #endif 516 517 /** 518 * wlan_peer_get_next_active_peer_of_vdev() - get next active_peer of vdev list 519 * @vdev: VDEV object 520 * @peer_list: Peer object list 521 * @peer: PEER object 522 * @dbg_id: Ref count debug module id 523 * 524 * API to get the next active peer of given peer (of vdev's peer list) 525 * 526 * Return: 527 * @next_peer: PEER object 528 */ 529 #ifdef WLAN_OBJMGR_REF_ID_TRACE 530 struct wlan_objmgr_peer *wlan_peer_get_next_active_peer_of_vdev_debug( 531 struct wlan_objmgr_vdev *vdev, 532 qdf_list_t *peer_list, 533 struct wlan_objmgr_peer *peer, 534 wlan_objmgr_ref_dbgid dbg_id, 535 const char *func, int line); 536 537 #define wlan_peer_get_next_active_peer_of_vdev(vdev, peer_list, peer, dbgid) \ 538 wlan_peer_get_next_active_peer_of_vdev_debug(vdev, peer_list, \ 539 peer, dbgid, __func__, __LINE__) 540 #else 541 struct wlan_objmgr_peer *wlan_peer_get_next_active_peer_of_vdev( 542 struct wlan_objmgr_vdev *vdev, 543 qdf_list_t *peer_list, 544 struct wlan_objmgr_peer *peer, 545 wlan_objmgr_ref_dbgid dbg_id); 546 #endif 547 548 /** 549 * wlan_vdev_peer_list_peek_active_head() - get active head of vdev peer list 550 * @vdev: VDEV object 551 * @peer_list: qdf_list_t 552 * @dbg_id: Ref count debug module id 553 * 554 * API to get the active head peer of given peer (of vdev's peer list) 555 * 556 * Return: 557 * @peer: active head peer 558 */ 559 #ifdef WLAN_OBJMGR_REF_ID_TRACE 560 struct wlan_objmgr_peer *wlan_vdev_peer_list_peek_active_head_debug( 561 struct wlan_objmgr_vdev *vdev, 562 qdf_list_t *peer_list, 563 wlan_objmgr_ref_dbgid dbg_id, 564 const char *func, int line); 565 566 #define wlan_vdev_peer_list_peek_active_head(vdev, peer_list, dbgid) \ 567 wlan_vdev_peer_list_peek_active_head_debug(vdev, peer_list, \ 568 dbgid, __func__, __LINE__) 569 #else 570 struct wlan_objmgr_peer *wlan_vdev_peer_list_peek_active_head( 571 struct wlan_objmgr_vdev *vdev, 572 qdf_list_t *peer_list, 573 wlan_objmgr_ref_dbgid dbg_id); 574 #endif 575 576 /** 577 * wlan_psoc_peer_list_peek_head_ref() - get head of psoc peer list 578 * with ref and lock protected 579 * @peer_list: wlan_peer_list 580 * @hash_index: peer list hash index 581 * @dbg_id: Ref count debug module id 582 * 583 * API to get the head peer of given peer (of psoc's peer list) 584 * 585 * Return: 586 * @peer: head peer 587 */ 588 #ifdef WLAN_OBJMGR_REF_ID_TRACE 589 struct wlan_objmgr_peer *wlan_psoc_peer_list_peek_head_ref_debug( 590 struct wlan_peer_list *peer_list, 591 uint8_t hash_index, 592 wlan_objmgr_ref_dbgid dbg_id, 593 const char *func, int line); 594 595 #define wlan_psoc_peer_list_peek_head_ref(peer_list, hash_index, dbgid) \ 596 wlan_psoc_peer_list_peek_head_ref_debug(peer_list, hash_index, \ 597 dbgid, __func__, __LINE__) 598 #else 599 struct wlan_objmgr_peer *wlan_psoc_peer_list_peek_head_ref( 600 struct wlan_peer_list *peer_list, 601 uint8_t hash_index, 602 wlan_objmgr_ref_dbgid dbg_id); 603 #endif 604 605 /** 606 * wlan_psoc_peer_list_peek_active_head() - get active head of psoc peer list 607 * @peer_list: wlan_peer_list 608 * @hash_index: peer list hash index 609 * @dbg_id: Ref count debug module id 610 * 611 * API to get the head peer of given peer (of psoc's peer list) 612 * 613 * Return: 614 * @peer: head peer 615 */ 616 #ifdef WLAN_OBJMGR_REF_ID_TRACE 617 struct wlan_objmgr_peer *wlan_psoc_peer_list_peek_active_head_debug( 618 struct wlan_peer_list *peer_list, 619 uint8_t hash_index, 620 wlan_objmgr_ref_dbgid dbg_id, 621 const char *func, int line); 622 623 #define wlan_psoc_peer_list_peek_active_head(peer_list, hash_index, dbgid) \ 624 wlan_psoc_peer_list_peek_active_head_debug(peer_list, \ 625 hash_index, dbgid, __func__, __LINE__) 626 #else 627 struct wlan_objmgr_peer *wlan_psoc_peer_list_peek_active_head( 628 struct wlan_peer_list *peer_list, 629 uint8_t hash_index, 630 wlan_objmgr_ref_dbgid dbg_id); 631 #endif 632 633 /** 634 * wlan_psoc_peer_list_peek_head() - get head of psoc peer list 635 * @peer_list: qdf_list_t 636 * 637 * API to get the head peer of given peer (of psoc's peer list) 638 * 639 * Caller need to acquire lock with wlan_peer_obj_lock() 640 * 641 * Return: 642 * @peer: head peer 643 */ 644 static inline struct wlan_objmgr_peer *wlan_psoc_peer_list_peek_head( 645 qdf_list_t *peer_list) 646 { 647 struct wlan_objmgr_peer *peer; 648 qdf_list_node_t *psoc_node = NULL; 649 650 /* This API is invoked with lock acquired, do not add log prints */ 651 if (qdf_list_peek_front(peer_list, &psoc_node) != QDF_STATUS_SUCCESS) 652 return NULL; 653 654 peer = qdf_container_of(psoc_node, struct wlan_objmgr_peer, psoc_peer); 655 return peer; 656 } 657 658 /** 659 * wlan_vdev_peer_list_peek_head() - get head of vdev peer list 660 * @peer_list: qdf_list_t 661 * 662 * API to get the head peer of given peer (of vdev's peer list) 663 * 664 * Caller need to acquire lock with wlan_peer_obj_lock() 665 * 666 * Return: 667 * @peer: head peer 668 */ 669 static inline struct wlan_objmgr_peer *wlan_vdev_peer_list_peek_head( 670 qdf_list_t *peer_list) 671 { 672 struct wlan_objmgr_peer *peer; 673 qdf_list_node_t *vdev_node = NULL; 674 675 /* This API is invoked with lock acquired, do not add log prints */ 676 if (qdf_list_peek_front(peer_list, &vdev_node) != QDF_STATUS_SUCCESS) 677 return NULL; 678 679 peer = qdf_container_of(vdev_node, struct wlan_objmgr_peer, vdev_peer); 680 return peer; 681 } 682 683 /** 684 * wlan_peer_get_next_peer_of_vdev() - get next peer of vdev list 685 * @peer: PEER object 686 * 687 * API to get the next peer of given peer (of vdev's peer list) 688 * 689 * Caller need to acquire lock with wlan_peer_obj_lock() 690 * 691 * Return: 692 * @next_peer: PEER object 693 */ 694 static inline struct wlan_objmgr_peer *wlan_peer_get_next_peer_of_vdev( 695 qdf_list_t *peer_list, struct wlan_objmgr_peer *peer) 696 { 697 struct wlan_objmgr_peer *peer_next; 698 qdf_list_node_t *node; 699 qdf_list_node_t *next_node = NULL; 700 701 /* This API is invoked with lock acquired, do not add log prints */ 702 if (!peer) 703 return NULL; 704 705 node = &peer->vdev_peer; 706 if (qdf_list_peek_next(peer_list, node, &next_node) != 707 QDF_STATUS_SUCCESS) 708 return NULL; 709 710 peer_next = qdf_container_of(next_node, struct wlan_objmgr_peer, 711 vdev_peer); 712 return peer_next; 713 } 714 715 /** 716 * wlan_peer_set_next_peer_of_vdev() - add peer to vdev peer list 717 * @peer: PEER object 718 * @new_peer: PEER object 719 * 720 * API to set as the next peer to given peer (of vdev's peer list) 721 * 722 * Caller need to acquire lock with wlan_peer_obj_lock() 723 * 724 * Return: void 725 */ 726 static inline void wlan_peer_set_next_peer_of_vdev(qdf_list_t *peer_list, 727 struct wlan_objmgr_peer *new_peer) 728 { 729 /* This API is invoked with lock acquired, do not add log prints */ 730 /* set next peer with new peer */ 731 qdf_list_insert_back(peer_list, &new_peer->vdev_peer); 732 return; 733 } 734 735 /** 736 * wlan_peer_get_next_peer_of_psoc() - get next peer to psoc peer list 737 * @peer_list: Peer list 738 * @peer: PEER object 739 * 740 * API to get the next peer of given peer (of psoc's peer list) 741 * 742 * Caller need to acquire lock with wlan_peer_obj_lock() 743 * 744 * Return: 745 * @next_peer: PEER object 746 */ 747 static inline struct wlan_objmgr_peer *wlan_peer_get_next_peer_of_psoc( 748 qdf_list_t *peer_list, struct wlan_objmgr_peer *peer) 749 { 750 struct wlan_objmgr_peer *peer_next; 751 qdf_list_node_t *node = NULL; 752 qdf_list_node_t *next_node = NULL; 753 754 /* This API is invoked with lock acquired, do not add log prints */ 755 if (!peer) 756 return NULL; 757 758 node = &peer->psoc_peer; 759 if (qdf_list_peek_next(peer_list, node, &next_node) != 760 QDF_STATUS_SUCCESS) 761 return NULL; 762 763 peer_next = qdf_container_of(next_node, struct wlan_objmgr_peer, 764 psoc_peer); 765 return peer_next; 766 } 767 768 /** 769 * wlan_peer_set_next_peer_of_psoc() - add peer to psoc peer list 770 * @peer: PEER object 771 * @new_peer: PEER object 772 * 773 * API to set as the next peer to given peer (of psoc's peer list) 774 * 775 * Caller need to acquire lock with wlan_peer_obj_lock() 776 * 777 * Return: void 778 */ 779 static inline void wlan_peer_set_next_peer_of_psoc(qdf_list_t *peer_list, 780 struct wlan_objmgr_peer *new_peer) 781 { 782 /* This API is invoked with lock acquired, do not add log prints */ 783 /* set next peer with new peer */ 784 qdf_list_insert_back(peer_list, &new_peer->psoc_peer); 785 return; 786 } 787 788 /** 789 * wlan_peer_set_peer_type() - set peer type 790 * @peer: PEER object 791 * @peer_type: type of PEER 792 * 793 * API to set peer type 794 * 795 * Return: void 796 */ 797 static inline void wlan_peer_set_peer_type(struct wlan_objmgr_peer *peer, 798 enum wlan_peer_type type) 799 { 800 peer->peer_mlme.peer_type = type; 801 } 802 803 /** 804 * wlan_peer_get_peer_type() - get peer type 805 * @peer: PEER object 806 * 807 * API to get peer type 808 * 809 * Return: 810 * @peer_type: type of PEER 811 */ 812 static inline enum wlan_peer_type wlan_peer_get_peer_type( 813 struct wlan_objmgr_peer *peer) 814 { 815 return peer->peer_mlme.peer_type; 816 } 817 818 /** 819 * wlan_peer_set_phymode() - set phymode 820 * @peer: PEER object 821 * @phymode: phymode of peer 822 * 823 * API to set phymode 824 * 825 * Return: void 826 */ 827 static inline void wlan_peer_set_phymode(struct wlan_objmgr_peer *peer, 828 enum wlan_phymode phymode) 829 { 830 peer->peer_mlme.phymode = phymode; 831 } 832 833 /** 834 * wlan_peer_get_phymode() - get phymode 835 * @peer: PEER object 836 * 837 * API to get phymode 838 * 839 * Return: 840 * @phymode: phymode of PEER 841 */ 842 static inline enum wlan_phymode wlan_peer_get_phymode( 843 struct wlan_objmgr_peer *peer) 844 { 845 return peer->peer_mlme.phymode; 846 } 847 848 /** 849 * wlan_peer_set_rssi() - set RSSI 850 * @peer: PEER object 851 * @rssi: RSSI 852 * 853 * API to set rssi 854 * 855 * Return: void 856 */ 857 static inline void wlan_peer_set_rssi(struct wlan_objmgr_peer *peer, 858 int8_t rssi) 859 { 860 peer->peer_mlme.rssi = rssi; 861 } 862 863 /** 864 * wlan_peer_get_rssi() - get RSSI 865 * @peer: PEER object 866 * 867 * API to get RSSI 868 * 869 * Return: 870 * @rssi: RSSI of PEER 871 */ 872 static inline int8_t wlan_peer_get_rssi( 873 struct wlan_objmgr_peer *peer) 874 { 875 return peer->peer_mlme.rssi; 876 } 877 878 /** 879 * wlan_peer_set_macaddr() - set mac addr 880 * @peer: PEER object 881 * @macaddr: MAC address 882 * 883 * API to set peer mac address 884 * 885 * Caller need to acquire lock with wlan_peer_obj_lock() 886 * 887 * Return: void 888 */ 889 static inline void wlan_peer_set_macaddr(struct wlan_objmgr_peer *peer, 890 uint8_t *macaddr) 891 { 892 /* This API is invoked with lock acquired, do not add log prints */ 893 WLAN_ADDR_COPY(peer->macaddr, macaddr); 894 } 895 896 /** 897 * wlan_peer_get_macaddr() - get mac addr 898 * @peer: PEER object 899 * 900 * API to get peer mac address 901 * 902 * Caller need to acquire lock with wlan_peer_obj_lock() 903 * 904 * Return: 905 * @macaddr: MAC address 906 */ 907 static inline uint8_t *wlan_peer_get_macaddr(struct wlan_objmgr_peer *peer) 908 { 909 /* This API is invoked with lock acquired, do not add log prints */ 910 return peer->macaddr; 911 } 912 913 /** 914 * wlan_peer_get_vdev() - get vdev 915 * @peer: PEER object 916 * 917 * API to get peer's vdev 918 * 919 * Return: 920 * @vdev: VDEV object 921 */ 922 static inline struct wlan_objmgr_vdev *wlan_peer_get_vdev( 923 struct wlan_objmgr_peer *peer) 924 { 925 return peer->peer_objmgr.vdev; 926 } 927 928 /** 929 * wlan_peer_set_vdev() - set vdev 930 * @peer: PEER object 931 * @vdev: VDEV object 932 * 933 * API to set peer's vdev 934 * 935 * Return: void 936 */ 937 static inline void wlan_peer_set_vdev(struct wlan_objmgr_peer *peer, 938 struct wlan_objmgr_vdev *vdev) 939 { 940 peer->peer_objmgr.vdev = vdev; 941 } 942 943 /** 944 * wlan_peer_mlme_flag_set() - mlme flag set 945 * @peer: PEER object 946 * @flag: flag to be set 947 * 948 * API to set flag in peer 949 * 950 * Return: void 951 */ 952 static inline void wlan_peer_mlme_flag_set(struct wlan_objmgr_peer *peer, 953 uint32_t flag) 954 { 955 peer->peer_mlme.peer_flags |= flag; 956 } 957 958 /** 959 * wlan_peer_mlme_flag_clear() - mlme flag clear 960 * @peer: PEER object 961 * @flag: flag to be cleared 962 * 963 * API to clear flag in peer 964 * 965 * Return: void 966 */ 967 static inline void wlan_peer_mlme_flag_clear(struct wlan_objmgr_peer *peer, 968 uint32_t flag) 969 { 970 peer->peer_mlme.peer_flags &= ~flag; 971 } 972 973 /** 974 * wlan_peer_mlme_flag_get() - mlme flag get 975 * @peer: PEER object 976 * @flag: flag to be checked 977 * 978 * API to know, whether particular flag is set in peer 979 * 980 * Return: 1 (for set) or 0 (for not set) 981 */ 982 static inline uint8_t wlan_peer_mlme_flag_get(struct wlan_objmgr_peer *peer, 983 uint32_t flag) 984 { 985 return (peer->peer_mlme.peer_flags & flag) ? 1 : 0; 986 } 987 988 /** 989 * wlan_peer_mlme_flag_ext_set() - mlme ext flag set 990 * @peer: PEER object 991 * @flag: ext flag to be set 992 * 993 * API to set ext flag in peer 994 * 995 * Return: void 996 */ 997 static inline void wlan_peer_mlme_flag_ext_set(struct wlan_objmgr_peer *peer, 998 uint32_t flag) 999 { 1000 peer->peer_mlme.peer_ext_flags |= flag; 1001 } 1002 1003 /** 1004 * wlan_peer_mlme_flag_clear() - mlme ext flag clear 1005 * @peer: PEER object 1006 * @flag: ext flag to be cleared 1007 * 1008 * API to clear ext flag in peer 1009 * 1010 * Return: void 1011 */ 1012 static inline void wlan_peer_mlme_flag_ext_clear(struct wlan_objmgr_peer *peer, 1013 uint32_t flag) 1014 { 1015 peer->peer_mlme.peer_ext_flags &= ~flag; 1016 } 1017 1018 /** 1019 * wlan_peer_mlme_flag_ext_get() - mlme ext flag get 1020 * @peer: PEER object 1021 * @flag: ext flag to be checked 1022 * 1023 * API to know, whether particular ext flag is set in peer 1024 * 1025 * Return: 1 (for set) or 0 (for not set) 1026 */ 1027 static inline uint8_t wlan_peer_mlme_flag_ext_get(struct wlan_objmgr_peer *peer, 1028 uint32_t flag) 1029 { 1030 return (peer->peer_mlme.peer_ext_flags & flag) ? 1 : 0; 1031 } 1032 1033 /** 1034 * wlan_peer_mlme_set_state() - peer mlme state 1035 * @peer: PEER object 1036 * @state: enum wlan_peer_state 1037 * 1038 * API to update the current peer state 1039 * 1040 * Return: void 1041 */ 1042 static inline void wlan_peer_mlme_set_state( 1043 struct wlan_objmgr_peer *peer, 1044 enum wlan_peer_state state) 1045 { 1046 peer->peer_mlme.state = state; 1047 } 1048 1049 #ifdef WLAN_FEATURE_11BE_MLO 1050 /** 1051 * wlan_peer_mlme_get_mldaddr() - get peer mldaddr 1052 * @peer: PEER object 1053 * 1054 * API to get MLD address from peer object 1055 * 1056 * Return: mld address 1057 */ 1058 static inline uint8_t *wlan_peer_mlme_get_mldaddr(struct wlan_objmgr_peer *peer) 1059 { 1060 return peer->mldaddr; 1061 } 1062 1063 /** 1064 * wlan_peer_mlme_set_mldaddr() - set peer mldaddr 1065 * @peer: PEER object 1066 * @mldaddr: MLD address 1067 * 1068 * API to set MLD addr in peer object 1069 * 1070 * Return: void 1071 */ 1072 static inline void wlan_peer_mlme_set_mldaddr(struct wlan_objmgr_peer *peer, 1073 uint8_t *mldaddr) 1074 { 1075 WLAN_ADDR_COPY(peer->mldaddr, mldaddr); 1076 } 1077 1078 /** 1079 * wlan_peer_mlme_set_assoc_peer() - assoc frames is received on this peer 1080 * @peer: PEER object 1081 * @is_assoc_link: whether assoc frames is received on this peer or not 1082 * 1083 * API to update assoc peer 1084 * 1085 * Return: void 1086 */ 1087 static inline void wlan_peer_mlme_set_assoc_peer( 1088 struct wlan_objmgr_peer *peer, 1089 bool is_assoc_link) 1090 { 1091 peer->peer_mlme.assoc_peer = is_assoc_link; 1092 } 1093 1094 /** 1095 * wlan_peer_mlme_is_assoc_peer() - check peer is assoc peer or not 1096 * @peer: PEER object 1097 * 1098 * API to get assoc peer info 1099 * 1100 * Return: whether assoc frames is received on this peer or not 1101 */ 1102 static inline bool wlan_peer_mlme_is_assoc_peer( 1103 struct wlan_objmgr_peer *peer) 1104 { 1105 return peer->peer_mlme.assoc_peer; 1106 } 1107 #else 1108 1109 static inline uint8_t *wlan_peer_mlme_get_mldaddr(struct wlan_objmgr_peer *peer) 1110 { 1111 return NULL; 1112 } 1113 1114 static inline void wlan_peer_mlme_set_mldaddr(struct wlan_objmgr_peer *peer, 1115 uint8_t *mldaddr) 1116 { 1117 } 1118 1119 static inline void wlan_peer_mlme_set_assoc_peer( 1120 struct wlan_objmgr_peer *peer, 1121 bool is_assoc_link) 1122 { 1123 } 1124 1125 static inline bool wlan_peer_mlme_is_assoc_peer( 1126 struct wlan_objmgr_peer *peer) 1127 { 1128 return false; 1129 } 1130 #endif 1131 1132 /** 1133 * wlan_peer_mlme_set_auth_state() - peer mlme auth state 1134 * @peer: PEER object 1135 * @is_authenticated: true or false 1136 * 1137 * API to update the current peer auth state 1138 * 1139 * Return: void 1140 */ 1141 static inline void wlan_peer_mlme_set_auth_state( 1142 struct wlan_objmgr_peer *peer, 1143 bool is_authenticated) 1144 { 1145 peer->peer_mlme.is_authenticated = is_authenticated; 1146 } 1147 1148 /** 1149 * wlan_peer_mlme_get_state() - peer mlme state 1150 * @peer: PEER object 1151 * 1152 * API to get peer state 1153 * 1154 * Return: enum wlan_peer_state 1155 */ 1156 static inline enum wlan_peer_state wlan_peer_mlme_get_state( 1157 struct wlan_objmgr_peer *peer) 1158 { 1159 return peer->peer_mlme.state; 1160 } 1161 1162 /** 1163 * wlan_peer_mlme_get_auth_state() - peer mlme auth state 1164 * @peer: PEER object 1165 * 1166 * API to get peer auth state 1167 * 1168 * Return: auth state true/false 1169 */ 1170 static inline bool wlan_peer_mlme_get_auth_state( 1171 struct wlan_objmgr_peer *peer) 1172 { 1173 return peer->peer_mlme.is_authenticated; 1174 } 1175 1176 /** 1177 * wlan_peer_mlme_get_next_seq_num() - get peer mlme next sequence number 1178 * @peer: PEER object 1179 * 1180 * API to get mlme peer next sequence number 1181 * 1182 * Caller need to acquire lock with wlan_peer_obj_lock() 1183 * 1184 * Return: peer mlme next sequence number 1185 */ 1186 static inline uint32_t wlan_peer_mlme_get_next_seq_num( 1187 struct wlan_objmgr_peer *peer) 1188 { 1189 /* This API is invoked with lock acquired, do not add log prints */ 1190 if (peer->peer_mlme.seq_num < WLAN_MAX_SEQ_NUM) 1191 peer->peer_mlme.seq_num++; 1192 else 1193 peer->peer_mlme.seq_num = 0; 1194 1195 return peer->peer_mlme.seq_num; 1196 } 1197 1198 /** 1199 * wlan_peer_mlme_get_seq_num() - get peer mlme sequence number 1200 * @peer: PEER object 1201 * 1202 * API to get mlme peer sequence number 1203 * 1204 * Caller need to acquire lock with wlan_peer_obj_lock() 1205 * 1206 * Return: peer mlme sequence number 1207 */ 1208 static inline uint32_t wlan_peer_mlme_get_seq_num( 1209 struct wlan_objmgr_peer *peer) 1210 { 1211 /* This API is invoked with lock acquired, do not add log prints */ 1212 return peer->peer_mlme.seq_num; 1213 } 1214 1215 /** 1216 * wlan_peer_mlme_reset_seq_num() - reset peer mlme sequence number 1217 * @peer: PEER object 1218 * 1219 * API to reset peer sequence number 1220 * 1221 * Caller need to acquire lock with wlan_peer_obj_lock() 1222 * 1223 * Return: void 1224 */ 1225 static inline void wlan_peer_mlme_reset_seq_num( 1226 struct wlan_objmgr_peer *peer) 1227 { 1228 /* This API is invoked with lock acquired, do not add log prints */ 1229 peer->peer_mlme.seq_num = 0; 1230 } 1231 1232 /** 1233 * wlan_peer_get_psoc() - get psoc 1234 * @peer: PEER object 1235 * 1236 * API to get peer's psoc 1237 * 1238 * Return: PSOC object or NULL if the psoc can not be found 1239 */ 1240 static inline struct wlan_objmgr_psoc *wlan_peer_get_psoc( 1241 struct wlan_objmgr_peer *peer) 1242 { 1243 struct wlan_objmgr_vdev *vdev; 1244 struct wlan_objmgr_psoc *psoc; 1245 1246 vdev = wlan_peer_get_vdev(peer); 1247 if (!vdev) 1248 return NULL; 1249 1250 psoc = wlan_vdev_get_psoc(vdev); 1251 1252 return psoc; 1253 } 1254 1255 /** 1256 * wlan_peer_get_psoc_id() - get psoc id 1257 * @peer: PEER object 1258 * 1259 * API to get peer's psoc id 1260 * 1261 * Return: @psoc_id: psoc id 1262 */ 1263 static inline uint8_t wlan_peer_get_psoc_id(struct wlan_objmgr_peer *peer) 1264 { 1265 struct wlan_objmgr_psoc *psoc; 1266 1267 psoc = wlan_peer_get_psoc(peer); 1268 1269 return wlan_psoc_get_id(psoc); 1270 } 1271 1272 /* 1273 * wlan_peer_get_pdev_id() - get pdev id 1274 * @peer: peer object pointer 1275 * 1276 * Return: pdev id 1277 */ 1278 static inline uint8_t wlan_peer_get_pdev_id(struct wlan_objmgr_peer *peer) 1279 { 1280 return peer->pdev_id; 1281 } 1282 1283 /** 1284 * wlan_peer_set_pdev_id() - set pdev id 1285 * @peer: peer object pointer 1286 * @pdev_id: pdev id 1287 * 1288 * Return: void 1289 */ 1290 static inline void wlan_peer_set_pdev_id(struct wlan_objmgr_peer *peer, 1291 uint8_t pdev_id) 1292 { 1293 peer->pdev_id = pdev_id; 1294 } 1295 1296 /** 1297 * wlan_objmgr_print_peer_ref_ids() - print peer object refs 1298 * @peer: peer object pointer 1299 * @log_level: log level 1300 * 1301 * Return: void 1302 */ 1303 void wlan_objmgr_print_peer_ref_ids(struct wlan_objmgr_peer *peer, 1304 QDF_TRACE_LEVEL log_level); 1305 1306 /** 1307 * wlan_objmgr_peer_get_comp_ref_cnt() - get component ref count for a peer 1308 * @peer: peer object pointer 1309 * @id: component id 1310 * 1311 * Return: uint32_t 1312 */ 1313 uint32_t 1314 wlan_objmgr_peer_get_comp_ref_cnt(struct wlan_objmgr_peer *peer, 1315 enum wlan_umac_comp_id id); 1316 1317 /** 1318 * wlan_objmgr_peer_trace_init_lock() - Initialize peer trace lock 1319 * @peer: peer object pointer 1320 * 1321 * Return: void 1322 */ 1323 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1324 static inline void 1325 wlan_objmgr_peer_trace_init_lock(struct wlan_objmgr_peer *peer) 1326 { 1327 wlan_objmgr_trace_init_lock(&peer->peer_objmgr.trace); 1328 } 1329 #else 1330 static inline void 1331 wlan_objmgr_peer_trace_init_lock(struct wlan_objmgr_peer *peer) 1332 { 1333 } 1334 #endif 1335 1336 /** 1337 * wlan_objmgr_peer_trace_deinit_lock() - Deinitialize peer trace lock 1338 * @peer: peer object pointer 1339 * 1340 * Return: void 1341 */ 1342 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1343 static inline void 1344 wlan_objmgr_peer_trace_deinit_lock(struct wlan_objmgr_peer *peer) 1345 { 1346 wlan_objmgr_trace_deinit_lock(&peer->peer_objmgr.trace); 1347 } 1348 #else 1349 static inline void 1350 wlan_objmgr_peer_trace_deinit_lock(struct wlan_objmgr_peer *peer) 1351 { 1352 } 1353 #endif 1354 1355 /** 1356 * wlan_objmgr_peer_trace_del_ref_list() - Delete peer trace reference list 1357 * @peer: peer object pointer 1358 * 1359 * Return: void 1360 */ 1361 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1362 static inline void 1363 wlan_objmgr_peer_trace_del_ref_list(struct wlan_objmgr_peer *peer) 1364 { 1365 wlan_objmgr_trace_del_ref_list(&peer->peer_objmgr.trace); 1366 } 1367 #else 1368 static inline void 1369 wlan_objmgr_peer_trace_del_ref_list(struct wlan_objmgr_peer *peer) 1370 { 1371 } 1372 #endif 1373 1374 #endif /* _WLAN_OBJMGR_PEER_OBJ_H_*/ 1375