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