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 pSoc data structure of UMAC 20 * Public APIs to perform operations on Global objects 21 */ 22 #ifndef _WLAN_OBJMGR_PSOC_OBJ_H_ 23 #define _WLAN_OBJMGR_PSOC_OBJ_H_ 24 25 #include "wlan_objmgr_cmn.h" 26 #include "wlan_objmgr_debug.h" 27 28 #define REG_DMN_CH144 0x0001 29 #define REG_DMN_ENTREPRISE 0x0002 30 31 32 /* fw_caps */ 33 /* CAPABILITY: WEP available */ 34 #define WLAN_SOC_C_WEP 0x00000001 35 /* CAPABILITY: TKIP available */ 36 #define WLAN_SOC_C_TKIP 0x00000002 37 /* CAPABILITY: AES OCB avail */ 38 #define WLAN_SOC_C_AES 0x00000004 39 /* CAPABILITY: AES CCM avail */ 40 #define WLAN_SOC_C_AES_CCM 0x00000008 41 /* CAPABILITY: 11n HT available */ 42 #define WLAN_SOC_C_HT 0x00000010 43 /* CAPABILITY: CKIP available */ 44 #define WLAN_SOC_C_CKIP 0x00000020 45 /* CAPABILITY: ATH FF avail */ 46 #define WLAN_SOC_C_FF 0x00000040 47 /* CAPABILITY: ATH Turbo avail*/ 48 #define WLAN_SOC_C_TURBOP 0x00000080 49 /* CAPABILITY: IBSS available */ 50 #define WLAN_SOC_C_IBSS 0x00000100 51 /* CAPABILITY: Power mgmt */ 52 #define WLAN_SOC_C_PMGT 0x00000200 53 /* CAPABILITY: HOSTAP avail */ 54 #define WLAN_SOC_C_HOSTAP 0x00000400 55 /* CAPABILITY: Old Adhoc Demo */ 56 #define WLAN_SOC_C_AHDEMO 0x00000800 57 /* CAPABILITY: tx power mgmt */ 58 #define WLAN_SOC_C_TXPMGT 0x00001000 59 /* CAPABILITY: short slottime */ 60 #define WLAN_SOC_C_SHSLOT 0x00002000 61 /* CAPABILITY: short preamble */ 62 #define WLAN_SOC_C_SHPREAMBLE 0x00004000 63 /* CAPABILITY: monitor mode */ 64 #define WLAN_SOC_C_MONITOR 0x00008000 65 /* CAPABILITY: TKIP MIC avail */ 66 #define WLAN_SOC_C_TKIPMIC 0x00010000 67 /* CAPABILITY: ATH WAPI avail */ 68 #define WLAN_SOC_C_WAPI 0x00020000 69 /* CONF: WDS auto Detect/DELBA */ 70 #define WLAN_SOC_C_WDS_AUTODETECT 0x00040000 71 /* CAPABILITY: WPA1 avail */ 72 #define WLAN_SOC_C_WPA1 0x00080000 73 /* CAPABILITY: WPA2 avail */ 74 #define WLAN_SOC_C_WPA2 0x00100000 75 /* CAPABILITY: WPA1+WPA2 avail*/ 76 #define WLAN_SOC_C_WPA 0x00180000 77 /* CAPABILITY: frame bursting */ 78 #define WLAN_SOC_C_BURST 0x00200000 79 /* CAPABILITY: WME avail */ 80 #define WLAN_SOC_C_WME 0x00400000 81 /* CAPABILITY: 4-addr support */ 82 #define WLAN_SOC_C_WDS 0x00800000 83 /* CAPABILITY: TKIP MIC for QoS frame */ 84 #define WLAN_SOC_C_WME_TKIPMIC 0x01000000 85 /* CAPABILITY: bg scanning */ 86 #define WLAN_SOC_C_BGSCAN 0x02000000 87 /* CAPABILITY: UAPSD */ 88 #define WLAN_SOC_C_UAPSD 0x04000000 89 /* CAPABILITY: enabled 11.h */ 90 #define WLAN_SOC_C_DOTH 0x08000000 91 92 /* XXX protection/barker? */ 93 /* CAPABILITY: crypto alg's */ 94 #define WLAN_SOC_C_CRYPTO 0x0000002f 95 96 /* fw_caps_ext */ 97 /* CAPABILITY: fast channel change */ 98 #define WLAN_SOC_CEXT_FASTCC 0x00000001 99 /* CAPABILITY: P2P */ 100 #define WLAN_SOC_CEXT_P2P 0x00000002 101 /* CAPABILITY: Multi-Channel Operations */ 102 #define WLAN_SOC_CEXT_MULTICHAN 0x00000004 103 /* CAPABILITY: the device supports perf and power offload */ 104 #define WLAN_SOC_CEXT_PERF_PWR_OFLD 0x00000008 105 /* CAPABILITY: the device supports 11ac */ 106 #define WLAN_SOC_CEXT_11AC 0x00000010 107 /* CAPABILITY: the device support acs channel hopping */ 108 #define WLAN_SOC_CEXT_ACS_CHAN_HOP 0x00000020 109 /* CAPABILITY: the device support STA DFS */ 110 #define WLAN_SOC_CEXT_STADFS 0x00000040 111 /* NSS offload capability */ 112 #define WLAN_SOC_CEXT_NSS_OFFLOAD 0x00000080 113 /* SW cal support capability */ 114 #define WLAN_SOC_CEXT_SW_CAL 0x00000100 115 /* Hybrid mode */ 116 #define WLAN_SOC_CEXT_HYBRID_MODE 0x00000200 117 /* TT support */ 118 #define WLAN_SOC_CEXT_TT_SUPPORT 0x00000400 119 /* WMI MGMT REF */ 120 #define WLAN_SOC_CEXT_WMI_MGMT_REF 0x00000800 121 /* Wideband scan */ 122 #define WLAN_SOC_CEXT_WIDEBAND_SCAN 0x00001000 123 /* TWT Requester capable */ 124 #define WLAN_SOC_CEXT_TWT_REQUESTER 0x00002000 125 /* TWT Responder capable */ 126 #define WLAN_SOC_CEXT_TWT_RESPONDER 0x00004000 127 /* HW DB2DBM CAPABLE */ 128 #define WLAN_SOC_CEXT_HW_DB2DBM 0x00008000 129 /* OBSS Narrow Bandwidth RU Tolerance */ 130 #define WLAN_SOC_CEXT_OBSS_NBW_RU 0x00010000 131 /* MBSS IE support */ 132 #define WLAN_SOC_CEXT_MBSS_IE 0x00020000 133 /* RXOLE Flow Search Support */ 134 #define WLAN_SOC_CEXT_RX_FSE_SUPPORT 0x00040000 135 /* Dynamic HW Mode Switch Support */ 136 #define WLAN_SOC_CEXT_DYNAMIC_HW_MODE 0x00080000 137 /* Restricted 80+80 MHz support */ 138 #define WLAN_SOC_RESTRICTED_80P80_SUPPORT 0x00100000 139 /* Indicates Firmware supports sending NSS ratio info to host */ 140 #define WLAN_SOC_NSS_RATIO_TO_HOST_SUPPORT 0x00200000 141 /* EMA AP Support */ 142 #define WLAN_SOC_CEXT_EMA_AP 0x00400000 143 /* MBSS PARAM IN START REQ Support */ 144 #define WLAN_SOC_CEXT_MBSS_PARAM_IN_START 0x00800000 145 /* Per channel scan config flags support */ 146 #define WLAN_SOC_CEXT_SCAN_PER_CH_CONFIG 0x01000000 147 /* CAPABILITY: csa offload in case of AP */ 148 #define WLAN_SOC_CEXT_CSA_TX_OFFLOAD 0x02000000 149 /* AP initiator mode supported in staggered beacon mode */ 150 #define WLAN_SOC_RTT_AP_INITIATOR_STAGGERED_MODE_SUPPORTED 0x04000000 151 /* AP initiator mode supported in burst beacon mode */ 152 #define WLAN_SOC_RTT_AP_INITIATOR_BURSTED_MODE_SUPPORTED 0x08000000 153 /* ext cc event supported by fw */ 154 #define WLAN_SOC_EXT_EVENT_SUPPORTED 0x010000000 155 /* check 29th bit for p2p + p2p conc support by fw */ 156 #define WLAN_SOC_EXT_P2P_P2P_CONC_SUPPORT 0x20000000 157 158 /* feature_flags */ 159 /* CONF: ATH FF enabled */ 160 #define WLAN_SOC_F_FF 0x00000001 161 /* CONF: ATH Turbo enabled*/ 162 #define WLAN_SOC_F_TURBOP 0x00000002 163 /* STATUS: promiscuous mode */ 164 #define WLAN_SOC_F_PROMISC 0x00000004 165 /* STATUS: all multicast mode */ 166 #define WLAN_SOC_F_ALLMULTI 0x00000008 167 /* NB: this is intentionally setup to be IEEE80211_CAPINFO_PRIVACY */ 168 /* STATUS: start IBSS */ 169 #define WLAN_SOC_F_SIBSS 0x00000010 170 /* NB: this is intentionally setup to be IEEE80211_CAPINFO_SHORT_SLOTTIME */ 171 /* CONF: Power mgmt enable */ 172 #define WLAN_SOC_F_PMGTON 0x00000020 173 /* CONF: IBSS creation enable */ 174 #define WLAN_SOC_F_IBSSON 0x00000040 175 /* force chanswitch */ 176 #define WLAN_SOC_F_CHANSWITCH 0x00000080 177 178 /* ic_flags_ext and/or iv_flags_ext */ 179 /* CONF: enable country IE */ 180 #define WLAN_SOC_F_COUNTRYIE 0x00000100 181 /* STATE: enable full bgscan completion */ 182 #define WLAN_SOC_F_BGSCAN 0x00000200 183 /* CONF: enable U-APSD */ 184 #define WLAN_SOC_F_UAPSD 0x00000400 185 /* STATUS: sleeping */ 186 #define WLAN_SOC_F_SLEEP 0x00000800 187 /* Enable marking of dfs interfernce */ 188 #define WLAN_SOC_F_MARKDFS 0x00001000 189 /* enable or disable s/w ccmp encrypt decrypt support */ 190 #define WLAN_SOC_F_CCMPSW_ENCDEC 0x00002000 191 /* STATE: hibernating */ 192 #define WLAN_SOC_F_HIBERNATION 0x00004000 193 /* CONF: desired country has been set */ 194 #define WLAN_SOC_F_DESCOUNTRY 0x00008000 195 /* CONF: enable power capability or contraint IE */ 196 #define WLAN_SOC_F_PWRCNSTRIE 0x00010000 197 /* STATUS: 11D in used */ 198 #define WLAN_SOC_F_DOT11D 0x00020000 199 /* Beacon offload */ 200 #define WLAN_SOC_F_BCN_OFFLOAD 0x00040000 201 /* LTEU support */ 202 #define WLAN_SOC_F_LTEU_SUPPORT 0x00100000 203 /* BT coext support */ 204 #define WLAN_SOC_F_BTCOEX_SUPPORT 0x00200000 205 /* HOST 80211 enable*/ 206 #define WLAN_SOC_F_HOST_80211_ENABLE 0x00400000 207 /* Spectral disable from INI */ 208 #define WLAN_SOC_F_SPECTRAL_INI_DISABLE 0x00800000 209 /* FTM testmode enable */ 210 #define WLAN_SOC_F_TESTMODE_ENABLE 0x01000000 211 /* Dynamic HW mode swithch enable */ 212 #define WLAN_SOC_F_DYNAMIC_HW_MODE 0x02000000 213 /* Broadcast TWT support enable */ 214 #define WLAN_SOC_F_BCAST_TWT 0x04000000 215 /* WDS Extended support */ 216 #define WLAN_SOC_F_WDS_EXTENDED 0x08000000 217 /* Peer create response */ 218 #define WLAN_SOC_F_PEER_CREATE_RESP 0x10000000 219 /* Strict channel mode */ 220 #define WLAN_SOC_F_STRICT_CHANNEL 0x20000000 221 222 223 /* PSOC op flags */ 224 225 /* Invalid VHT cap */ 226 #define WLAN_SOC_OP_VHT_INVALID_CAP 0x00000001 227 228 /* enum wlan_nss_ratio - NSS ratio received from FW during service ready ext 229 * event. 230 * WLAN_NSS_RATIO_1BY2_NSS : Max nss of 160MHz is equals to half of the max nss 231 * of 80MHz 232 * WLAN_NSS_RATIO_3BY4_NSS : Max nss of 160MHz is equals to 3/4 of the max nss 233 * of 80MHz 234 * WLAN_NSS_RATIO_1_NSS : Max nss of 160MHz is equals to the max nss of 80MHz 235 * WLAN_NSS_RATIO_2_NSS : Max nss of 160MHz is equals to two times the max 236 * nss of 80MHz 237 * Values of this enum should be in sync with WMI_NSS_RATIO_INFO value provided 238 * in wmi_unified.h. 239 */ 240 enum wlan_nss_ratio { 241 WLAN_NSS_RATIO_1BY2_NSS = 0x0, 242 WLAN_NSS_RATIO_3BY4_NSS = 0x1, 243 WLAN_NSS_RATIO_1_NSS = 0x2, 244 WLAN_NSS_RATIO_2_NSS = 0x3, 245 }; 246 247 /** 248 * struct wlan_objmgr_psoc_regulatory - Regulatory sub structure of PSOC 249 * @country_code: Country code 250 * @reg_dmn: Regulatory Domain 251 * @reg_flags: Regulatory flags 252 */ 253 struct wlan_objmgr_psoc_regulatory { 254 uint16_t country_code; 255 uint16_t reg_dmn; 256 uint16_t reg_flags; 257 }; 258 259 /** 260 * struct wlan_objmgr_psoc_user_config - user configurations to 261 * be used by common modules 262 * @is_11d_support_enabled: Enable/disable 11d feature 263 * @is_11h_support_enabled: Enable/disable 11h feature 264 * @dot11_mode: Phy mode 265 * @skip_dfs_chnl_in_p2p_search: Skip Dfs Channel in case of P2P 266 * Search 267 * @band_capability: Preferred band (0:Both, 1:2G only, 2:5G only) 268 */ 269 struct wlan_objmgr_psoc_user_config { 270 bool is_11d_support_enabled; 271 bool is_11h_support_enabled; 272 uint8_t dot11_mode; 273 uint8_t band_capability; 274 }; 275 276 /** 277 * struct wlan_objmgr_psoc_nif - HDD/OSIF specific sub structure of PSOC 278 * @phy_version: phy version, read in device probe 279 * @phy_type: OL/DA type 280 * @soc_fw_caps: FW capabilities 281 * @soc_fw_ext_caps: FW ext capabilities 282 * @soc_feature_caps:Feature capabilities 283 * @soc_op_flags: Flags to set/reset during operation 284 * @soc_hw_macaddr[]:HW MAC address 285 * @user_config: user config from OS layer 286 */ 287 struct wlan_objmgr_psoc_nif { 288 uint32_t phy_version; 289 WLAN_DEV_TYPE phy_type; 290 uint32_t soc_fw_caps; 291 uint32_t soc_fw_ext_caps; 292 uint32_t soc_feature_caps; 293 uint32_t soc_op_flags; 294 uint8_t soc_hw_macaddr[QDF_MAC_ADDR_SIZE]; 295 struct wlan_objmgr_psoc_user_config user_config; 296 }; 297 298 /** 299 * struct wlan_objmgr_psoc_objmgr - psoc object manager sub structure 300 * @psoc_id: The PSOC's numeric Id 301 * @wlan_pdev_count: PDEV count 302 * @wlan_pdev_id_map: PDEV id map, to allocate free ids 303 * @wlan_vdev_count: VDEV count 304 * @max_vdev_count: Max no. of VDEVs supported by this PSOC 305 * @print_cnt: Count to throttle Logical delete prints 306 * @wlan_peer_count: PEER count 307 * @max_peer_count: Max no. of peers supported by this PSOC 308 * @temp_peer_count: Temporary peer count 309 * @wlan_pdev_list[]: PDEV list 310 * @wlan_vdev_list[]: VDEV list 311 * @wlan_vdev_id_map[]: VDEV id map, to allocate free ids 312 * @peer_list: Peer list 313 * @ref_cnt: Ref count 314 * @ref_id_dbg: Array to track Ref count 315 * @qdf_dev: QDF Device 316 */ 317 struct wlan_objmgr_psoc_objmgr { 318 uint8_t psoc_id; 319 uint8_t wlan_pdev_count; 320 uint8_t wlan_pdev_id_map; 321 uint8_t wlan_vdev_count; 322 uint8_t max_vdev_count; 323 uint8_t print_cnt; 324 uint16_t wlan_peer_count; 325 uint16_t max_peer_count; 326 uint16_t temp_peer_count; 327 struct wlan_objmgr_pdev *wlan_pdev_list[WLAN_UMAC_MAX_PDEVS]; 328 struct wlan_objmgr_vdev *wlan_vdev_list[WLAN_UMAC_PSOC_MAX_VDEVS]; 329 qdf_bitmap(wlan_vdev_id_map, WLAN_UMAC_PSOC_MAX_VDEVS); 330 struct wlan_peer_list peer_list; 331 qdf_atomic_t ref_cnt; 332 qdf_atomic_t ref_id_dbg[WLAN_REF_ID_MAX]; 333 qdf_device_t qdf_dev; 334 }; 335 336 /** 337 * struct wlan_soc_southbound_cb - Southbound callbacks 338 * @tx_ops: contains southbound tx callbacks 339 * @rx_ops: contains southbound rx callbacks 340 */ 341 struct wlan_soc_southbound_cb { 342 struct wlan_lmac_if_tx_ops *tx_ops; 343 struct wlan_lmac_if_rx_ops *rx_ops; 344 }; 345 346 /** 347 * struct wlan_concurrency_info - structure for concurrency info 348 * 349 */ 350 struct wlan_concurrency_info { 351 }; 352 353 /** 354 * struct wlan_soc_timer - structure for soc timer 355 * 356 */ 357 struct wlan_soc_timer { 358 }; 359 360 /** 361 * struct wlan_objmgr_psoc - PSOC common object 362 * @soc_reg: regulatory sub structure 363 * @soc_nif: nif sub strucutre 364 * @soc_objmgr: object manager sub structure 365 * @soc_cb: south bound callbacks 366 * @soc_timer: soc timer for inactivity 367 * @soc_concurrency: concurrency info 368 * @soc_comp_priv_obj[]: component private object pointers 369 * @obj_status[]: component object status 370 * @obj_state: object state 371 * @tgt_if_handle: target interface handle 372 * @dp_handle: DP module handle 373 * @psoc_lock: psoc lock 374 */ 375 struct wlan_objmgr_psoc { 376 struct wlan_objmgr_psoc_regulatory soc_reg; 377 struct wlan_objmgr_psoc_nif soc_nif; 378 struct wlan_objmgr_psoc_objmgr soc_objmgr; 379 struct wlan_soc_southbound_cb soc_cb; 380 struct wlan_soc_timer soc_timer; 381 struct wlan_concurrency_info soc_concurrency; /*TODO */ 382 void *soc_comp_priv_obj[WLAN_UMAC_MAX_COMPONENTS]; 383 QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS]; 384 WLAN_OBJ_STATE obj_state; 385 struct target_psoc_info *tgt_if_handle; 386 void *dp_handle; 387 qdf_spinlock_t psoc_lock; 388 }; 389 390 /** 391 * struct wlan_psoc_host_hal_reg_capabilities_ext: Below are Reg caps per PHY. 392 * Please note PHY ID starts with 0. 393 * @phy_id: phy id starts with 0. 394 * @eeprom_reg_domain: regdomain value specified in EEPROM 395 * @eeprom_reg_domain_ext: regdomain 396 * @regcap1: CAP1 capabilities bit map, see REGDMN_CAP1_ defines 397 * @regcap2: REGDMN EEPROM CAP, see REGDMN_EEPROM_EEREGCAP_ defines 398 * @wireless_modes: REGDMN MODE, see REGDMN_MODE_ enum 399 * @low_2ghz_chan: 2G channel low 400 * @high_2ghz_chan: 2G channel High 401 * @low_5ghz_chan: 5G channel low 402 * @high_5ghz_chan: 5G channel High 403 */ 404 struct wlan_psoc_host_hal_reg_capabilities_ext { 405 uint32_t phy_id; 406 uint32_t eeprom_reg_domain; 407 uint32_t eeprom_reg_domain_ext; 408 uint32_t regcap1; 409 uint32_t regcap2; 410 uint64_t wireless_modes; 411 uint32_t low_2ghz_chan; 412 uint32_t high_2ghz_chan; 413 uint32_t low_5ghz_chan; 414 uint32_t high_5ghz_chan; 415 }; 416 417 /** 418 * struct wlan_psoc_host_hal_reg_capabilities_ext2 - HAL reg capabilities 419 * from service ready ext2 event. 420 * @phy_id: phy id starts with 0 421 * @wireless_modes_ext: REGDMN MODE, see REGDMN_MODE_ enum 422 */ 423 struct wlan_psoc_host_hal_reg_capabilities_ext2 { 424 uint32_t phy_id; 425 uint64_t wireless_modes_ext; 426 }; 427 428 /** 429 ** APIs to Create/Delete Global object APIs 430 */ 431 /** 432 * wlan_objmgr_psoc_obj_create() - psoc object create 433 * @phy_version: device id (from probe) 434 * @dev_type: Offload/DA 435 * 436 * Creates PSOC object, intializes with default values 437 * Invokes the registered notifiers to create component object 438 * 439 * Return: Handle to struct wlan_objmgr_psoc on successful creation, 440 * NULL on Failure (on Mem alloc failure and Component objects 441 * Failure) 442 */ 443 struct wlan_objmgr_psoc *wlan_objmgr_psoc_obj_create(uint32_t phy_version, 444 WLAN_DEV_TYPE dev_type); 445 446 /** 447 * wlan_objmgr_psoc_obj_delete() - psoc object delete 448 * @psoc: PSOC object 449 * 450 * Logically deletes PSOC object, 451 * Once all the references are released, object manager invokes the registered 452 * notifiers to destroy component objects 453 * 454 * Return: SUCCESS/FAILURE 455 */ 456 QDF_STATUS wlan_objmgr_psoc_obj_delete(struct wlan_objmgr_psoc *psoc); 457 458 /** 459 ** APIs to attach/detach component objects 460 */ 461 462 /** 463 * wlan_objmgr_psoc_component_obj_attach() - psoc comp object attach 464 * @psoc: PSOC object 465 * @id: Component id 466 * @comp_priv_obj: component's private object pointer 467 * @status: Component's private object creation status 468 * 469 * API to be used for attaching component object with PSOC common object 470 * 471 * Return: SUCCESS on successful storing of component's object in common object 472 * On FAILURE (appropriate failure codes are returned) 473 */ 474 QDF_STATUS wlan_objmgr_psoc_component_obj_attach( 475 struct wlan_objmgr_psoc *psoc, 476 enum wlan_umac_comp_id id, 477 void *comp_priv_obj, 478 QDF_STATUS status); 479 480 /** 481 * wlan_objmgr_psoc_component_obj_detach() - psoc comp object detach 482 * @psoc: PSOC object 483 * @id: Component id 484 * @comp_priv_obj: component's private object pointer 485 * 486 * API to be used for detaching component object with PSOC common object 487 * 488 * Return: SUCCESS on successful removal of component's object from common 489 * object 490 * On FAILURE (appropriate failure codes are returned) 491 */ 492 QDF_STATUS wlan_objmgr_psoc_component_obj_detach( 493 struct wlan_objmgr_psoc *psoc, 494 enum wlan_umac_comp_id id, 495 void *comp_priv_obj); 496 497 /** 498 ** APIs to operations on psoc objects 499 */ 500 typedef void (*wlan_objmgr_op_handler)(struct wlan_objmgr_psoc *psoc, 501 void *object, 502 void *arg); 503 504 /** 505 * wlan_objmgr_iterate_obj_list() - iterate through all psoc objects 506 * (CREATED state) 507 * @psoc: PSOC object 508 * @obj_type: PDEV_OP/VDEV_OP/PEER_OP 509 * @handler: the handler will be called for each object of requested type 510 * the handler should be implemented to perform required operation 511 * @arg: agruments passed by caller 512 * @lock_free_op: its obsolete 513 * @dbg_id: id of the caller 514 * 515 * API to be used for performing the operations on all PDEV/VDEV/PEER objects 516 * of psoc 517 * 518 * Return: SUCCESS/FAILURE 519 */ 520 QDF_STATUS wlan_objmgr_iterate_obj_list( 521 struct wlan_objmgr_psoc *psoc, 522 enum wlan_objmgr_obj_type obj_type, 523 wlan_objmgr_op_handler handler, 524 void *arg, uint8_t lock_free_op, 525 wlan_objmgr_ref_dbgid dbg_id); 526 527 /** 528 * wlan_objmgr_iterate_obj_list_all() - iterate through all psoc objects 529 * @psoc: PSOC object 530 * @obj_type: PDEV_OP/VDEV_OP/PEER_OP 531 * @handler: the handler will be called for each object of requested type 532 * the handler should be implemented to perform required operation 533 * @arg: agruments passed by caller 534 * @lock_free_op: its obsolete 535 * @dbg_id: id of the caller 536 * 537 * API to be used for performing the operations on all PDEV/VDEV/PEER objects 538 * of psoc 539 * 540 * Return: SUCCESS/FAILURE 541 */ 542 QDF_STATUS wlan_objmgr_iterate_obj_list_all( 543 struct wlan_objmgr_psoc *psoc, 544 enum wlan_objmgr_obj_type obj_type, 545 wlan_objmgr_op_handler handler, 546 void *arg, uint8_t lock_free_op, 547 wlan_objmgr_ref_dbgid dbg_id); 548 549 /** 550 * wlan_objmgr_free_all_objects_per_psoc() - free all psoc objects 551 * @psoc: PSOC object 552 * 553 * API to be used free all the objects(pdev/vdev/peer) of psoc 554 * 555 * Return: SUCCESS/FAILURE 556 */ 557 QDF_STATUS wlan_objmgr_free_all_objects_per_psoc( 558 struct wlan_objmgr_psoc *psoc); 559 560 /** 561 * wlan_objmgr_trigger_psoc_comp_priv_object_creation() - create 562 * psoc comp object 563 * @psoc: PSOC object 564 * @id: Component id 565 * 566 * API to create component private object in run time, this would 567 * be used for features which gets enabled in run time 568 * 569 * Return: SUCCESS on successful creation 570 * On FAILURE (appropriate failure codes are returned) 571 */ 572 QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_creation( 573 struct wlan_objmgr_psoc *psoc, 574 enum wlan_umac_comp_id id); 575 576 /** 577 * wlan_objmgr_trigger_psoc_comp_priv_object_deletion() - destroy 578 * psoc comp object 579 * @psoc: PSOC object 580 * @id: Component id 581 * 582 * API to destroy component private object in run time, this would 583 * be used for features which gets disabled in run time 584 * 585 * Return: SUCCESS on successful deletion 586 * On FAILURE (appropriate failure codes are returned) 587 */ 588 QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_deletion( 589 struct wlan_objmgr_psoc *psoc, 590 enum wlan_umac_comp_id id); 591 592 /** 593 * wlan_objmgr_get_peer_by_mac() - find peer from psoc's peer list 594 * @psoc: PSOC object 595 * @macaddr: MAC address 596 * @dbg_id: id of the caller 597 * 598 * API to find peer object pointer by MAC addr 599 * 600 * This API increments the ref count of the peer object internally, the 601 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 602 * ref count 603 * 604 * Return: peer pointer 605 * NULL on FAILURE 606 */ 607 #ifdef WLAN_OBJMGR_REF_ID_TRACE 608 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_debug( 609 struct wlan_objmgr_psoc *psoc, uint8_t *macaddr, 610 wlan_objmgr_ref_dbgid dbg_id, const char *func, int line); 611 612 #define wlan_objmgr_get_peer_by_mac(psoc, macaddr, dbgid) \ 613 wlan_objmgr_get_peer_by_mac_debug(psoc, macaddr, dbgid, \ 614 __func__, __LINE__) 615 #else 616 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac( 617 struct wlan_objmgr_psoc *psoc, uint8_t *macaddr, 618 wlan_objmgr_ref_dbgid dbg_id); 619 #endif 620 621 /** 622 * wlan_objmgr_get_peer() - find peer from psoc's peer list 623 * @psoc: PSOC object 624 * @pdev_id: Pdev id 625 * @macaddr: MAC address 626 * @dbg_id: id of the caller 627 * 628 * API to find peer object pointer by MAC addr and pdev id 629 * 630 * This API increments the ref count of the peer object internally, the 631 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 632 * ref count 633 * 634 * Return: peer pointer 635 * NULL on FAILURE 636 */ 637 #ifdef WLAN_OBJMGR_REF_ID_TRACE 638 struct wlan_objmgr_peer *wlan_objmgr_get_peer_debug( 639 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 640 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id, 641 const char *func, int line); 642 643 #define wlan_objmgr_get_peer(psoc, pdev_id, macaddr, dbgid) \ 644 wlan_objmgr_get_peer_debug(psoc, pdev_id, macaddr, dbgid, \ 645 __func__, __LINE__) 646 #else 647 struct wlan_objmgr_peer *wlan_objmgr_get_peer( 648 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 649 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id); 650 #endif 651 652 /** 653 * wlan_objmgr_get_peer_nolock() - find peer from psoc's peer list (lock free) 654 * @psoc: PSOC object 655 * @pdev_id: Pdev id 656 * @macaddr: MAC address 657 * @dbg_id: id of the caller 658 * 659 * API to find peer object pointer by MAC addr 660 * 661 * This API increments the ref count of the peer object internally, the 662 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 663 * ref count 664 * 665 * Return: peer pointer 666 * NULL on FAILURE 667 */ 668 #ifdef WLAN_OBJMGR_REF_ID_TRACE 669 struct wlan_objmgr_peer *wlan_objmgr_get_peer_nolock_debug( 670 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 671 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id, 672 const char *func, int line); 673 674 #define wlan_objmgr_get_peer_nolock(psoc, pdev_id, macaddr, dbgid) \ 675 wlan_objmgr_get_peer_nolock_debug(psoc, pdev_id, macaddr, \ 676 dbgid, __func__, __LINE__) 677 #else 678 struct wlan_objmgr_peer *wlan_objmgr_get_peer_nolock( 679 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 680 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id); 681 #endif 682 683 /** 684 * wlan_objmgr_get_peer_logically_deleted() - find peer 685 * from psoc's peer list 686 * @psoc: PSOC object 687 * @macaddr: MAC address 688 * @dbg_id: id of the caller 689 * 690 * API to find peer object pointer of logically deleted peer 691 * 692 * This API increments the ref count of the peer object internally, the 693 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 694 * ref count 695 * 696 * Return: peer pointer 697 * NULL on FAILURE 698 */ 699 #ifdef WLAN_OBJMGR_REF_ID_TRACE 700 struct wlan_objmgr_peer *wlan_objmgr_get_peer_logically_deleted_debug( 701 struct wlan_objmgr_psoc *psoc, uint8_t *macaddr, 702 wlan_objmgr_ref_dbgid dbg_id, 703 const char *func, int line); 704 705 #define wlan_objmgr_get_peer_logically_deleted(psoc, macaddr, dbgid) \ 706 wlan_objmgr_get_peer_logically_deleted_debug(psoc, macaddr, \ 707 dbgid, __func__, __LINE__) 708 #else 709 struct wlan_objmgr_peer *wlan_objmgr_get_peer_logically_deleted( 710 struct wlan_objmgr_psoc *psoc, uint8_t *macaddr, 711 wlan_objmgr_ref_dbgid dbg_id); 712 #endif 713 714 /** 715 * wlan_objmgr_get_peer_no_state() - find peer from psoc's peer list 716 * @psoc: PSOC object 717 * @pdev_id: Pdev id 718 * @macaddr: MAC address 719 * @dbg_id: id of the caller 720 * 721 * API to find peer object pointer by MAC addr and pdev id, 722 * ignores the state check 723 * 724 * This API increments the ref count of the peer object internally, the 725 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 726 * ref count 727 * 728 * Return: peer pointer 729 * NULL on FAILURE 730 */ 731 #ifdef WLAN_OBJMGR_REF_ID_TRACE 732 struct wlan_objmgr_peer *wlan_objmgr_get_peer_no_state_debug( 733 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 734 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id, 735 const char *func, int line); 736 737 #define wlan_objmgr_get_peer_no_state(psoc, pdev_id, macaddr, dbgid) \ 738 wlan_objmgr_get_peer_no_state_debug(psoc, pdev_id, macaddr, \ 739 dbgid, __func__, __LINE__) 740 #else 741 struct wlan_objmgr_peer *wlan_objmgr_get_peer_no_state( 742 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 743 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id); 744 #endif 745 746 /** 747 * wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev() - get peer from 748 * psoc peer list using 749 * mac and vdev 750 * self mac 751 * @psoc: PSOC object 752 * @pdev_id: Pdev id 753 * @bssid: BSSID address 754 * @macaddr: MAC address 755 * @dbg_id: id of the caller 756 * 757 * API to find peer object pointer by MAC addr, vdev self mac 758 * address and pdev id for a node that is logically in deleted state 759 * 760 * This API increments the ref count of the peer object internally, the 761 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 762 * ref count 763 * 764 * Return: List of peer pointers 765 * NULL on FAILURE 766 */ 767 #ifdef WLAN_OBJMGR_REF_ID_TRACE 768 qdf_list_t *wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev_debug( 769 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 770 uint8_t *bssid, uint8_t *macaddr, 771 wlan_objmgr_ref_dbgid dbg_id, 772 const char *func, int line); 773 774 #define wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev( \ 775 psoc, pdev_id, bssid, macaddr, dbgid) \ 776 wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev_debug( \ 777 psoc, pdev_id, bssid, macaddr, dbgid, __func__, __LINE__) 778 #else 779 qdf_list_t *wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev( 780 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 781 uint8_t *bssid, uint8_t *macaddr, 782 wlan_objmgr_ref_dbgid dbg_id); 783 #endif 784 785 /** 786 * wlan_objmgr_get_peer_by_mac_n_vdev() - find peer from psoc's peer list 787 * using mac address and bssid 788 * @psoc: PSOC object 789 * @pdev_id: Pdev id 790 * @bssid: MAC address of AP its associated 791 * @macaddr: MAC address 792 * @dbg_id: id of the caller 793 * 794 * API to find peer object pointer by MAC addr and vdev self mac address 795 * and pdev id 796 * 797 * This API increments the ref count of the peer object internally, the 798 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 799 * ref count 800 * 801 * Return: peer pointer 802 * NULL on FAILURE 803 */ 804 #ifdef WLAN_OBJMGR_REF_ID_TRACE 805 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev_debug( 806 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 807 uint8_t *bssid, uint8_t *macaddr, 808 wlan_objmgr_ref_dbgid dbg_id, 809 const char *func, int line); 810 811 #define wlan_objmgr_get_peer_by_mac_n_vdev(psoc, pdevid, bssid, macaddr, \ 812 dbgid) \ 813 wlan_objmgr_get_peer_by_mac_n_vdev_debug(psoc, pdevid, \ 814 bssid, macaddr, dbgid, __func__, __LINE__) 815 #else 816 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev( 817 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 818 uint8_t *bssid, uint8_t *macaddr, 819 wlan_objmgr_ref_dbgid dbg_id); 820 #endif 821 822 /** 823 * wlan_objmgr_get_peer_by_mac_n_vdev_no_state() - find peer from psoc's peer 824 * list using mac address and bssid 825 * @psoc: PSOC object 826 * @pdev_id: Pdev id 827 * @bssid: MAC address of AP its associated 828 * @macaddr: MAC address 829 * @dbg_id: id of the caller 830 * 831 * API to find peer object pointer by MAC addr, vdev self mac address, 832 * and pdev id ,ignores the state 833 * 834 * This API increments the ref count of the peer object internally, the 835 * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement 836 * ref count 837 * 838 * Return: peer pointer 839 * NULL on FAILURE 840 */ 841 #ifdef WLAN_OBJMGR_REF_ID_TRACE 842 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev_no_state_debug( 843 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 844 uint8_t *bssid, uint8_t *macaddr, 845 wlan_objmgr_ref_dbgid dbg_id, 846 const char *func, int line); 847 848 #define wlan_objmgr_get_peer_by_mac_n_vdev_no_state(psoc, pdevid, bssid, \ 849 macaddr, dbgid) \ 850 wlan_objmgr_get_peer_by_mac_n_vdev_no_state_debug(psoc, \ 851 pdevid, bssid, macaddr, dbgid, __func__, __LINE__) 852 #else 853 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev_no_state( 854 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 855 uint8_t *bssid, uint8_t *macaddr, 856 wlan_objmgr_ref_dbgid dbg_id); 857 #endif 858 859 /** 860 * wlan_objmgr_get_pdev_by_id() - retrieve pdev by id 861 * @psoc: PSOC object 862 * @id: pdev id 863 * @dbg_id: id of the caller 864 * 865 * API to find pdev object pointer by pdev id 866 * 867 * This API increments the ref count of the pdev object internally, the 868 * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement 869 * ref count 870 * 871 * Return: pdev pointer 872 * NULL on FAILURE 873 */ 874 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_id( 875 struct wlan_objmgr_psoc *psoc, uint8_t id, 876 wlan_objmgr_ref_dbgid dbg_id); 877 878 /** 879 * wlan_objmgr_get_pdev_by_id_no_state() - retrieve pdev by id 880 * @psoc: PSOC object 881 * @id: pdev id 882 * @dbg_id: id of the caller 883 * 884 * API to find pdev object pointer by pdev id, Ignores the state check 885 * 886 * This API increments the ref count of the pdev object internally, the 887 * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement 888 * ref count 889 * 890 * Return: pdev pointer 891 * NULL on FAILURE 892 */ 893 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_id_no_state( 894 struct wlan_objmgr_psoc *psoc, uint8_t id, 895 wlan_objmgr_ref_dbgid dbg_id); 896 897 /** 898 * wlan_objmgr_get_pdev_by_macaddr() - retrieve pdev by macaddr 899 * @psoc: PSOC object 900 * @macaddr: MAC address 901 * @dbg_id: id of the caller 902 * 903 * API to find pdev object pointer by pdev macaddr 904 * 905 * This API increments the ref count of the pdev object internally, the 906 * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement 907 * ref count 908 * 909 * Return: pdev pointer 910 * NULL on FAILURE 911 */ 912 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_macaddr( 913 struct wlan_objmgr_psoc *psoc, uint8_t *macaddr, 914 wlan_objmgr_ref_dbgid dbg_id); 915 916 /** 917 * wlan_objmgr_get_pdev_by_macaddr_no_state() - retrieve pdev by macaddr 918 * @psoc: PSOC object 919 * @macaddr: MAC address 920 * @dbg_id: id of the caller 921 * 922 * API to find pdev object pointer by pdev macaddr, ignores the state check 923 * 924 * This API increments the ref count of the pdev object internally, the 925 * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement 926 * ref count 927 * 928 * Return: pdev pointer 929 * NULL on FAILURE 930 */ 931 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_macaddr_no_state( 932 struct wlan_objmgr_psoc *psoc, uint8_t *macaddr, 933 wlan_objmgr_ref_dbgid dbg_id); 934 935 /** 936 * wlan_objmgr_get_vdev_by_opmode_from_psoc() - retrieve vdev by opmode 937 * @psoc: PSOC object 938 * @opmode: vdev operating mode 939 * @dbg_id: id of the caller 940 * 941 * API to find vdev object pointer by vdev operating mode from psoc 942 * 943 * This API increments the ref count of the vdev object internally, the 944 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement 945 * ref count 946 * 947 * Return: vdev pointer 948 * NULL on FAILURE 949 */ 950 #ifdef WLAN_OBJMGR_REF_ID_TRACE 951 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_opmode_from_psoc_debug( 952 struct wlan_objmgr_psoc *psoc, 953 enum QDF_OPMODE opmode, 954 wlan_objmgr_ref_dbgid dbg_id, 955 const char *func, int line); 956 957 #define wlan_objmgr_get_vdev_by_opmode_from_psoc(psoc, opmode, dbgid) \ 958 wlan_objmgr_get_vdev_by_opmode_from_psoc_debug(psoc, opmode, \ 959 dbgid, __func__, __LINE__) 960 #else 961 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_opmode_from_psoc( 962 struct wlan_objmgr_psoc *psoc, 963 enum QDF_OPMODE opmode, 964 wlan_objmgr_ref_dbgid dbg_id); 965 #endif 966 967 /** 968 * wlan_objmgr_get_vdev_by_id_from_psoc() - retrieve vdev by id 969 * @psoc: PSOC object 970 * @id: vdev id 971 * @dbg_id: id of the caller 972 * 973 * API to find vdev object pointer by vdev id from psoc 974 * 975 * This API increments the ref count of the vdev object internally, the 976 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement 977 * ref count 978 * 979 * Return: vdev pointer 980 * NULL on FAILURE 981 */ 982 #ifdef WLAN_OBJMGR_REF_ID_TRACE 983 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_debug( 984 struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 985 wlan_objmgr_ref_dbgid dbg_id, 986 const char *func, int line); 987 988 #define wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, dbgid) \ 989 wlan_objmgr_get_vdev_by_id_from_psoc_debug(psoc, vdev_id, \ 990 dbgid, __func__, __LINE__) 991 #else 992 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc( 993 struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 994 wlan_objmgr_ref_dbgid dbg_id); 995 #endif 996 997 /** 998 * wlan_objmgr_get_vdev_by_id_from_psoc_no_state() - retrieve vdev by id 999 * @psoc: PSOC object 1000 * @id: vdev id 1001 * @dbg_id: id of the caller 1002 * 1003 * API to find vdev object pointer by vdev id from psoc, ignores the 1004 * state check 1005 * 1006 * This API increments the ref count of the vdev object internally, the 1007 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement 1008 * ref count 1009 * 1010 * Return: vdev pointer 1011 * NULL on FAILURE 1012 */ 1013 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1014 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_no_state_debug( 1015 struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1016 wlan_objmgr_ref_dbgid dbg_id, 1017 const char *func, int line); 1018 1019 #define wlan_objmgr_get_vdev_by_id_from_psoc_no_state(psoc, vdev_id, dbgid) \ 1020 wlan_objmgr_get_vdev_by_id_from_psoc_no_state_debug(psoc, \ 1021 vdev_id, dbgid, __func__, __LINE__) 1022 #else 1023 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_no_state( 1024 struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1025 wlan_objmgr_ref_dbgid dbg_id); 1026 #endif 1027 1028 /** 1029 * wlan_objmgr_get_vdev_by_id_from_psoc_not_log_del() - retrieve vdev by id 1030 * @psoc: PSOC object 1031 * @id: vdev id 1032 * @dbg_id: id of the caller 1033 * 1034 * API to find vdev object pointer by vdev id from psoc, ignores the 1035 * state check 1036 * 1037 * This API increments the ref count of the vdev object internally, the 1038 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement 1039 * ref count 1040 * 1041 * Return: vdev pointer 1042 * NULL on FAILURE 1043 */ 1044 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1045 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_not_log_del_debug( 1046 struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1047 wlan_objmgr_ref_dbgid dbg_id, 1048 const char *func, int line); 1049 1050 #define wlan_objmgr_get_vdev_by_id_from_psoc_not_log_del(psoc, vdev_id, dbgid) \ 1051 wlan_objmgr_get_vdev_by_id_from_psoc_not_log_del_debug(psoc, \ 1052 vdev_id, dbgid, __func__, __LINE__) 1053 #else 1054 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_not_log_del( 1055 struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, 1056 wlan_objmgr_ref_dbgid dbg_id); 1057 #endif 1058 1059 /** 1060 * wlan_objmgr_get_vdev_by_macaddr_from_psoc() - retrieve vdev by macaddr 1061 * @psoc: PSOC object 1062 * @pdev_id: Pdev id 1063 * @macaddr: macaddr 1064 * @dbg_id: id of the caller 1065 * 1066 * API to find vdev object pointer by vdev macaddr from pdev 1067 * 1068 * This API increments the ref count of the vdev object internally, the 1069 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement 1070 * ref count 1071 * 1072 * Return: vdev pointer 1073 * NULL on FAILURE 1074 */ 1075 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1076 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc_debug( 1077 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 1078 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id, 1079 const char *func, int line); 1080 1081 #define wlan_objmgr_get_vdev_by_macaddr_from_psoc(psoc, pdev_id, macaddr, \ 1082 dbgid) \ 1083 wlan_objmgr_get_vdev_by_macaddr_from_psoc_debug(psoc, pdev_id, \ 1084 macaddr, dbgid, __func__, __LINE__) 1085 #else 1086 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc( 1087 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 1088 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id); 1089 #endif 1090 1091 /** 1092 * wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state() - retrieve vdev by 1093 * macaddr 1094 * @psoc: PSOC object 1095 * @pdev_id: Pdev id 1096 * @macaddr: macaddr 1097 * @dbg_id: id of the caller 1098 * 1099 * API to find vdev object pointer by vdev macaddr from psoc, ignores the state 1100 * check 1101 * 1102 * This API increments the ref count of the vdev object internally, the 1103 * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement 1104 * ref count 1105 * 1106 * Return: vdev pointer 1107 * NULL on FAILURE 1108 */ 1109 #ifdef WLAN_OBJMGR_REF_ID_TRACE 1110 struct wlan_objmgr_vdev 1111 *wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state_debug( 1112 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 1113 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id, 1114 const char *func, int line); 1115 1116 #define wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state(psoc, pdev_id, \ 1117 macaddr, dbgid) \ 1118 wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state_debug(psoc, \ 1119 pdev_id, macaddr, dbgid, __func__, __LINE__) 1120 #else 1121 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state( 1122 struct wlan_objmgr_psoc *psoc, uint8_t pdev_id, 1123 uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id); 1124 #endif 1125 1126 /** 1127 * wlan_psoc_obj_lock() - Acquire PSOC spinlock 1128 * @psoc: PSOC object 1129 * 1130 * API to acquire PSOC lock 1131 * Parent lock should not be taken in child lock context 1132 * but child lock can be taken in parent lock context 1133 * (for ex: psoc lock can't be invoked in pdev/vdev/peer lock context) 1134 * 1135 * Return: void 1136 */ 1137 static inline void wlan_psoc_obj_lock(struct wlan_objmgr_psoc *psoc) 1138 { 1139 qdf_spin_lock_bh(&psoc->psoc_lock); 1140 } 1141 1142 /** 1143 * wlan_psoc_obj_unlock() - Release PSOC spinlock 1144 * @psoc: PSOC object 1145 * 1146 * API to Release PSOC lock 1147 * 1148 * Return: void 1149 */ 1150 static inline void wlan_psoc_obj_unlock(struct wlan_objmgr_psoc *psoc) 1151 { 1152 qdf_spin_unlock_bh(&psoc->psoc_lock); 1153 } 1154 1155 /** 1156 * wlan_psoc_set_nif_phy_version() - set nif phy version 1157 * @psoc: PSOC object 1158 * @phy_ver: phy version 1159 * 1160 * API to set nif phy version in psoc 1161 * 1162 * Return: void 1163 */ 1164 static inline void wlan_psoc_set_nif_phy_version(struct wlan_objmgr_psoc *psoc, 1165 uint32_t phy_ver) 1166 { 1167 psoc->soc_nif.phy_version = phy_ver; 1168 } 1169 1170 /** 1171 * wlan_psoc_get_nif_phy_version() - get nif phy version 1172 * @psoc: PSOC object 1173 * 1174 * API to set nif phy version in psoc 1175 * 1176 * Return: @phy_ver: phy version 1177 */ 1178 static inline uint32_t wlan_psoc_get_nif_phy_version( 1179 struct wlan_objmgr_psoc *psoc) 1180 { 1181 if (!psoc) 1182 return (uint32_t)-1; 1183 1184 return psoc->soc_nif.phy_version; 1185 } 1186 1187 /** 1188 * wlan_psoc_set_dev_type() - set dev type 1189 * @psoc: PSOC object 1190 * @phy_type: phy type (OL/DA) 1191 * 1192 * API to set dev type in psoc 1193 * 1194 * Return: void 1195 */ 1196 static inline void wlan_psoc_set_dev_type(struct wlan_objmgr_psoc *psoc, 1197 WLAN_DEV_TYPE phy_type) 1198 { 1199 psoc->soc_nif.phy_type = phy_type; 1200 } 1201 1202 /** 1203 * wlan_objmgr_psoc_get_dev_type - get dev type 1204 * @psoc: PSOC object 1205 * 1206 * API to get dev type in psoc 1207 * 1208 * Return: phy type (OL/DA) 1209 */ 1210 static inline WLAN_DEV_TYPE wlan_objmgr_psoc_get_dev_type( 1211 struct wlan_objmgr_psoc *psoc) 1212 { 1213 if (!psoc) 1214 return (uint32_t)-1; 1215 1216 return psoc->soc_nif.phy_type; 1217 } 1218 1219 /** 1220 * wlan_psoc_nif_fw_cap_set() - set fw caps 1221 * @psoc: PSOC object 1222 * @cap: capability flag to be set 1223 * 1224 * API to set fw caps in psoc 1225 * 1226 * Return: void 1227 */ 1228 static inline void wlan_psoc_nif_fw_cap_set(struct wlan_objmgr_psoc *psoc, 1229 uint32_t cap) 1230 { 1231 psoc->soc_nif.soc_fw_caps |= cap; 1232 } 1233 1234 /** 1235 * wlan_psoc_nif_fw_cap_clear() - clear fw caps 1236 * @psoc: PSOC object 1237 * @cap: capability flag to be cleared 1238 * 1239 * API to clear fw caps in psoc 1240 * 1241 * Return: void 1242 */ 1243 static inline void wlan_psoc_nif_fw_cap_clear(struct wlan_objmgr_psoc *psoc, 1244 uint32_t cap) 1245 { 1246 psoc->soc_nif.soc_fw_caps &= ~cap; 1247 } 1248 1249 /** 1250 * wlan_psoc_nif_fw_cap_get() - get fw caps 1251 * @psoc: PSOC object 1252 * @cap: capability flag to be checked 1253 * 1254 * API to know, whether particular fw caps flag is set in psoc 1255 * 1256 * Return: 1 (for set) or 0 (for not set) 1257 */ 1258 static inline uint8_t wlan_psoc_nif_fw_cap_get(struct wlan_objmgr_psoc *psoc, 1259 uint32_t cap) 1260 { 1261 return (psoc->soc_nif.soc_fw_caps & cap) ? 1 : 0; 1262 } 1263 1264 /** 1265 * wlan_psoc_nif_fw_ext_cap_set() - set fw ext caps 1266 * @psoc: PSOC object 1267 * @ext_cap: capability flag to be set 1268 * 1269 * API to set fw ext caps in psoc 1270 * 1271 * Return: void 1272 */ 1273 static inline void wlan_psoc_nif_fw_ext_cap_set(struct wlan_objmgr_psoc *psoc, 1274 uint32_t ext_cap) 1275 { 1276 psoc->soc_nif.soc_fw_ext_caps |= ext_cap; 1277 } 1278 1279 /** 1280 * wlan_psoc_nif_fw_ext_cap_clear() - clear fw ext caps 1281 * @psoc: PSOC object 1282 * @ext_cap: capability flag to be cleared 1283 * 1284 * API to clear fw ext caps in psoc 1285 * 1286 * Return: void 1287 */ 1288 static inline void wlan_psoc_nif_fw_ext_cap_clear(struct wlan_objmgr_psoc *psoc, 1289 uint32_t ext_cap) 1290 { 1291 psoc->soc_nif.soc_fw_ext_caps &= ~ext_cap; 1292 } 1293 1294 /** 1295 * wlan_psoc_nif_fw_ext_cap_get() - get fw caps 1296 * @psoc: PSOC object 1297 * @ext_cap: capability flag to be checked 1298 * 1299 * API to know, whether particular fw caps flag is set in psoc 1300 * 1301 * Return: 1 (for set) or 0 (for not set) 1302 */ 1303 static inline uint8_t wlan_psoc_nif_fw_ext_cap_get( 1304 struct wlan_objmgr_psoc *psoc, uint32_t ext_cap) 1305 { 1306 return (psoc->soc_nif.soc_fw_ext_caps & ext_cap) ? 1 : 0; 1307 } 1308 1309 /** 1310 * wlan_psoc_nif_feat_cap_set() - set feature caps 1311 * @psoc: PSOC object 1312 * @cap: feature flag to be set 1313 * 1314 * API to set feature caps in psoc 1315 * 1316 * Return: void 1317 */ 1318 static inline void wlan_psoc_nif_feat_cap_set(struct wlan_objmgr_psoc *psoc, 1319 uint32_t feat_cap) 1320 { 1321 psoc->soc_nif.soc_feature_caps |= feat_cap; 1322 } 1323 1324 /** 1325 * wlan_psoc_nif_feat_cap_clear() - clear feature caps 1326 * @psoc: PSOC object 1327 * @cap: feature flag to be cleared 1328 * 1329 * API to clear feature caps in psoc 1330 * 1331 * Return: void 1332 */ 1333 static inline void wlan_psoc_nif_feat_cap_clear(struct wlan_objmgr_psoc *psoc, 1334 uint32_t feat_cap) 1335 { 1336 psoc->soc_nif.soc_feature_caps &= ~feat_cap; 1337 } 1338 1339 /** 1340 * wlan_psoc_nif_feat_cap_get() - get feature caps 1341 * @psoc: PSOC object 1342 * @cap: feature flag to be checked 1343 * 1344 * API to know, whether particular feature cap flag is set in psoc 1345 * 1346 * Return: 1 (for set) or 0 (for not set) 1347 */ 1348 static inline uint8_t wlan_psoc_nif_feat_cap_get(struct wlan_objmgr_psoc *psoc, 1349 uint32_t feat_cap) 1350 { 1351 return (psoc->soc_nif.soc_feature_caps & feat_cap) ? 1 : 0; 1352 } 1353 1354 /** 1355 * wlan_psoc_nif_op_flag_get() - get op flags 1356 * @psoc: PSOC object 1357 * @flag: op flag to be checked 1358 * 1359 * API to know, whether particular op flag is set in psoc 1360 * 1361 * Return: 1 (for set) or 0 (for not set) 1362 */ 1363 static inline uint8_t wlan_psoc_nif_op_flag_get(struct wlan_objmgr_psoc *psoc, 1364 uint32_t flag) 1365 { 1366 return (psoc->soc_nif.soc_op_flags & flag) ? 1 : 0; 1367 } 1368 1369 /** 1370 * wlan_psoc_nif_op_flag_set() - set op flag 1371 * @psoc: PSOC object 1372 * @flag: op flag to be set 1373 * 1374 * API to set op flag in psoc 1375 * 1376 * Return: void 1377 */ 1378 static inline void wlan_psoc_nif_op_flag_set(struct wlan_objmgr_psoc *psoc, 1379 uint32_t flag) 1380 { 1381 psoc->soc_nif.soc_op_flags |= flag; 1382 } 1383 1384 /** 1385 * wlan_psoc_nif_op_flag_clear() - clear op flag 1386 * @psoc: PSOC object 1387 * @flag: op flag to be cleared 1388 * 1389 * API to clear op flag in psoc 1390 * 1391 * Return: void 1392 */ 1393 static inline void wlan_psoc_nif_op_flag_clear(struct wlan_objmgr_psoc *psoc, 1394 uint32_t flag) 1395 { 1396 psoc->soc_nif.soc_op_flags &= ~flag; 1397 } 1398 1399 /** 1400 * wlan_psoc_set_hw_macaddr() - set hw mac addr 1401 * @psoc: PSOC object 1402 * @macaddr: hw macaddr 1403 * 1404 * API to set hw macaddr of psoc 1405 * 1406 * Caller need to acquire lock with wlan_psoc_obj_lock() 1407 * 1408 * Return: void 1409 */ 1410 static inline void wlan_psoc_set_hw_macaddr(struct wlan_objmgr_psoc *psoc, 1411 uint8_t *macaddr) 1412 { 1413 /* This API is invoked with lock acquired, do not add log prints */ 1414 if (psoc) 1415 WLAN_ADDR_COPY(psoc->soc_nif.soc_hw_macaddr, macaddr); 1416 } 1417 1418 /** 1419 * wlan_psoc_get_hw_macaddr() - get hw macaddr 1420 * @psoc: PSOC object 1421 * 1422 * API to set hw macaddr of psoc 1423 * 1424 * Return: hw macaddr 1425 */ 1426 static inline uint8_t *wlan_psoc_get_hw_macaddr(struct wlan_objmgr_psoc *psoc) 1427 { 1428 if (!psoc) 1429 return NULL; 1430 1431 return psoc->soc_nif.soc_hw_macaddr; 1432 } 1433 1434 /** 1435 * wlan_objmgr_psoc_get_comp_private_obj() - API to retrieve component object 1436 * @psoc: Psoc pointer 1437 * @id: component id 1438 * 1439 * This API is used to get the component private object pointer tied to the 1440 * corresponding psoc object 1441 * 1442 * Return: Component private object 1443 */ 1444 void *wlan_objmgr_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc, 1445 enum wlan_umac_comp_id id); 1446 /** 1447 * wlan_psoc_get_pdev_count() - get pdev count for psoc 1448 * @psoc: PSOC object 1449 * 1450 * API to get number of pdev's attached to the psoc 1451 * 1452 * Return: number of pdev's 1453 */ 1454 static inline uint8_t wlan_psoc_get_pdev_count(struct wlan_objmgr_psoc *psoc) 1455 { 1456 if (!psoc) 1457 return 0; 1458 1459 return psoc->soc_objmgr.wlan_pdev_count; 1460 } 1461 1462 /** 1463 * wlan_psoc_set_lmac_if_txops() - API to set tx ops handle in psoc object 1464 * @psoc: Psoc pointer 1465 * @tx_ops: tx callbacks handle 1466 * 1467 * API to set tx callbacks handle in psoc object 1468 * 1469 * Return: None 1470 */ 1471 static inline 1472 void wlan_psoc_set_lmac_if_txops(struct wlan_objmgr_psoc *psoc, 1473 struct wlan_lmac_if_tx_ops *tx_ops) 1474 { 1475 if (!psoc) 1476 return; 1477 1478 psoc->soc_cb.tx_ops = tx_ops; 1479 } 1480 1481 /** 1482 * wlan_psoc_get_lmac_if_txops() - API to get tx ops handle 1483 * @psoc: Psoc pointer 1484 * 1485 * API to get tx callbacks handle from psoc object 1486 * 1487 * Return: tx callbacks handle 1488 */ 1489 static inline 1490 struct wlan_lmac_if_tx_ops *wlan_psoc_get_lmac_if_txops(struct wlan_objmgr_psoc *psoc) 1491 { 1492 if (!psoc) 1493 return NULL; 1494 1495 return psoc->soc_cb.tx_ops; 1496 } 1497 1498 /** 1499 * wlan_psoc_set_lmac_if_rxops() - API to set rx ops handle in psoc object 1500 * @psoc: Psoc pointer 1501 * @tgt_if_handle: rx callbacks handle 1502 * 1503 * API to set rx callbacks handle in psoc object 1504 * 1505 * Return: None 1506 */ 1507 static inline 1508 void wlan_psoc_set_lmac_if_rxops(struct wlan_objmgr_psoc *psoc, struct 1509 wlan_lmac_if_rx_ops *rx_ops) 1510 { 1511 if (!psoc) 1512 return; 1513 1514 psoc->soc_cb.rx_ops = rx_ops; 1515 } 1516 1517 /** 1518 * wlan_psoc_get_lmac_if_rxops() - API to get rx ops handle 1519 * @psoc: Psoc pointer 1520 * 1521 * API to get rx callbacks handle from psoc object 1522 * 1523 * Return: rx callbacks handle 1524 */ 1525 static inline 1526 struct wlan_lmac_if_rx_ops *wlan_psoc_get_lmac_if_rxops(struct wlan_objmgr_psoc *psoc) 1527 { 1528 if (!psoc) 1529 return NULL; 1530 1531 return psoc->soc_cb.rx_ops; 1532 } 1533 1534 /** 1535 * wlan_psoc_set_tgt_if_handle() - API to set target if handle in psoc object 1536 * @psoc: Psoc pointer 1537 * @tgt_if_handle: target interface handle 1538 * 1539 * API to set target interface handle in psoc object 1540 * 1541 * Return: None 1542 */ 1543 static inline 1544 void wlan_psoc_set_tgt_if_handle(struct wlan_objmgr_psoc *psoc, 1545 struct target_psoc_info *tgt_if_handle) 1546 { 1547 if (!psoc) 1548 return; 1549 1550 psoc->tgt_if_handle = tgt_if_handle; 1551 } 1552 1553 /** 1554 * wlan_psoc_get_tgt_if_handle() - API to get target interface handle 1555 * @psoc: Psoc pointer 1556 * 1557 * API to get target interface handle from psoc object 1558 * 1559 * Return: target interface handle 1560 */ 1561 static inline 1562 struct target_psoc_info *wlan_psoc_get_tgt_if_handle( 1563 struct wlan_objmgr_psoc *psoc) 1564 { 1565 if (!psoc) 1566 return NULL; 1567 1568 return psoc->tgt_if_handle; 1569 } 1570 1571 /** 1572 * wlan_psoc_get_qdf_dev() - API to get qdf device 1573 * @psoc: Psoc pointer 1574 * 1575 * API to get qdf device from psoc object 1576 * 1577 * Return: qdf_device_t 1578 */ 1579 static inline qdf_device_t wlan_psoc_get_qdf_dev( 1580 struct wlan_objmgr_psoc *psoc) 1581 { 1582 if (!psoc) 1583 return NULL; 1584 1585 return psoc->soc_objmgr.qdf_dev; 1586 } 1587 1588 /** 1589 * wlan_psoc_set_qdf_dev() - API to get qdf device 1590 * @psoc: Psoc pointer 1591 * dev: qdf device 1592 * 1593 * API to set qdf device from psoc object 1594 * 1595 * Return: None 1596 */ 1597 static inline void wlan_psoc_set_qdf_dev( 1598 struct wlan_objmgr_psoc *psoc, 1599 qdf_device_t dev) 1600 { 1601 if (!psoc) 1602 return; 1603 1604 psoc->soc_objmgr.qdf_dev = dev; 1605 } 1606 1607 /** 1608 * wlan_psoc_set_max_vdev_count() - set psoc max vdev count 1609 * @psoc: PSOC object 1610 * @vdev count: Max vdev count 1611 * 1612 * API to set Max vdev count 1613 * 1614 * Return: void 1615 */ 1616 static inline void wlan_psoc_set_max_vdev_count(struct wlan_objmgr_psoc *psoc, 1617 uint8_t max_vdev_count) 1618 { 1619 if (max_vdev_count > WLAN_UMAC_PSOC_MAX_VDEVS) 1620 QDF_BUG(0); 1621 1622 psoc->soc_objmgr.max_vdev_count = max_vdev_count; 1623 } 1624 1625 /** 1626 * wlan_psoc_get_max_vdev_count() - get psoc max vdev count 1627 * @psoc: PSOC object 1628 * 1629 * API to set Max vdev count 1630 * 1631 * Return: @vdev count: Max vdev count 1632 */ 1633 static inline uint8_t wlan_psoc_get_max_vdev_count( 1634 struct wlan_objmgr_psoc *psoc) 1635 { 1636 return psoc->soc_objmgr.max_vdev_count; 1637 } 1638 1639 /** 1640 * wlan_psoc_set_max_peer_count() - set psoc max peer count 1641 * @psoc: PSOC object 1642 * @peer count: Max peer count 1643 * 1644 * API to set Max peer count 1645 * 1646 * Return: void 1647 */ 1648 static inline void wlan_psoc_set_max_peer_count(struct wlan_objmgr_psoc *psoc, 1649 uint16_t max_peer_count) 1650 { 1651 if (max_peer_count > WLAN_UMAC_PSOC_MAX_PEERS) 1652 QDF_BUG(0); 1653 1654 psoc->soc_objmgr.max_peer_count = max_peer_count; 1655 } 1656 1657 /** 1658 * wlan_psoc_get_max_peer_count() - get psoc max peer count 1659 * @psoc: PSOC object 1660 * 1661 * API to set Max peer count 1662 * 1663 * Return: @peer count: Max peer count 1664 */ 1665 static inline uint16_t wlan_psoc_get_max_peer_count( 1666 struct wlan_objmgr_psoc *psoc) 1667 { 1668 return psoc->soc_objmgr.max_peer_count; 1669 } 1670 1671 /** 1672 * wlan_psoc_get_peer_count() - get psoc peer count 1673 * @psoc: PSOC object 1674 * 1675 * API to get peer count 1676 * 1677 * Return: @peer count: peer count 1678 */ 1679 static inline uint16_t wlan_psoc_get_peer_count( 1680 struct wlan_objmgr_psoc *psoc) 1681 { 1682 return psoc->soc_objmgr.wlan_peer_count; 1683 } 1684 1685 1686 /** 1687 * DOC: Examples to use PSOC ref count APIs 1688 * 1689 * In all the scenarios, the pair of API should be followed 1690 * other it lead to memory leak 1691 * 1692 * scenario 1: 1693 * 1694 * wlan_objmgr_psoc_obj_create() 1695 * ---- 1696 * wlan_objmgr_psoc_obj_delete() 1697 * 1698 * scenario 2: 1699 * 1700 * wlan_objmgr_psoc_get_ref() 1701 * ---- 1702 * the operations which are done on 1703 * psoc object 1704 * ---- 1705 * wlan_objmgr_psoc_release_ref() 1706 */ 1707 1708 /** 1709 * wlan_objmgr_psoc_get_ref() - increment ref count 1710 * @psoc: PSOC object 1711 * @id: Object Manager ref debug id 1712 * 1713 * API to increment ref count of psoc 1714 * 1715 * Return: void 1716 */ 1717 void wlan_objmgr_psoc_get_ref(struct wlan_objmgr_psoc *psoc, 1718 wlan_objmgr_ref_dbgid id); 1719 1720 /** 1721 * wlan_objmgr_psoc_try_get_ref() - increment ref count, if allowed 1722 * @psoc: PSOC object 1723 * @id: Object Manager ref debug id 1724 * 1725 * API to increment ref count after checking valid object state 1726 * 1727 * Return: void 1728 */ 1729 QDF_STATUS wlan_objmgr_psoc_try_get_ref(struct wlan_objmgr_psoc *psoc, 1730 wlan_objmgr_ref_dbgid id); 1731 1732 /** 1733 * wlan_objmgr_psoc_release_ref() - decrement ref count 1734 * @psoc: PSOC object 1735 * @id: Object Manager ref debug id 1736 * 1737 * API to decrement ref count of psoc, if ref count is 1, it initiates the 1738 * PSOC deletion 1739 * 1740 * Return: void 1741 */ 1742 void wlan_objmgr_psoc_release_ref(struct wlan_objmgr_psoc *psoc, 1743 wlan_objmgr_ref_dbgid id); 1744 1745 /** 1746 * wlan_objmgr_print_ref_all_objects_per_psoc() - print all psoc objects' 1747 * ref counts 1748 * @psoc: PSOC object 1749 * 1750 * API to be used for printing all the objects(pdev/vdev/peer) ref counts 1751 * 1752 * Return: SUCCESS/FAILURE 1753 */ 1754 QDF_STATUS wlan_objmgr_print_ref_all_objects_per_psoc( 1755 struct wlan_objmgr_psoc *psoc); 1756 1757 /** 1758 * wlan_objmgr_psoc_set_user_config () - populate user config 1759 * data in psoc 1760 * @psoc: psoc object pointer 1761 * @user_config_data: pointer to user config data filled up by os 1762 * dependent component 1763 * it is intended to set all elements by OSIF/HDD and it not 1764 * intended to modify a single element 1765 * Return: QDF status 1766 */ 1767 QDF_STATUS wlan_objmgr_psoc_set_user_config(struct wlan_objmgr_psoc *psoc, 1768 struct wlan_objmgr_psoc_user_config *user_config_data); 1769 1770 /** 1771 * wlan_objmgr_psoc_check_for_pdev_leaks() - Assert no pdevs attached to @psoc 1772 * @psoc: The psoc to check 1773 * 1774 * Return: No. of psoc leaks 1775 */ 1776 uint32_t wlan_objmgr_psoc_check_for_pdev_leaks(struct wlan_objmgr_psoc *psoc); 1777 1778 /** 1779 * wlan_objmgr_psoc_check_for_vdev_leaks() - Assert no vdevs attached to @psoc 1780 * @psoc: The psoc to check 1781 * 1782 * Return: No. of vdev leaks 1783 */ 1784 uint32_t wlan_objmgr_psoc_check_for_vdev_leaks(struct wlan_objmgr_psoc *psoc); 1785 1786 /** 1787 * wlan_objmgr_psoc_check_for_peer_leaks() - Assert no peers attached to @psoc 1788 * @psoc: The psoc to check 1789 * 1790 * Return: No. of peer leaks 1791 */ 1792 uint32_t wlan_objmgr_psoc_check_for_peer_leaks(struct wlan_objmgr_psoc *psoc); 1793 1794 /** 1795 * wlan_objmgr_psoc_check_for_leaks() - Assert on leak 1796 * @psoc: The psoc to check 1797 * 1798 * Return: None 1799 */ 1800 void wlan_objmgr_psoc_check_for_leaks(struct wlan_objmgr_psoc *psoc); 1801 1802 /** 1803 * wlan_objmgr_psoc_get_band_capability () - get user config 1804 * data for band capability 1805 * @psoc: psoc object pointer 1806 * 1807 * Return: band_capability 1808 */ 1809 static inline uint8_t wlan_objmgr_psoc_get_band_capability( 1810 struct wlan_objmgr_psoc *psoc) 1811 { 1812 if (!psoc) 1813 return 0; 1814 1815 return psoc->soc_nif.user_config.band_capability; 1816 } 1817 1818 /** 1819 * wlan_psoc_set_dp_handle() - set dp handle 1820 * @psoc: psoc object pointer 1821 * @dp_handle: Data path module handle 1822 * 1823 * Return: void 1824 */ 1825 static inline void wlan_psoc_set_dp_handle(struct wlan_objmgr_psoc *psoc, 1826 void *dp_handle) 1827 { 1828 if (qdf_unlikely(!psoc)) { 1829 QDF_BUG(0); 1830 return; 1831 } 1832 1833 psoc->dp_handle = dp_handle; 1834 } 1835 1836 /** 1837 * wlan_psoc_get_dp_handle() - get dp handle 1838 * @psoc: psoc object pointer 1839 * 1840 * Return: dp handle 1841 */ 1842 static inline void *wlan_psoc_get_dp_handle(struct wlan_objmgr_psoc *psoc) 1843 { 1844 if (qdf_unlikely(!psoc)) { 1845 QDF_BUG(0); 1846 return NULL; 1847 } 1848 1849 return psoc->dp_handle; 1850 } 1851 1852 struct wlan_logically_del_peer { 1853 qdf_list_node_t list; 1854 struct wlan_objmgr_peer *peer; 1855 }; 1856 1857 /** 1858 * wlan_psoc_get_id() - get psoc id 1859 * @psoc: PSOC object 1860 * 1861 * API to get psoc id 1862 * 1863 * Return: @psoc_id: psoc id 1864 */ 1865 static inline uint8_t wlan_psoc_get_id( 1866 struct wlan_objmgr_psoc *psoc) 1867 { 1868 if (!psoc) 1869 return (uint8_t)-1; 1870 1871 return psoc->soc_objmgr.psoc_id; 1872 } 1873 1874 /** 1875 * wlan_print_psoc_info() - print psoc members 1876 * @psoc: psoc object pointer 1877 * 1878 * Return: void 1879 */ 1880 #ifdef WLAN_OBJMGR_DEBUG 1881 void wlan_print_psoc_info(struct wlan_objmgr_psoc *psoc); 1882 #else 1883 static inline void wlan_print_psoc_info(struct wlan_objmgr_psoc *psoc) {} 1884 #endif 1885 1886 #endif /* _WLAN_OBJMGR_PSOC_OBJ_H_*/ 1887