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