xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h (revision f28396d060cff5c6519f883cb28ae0116ce479f1)
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 #include "wlan_lmac_if_def.h"
28 #include <target_if_pub.h>
29 
30 #define REG_DMN_CH144        0x0001
31 #define REG_DMN_ENTREPRISE   0x0002
32 
33 
34 /* fw_caps */
35 	/* CAPABILITY: WEP available */
36 #define WLAN_SOC_C_WEP                  0x00000001
37 	/* CAPABILITY: TKIP available */
38 #define WLAN_SOC_C_TKIP                 0x00000002
39 	/* CAPABILITY: AES OCB avail */
40 #define WLAN_SOC_C_AES                  0x00000004
41 	/* CAPABILITY: AES CCM avail */
42 #define WLAN_SOC_C_AES_CCM              0x00000008
43 	/* CAPABILITY: 11n HT available */
44 #define WLAN_SOC_C_HT                   0x00000010
45 	/* CAPABILITY: CKIP available */
46 #define WLAN_SOC_C_CKIP                 0x00000020
47 	/* CAPABILITY: ATH FF avail */
48 #define WLAN_SOC_C_FF                   0x00000040
49 	/* CAPABILITY: ATH Turbo avail*/
50 #define WLAN_SOC_C_TURBOP               0x00000080
51 	/* CAPABILITY: IBSS available */
52 #define WLAN_SOC_C_IBSS                 0x00000100
53 	/* CAPABILITY: Power mgmt */
54 #define WLAN_SOC_C_PMGT                 0x00000200
55 	/* CAPABILITY: HOSTAP avail */
56 #define WLAN_SOC_C_HOSTAP               0x00000400
57 	/* CAPABILITY: Old Adhoc Demo */
58 #define WLAN_SOC_C_AHDEMO               0x00000800
59 	/* CAPABILITY: tx power mgmt */
60 #define WLAN_SOC_C_TXPMGT               0x00001000
61 	/* CAPABILITY: short slottime */
62 #define WLAN_SOC_C_SHSLOT               0x00002000
63 	/* CAPABILITY: short preamble */
64 #define WLAN_SOC_C_SHPREAMBLE           0x00004000
65 	/* CAPABILITY: monitor mode */
66 #define WLAN_SOC_C_MONITOR              0x00008000
67 	/* CAPABILITY: TKIP MIC avail */
68 #define WLAN_SOC_C_TKIPMIC              0x00010000
69 	/* CAPABILITY: ATH WAPI avail */
70 #define WLAN_SOC_C_WAPI                 0x00020000
71 	/* CONF: WDS auto Detect/DELBA */
72 #define WLAN_SOC_C_WDS_AUTODETECT       0x00040000
73 	/* CAPABILITY: WPA1 avail */
74 #define WLAN_SOC_C_WPA1                 0x00080000
75 	/* CAPABILITY: WPA2 avail */
76 #define WLAN_SOC_C_WPA2                 0x00100000
77 	/* CAPABILITY: WPA1+WPA2 avail*/
78 #define WLAN_SOC_C_WPA                  0x00180000
79 	/* CAPABILITY: frame bursting */
80 #define WLAN_SOC_C_BURST                0x00200000
81 	/* CAPABILITY: WME avail */
82 #define WLAN_SOC_C_WME                  0x00400000
83 	/* CAPABILITY: 4-addr support */
84 #define WLAN_SOC_C_WDS                  0x00800000
85 	/* CAPABILITY: TKIP MIC for QoS frame */
86 #define WLAN_SOC_C_WME_TKIPMIC          0x01000000
87 	/* CAPABILITY: bg scanning */
88 #define WLAN_SOC_C_BGSCAN               0x02000000
89 	/* CAPABILITY: UAPSD */
90 #define WLAN_SOC_C_UAPSD                0x04000000
91 	/* CAPABILITY: enabled 11.h */
92 #define WLAN_SOC_C_DOTH                 0x08000000
93 
94 /* XXX protection/barker? */
95 	/* CAPABILITY: crypto alg's */
96 #define WLAN_SOC_C_CRYPTO         0x0000002f
97 
98 /* fw_caps_ext */
99 	/* CAPABILITY: fast channel change */
100 #define WLAN_SOC_CEXT_FASTCC           0x00000001
101 	/* CAPABILITY: P2P */
102 #define WLAN_SOC_CEXT_P2P              0x00000002
103 	/* CAPABILITY: Multi-Channel Operations */
104 #define WLAN_SOC_CEXT_MULTICHAN        0x00000004
105 	/* CAPABILITY: the device supports perf and power offload */
106 #define WLAN_SOC_CEXT_PERF_PWR_OFLD    0x00000008
107 	/* CAPABILITY: the device supports 11ac */
108 #define WLAN_SOC_CEXT_11AC             0x00000010
109 	/* CAPABILITY: the device support acs channel hopping */
110 #define WLAN_SOC_CEXT_ACS_CHAN_HOP     0x00000020
111 	/* CAPABILITY: the device support STA DFS */
112 #define WLAN_SOC_CEXT_STADFS           0x00000040
113 	/* NSS offload capability */
114 #define WLAN_SOC_CEXT_NSS_OFFLOAD      0x00000080
115 	/* SW cal support capability */
116 #define WLAN_SOC_CEXT_SW_CAL           0x00000100
117 	/* Hybrid mode */
118 #define WLAN_SOC_CEXT_HYBRID_MODE      0x00000200
119 	/* TT support */
120 #define WLAN_SOC_CEXT_TT_SUPPORT       0x00000400
121 	/* WMI MGMT REF */
122 #define WLAN_SOC_CEXT_WMI_MGMT_REF     0x00000800
123 	/* Wideband scan */
124 #define WLAN_SOC_CEXT_WIDEBAND_SCAN    0x00001000
125 	/* TWT Requester capable */
126 #define WLAN_SOC_CEXT_TWT_REQUESTER    0x00002000
127 	/* TWT Responder capable */
128 #define WLAN_SOC_CEXT_TWT_RESPONDER    0x00004000
129 	/* HW DB2DBM CAPABLE */
130 #define WLAN_SOC_CEXT_HW_DB2DBM        0x00008000
131 	/* OBSS Narrow Bandwidth RU Tolerance */
132 #define WLAN_SOC_CEXT_OBSS_NBW_RU      0x00010000
133 	/* MBSS IE support */
134 #define WLAN_SOC_CEXT_MBSS_IE          0x00020000
135 	/* RXOLE Flow Search Support */
136 #define WLAN_SOC_CEXT_RX_FSE_SUPPORT   0x00040000
137 	/* Dynamic HW Mode Switch Support */
138 #define WLAN_SOC_CEXT_DYNAMIC_HW_MODE  0x00080000
139 	/* Restricted 80+80 MHz support */
140 #define WLAN_SOC_RESTRICTED_80P80_SUPPORT 0x00100000
141 	/* Indicates Firmware supports sending NSS ratio info to host */
142 #define WLAN_SOC_NSS_RATIO_TO_HOST_SUPPORT 0x00200000
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 	uint32_t wlan_vdev_id_map[2];
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 	target_psoc_info_t *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  ** APIs to Create/Delete Global object APIs
400  */
401 /**
402  * wlan_objmgr_psoc_obj_create() - psoc object create
403  * @phy_version: device id (from probe)
404  * @dev_type: Offload/DA
405  *
406  * Creates PSOC object, intializes with default values
407  * Invokes the registered notifiers to create component object
408  *
409  * Return: Handle to struct wlan_objmgr_psoc on successful creation,
410  *         NULL on Failure (on Mem alloc failure and Component objects
411  *         Failure)
412  */
413 struct wlan_objmgr_psoc *wlan_objmgr_psoc_obj_create(uint32_t phy_version,
414 				WLAN_DEV_TYPE dev_type);
415 
416 /**
417  * wlan_objmgr_psoc_obj_delete() - psoc object delete
418  * @psoc: PSOC object
419  *
420  * Logically deletes PSOC object,
421  * Once all the references are released, object manager invokes the registered
422  * notifiers to destroy component objects
423  *
424  * Return: SUCCESS/FAILURE
425  */
426 QDF_STATUS wlan_objmgr_psoc_obj_delete(struct wlan_objmgr_psoc *psoc);
427 
428 /**
429  ** APIs to attach/detach component objects
430  */
431 
432 /**
433  * wlan_objmgr_psoc_component_obj_attach() - psoc comp object attach
434  * @psoc: PSOC object
435  * @id: Component id
436  * @comp_priv_obj: component's private object pointer
437  * @status: Component's private object creation status
438  *
439  * API to be used for attaching component object with PSOC common object
440  *
441  * Return: SUCCESS on successful storing of component's object in common object
442  *         On FAILURE (appropriate failure codes are returned)
443  */
444 QDF_STATUS wlan_objmgr_psoc_component_obj_attach(
445 		struct wlan_objmgr_psoc *psoc,
446 		enum wlan_umac_comp_id id,
447 		void *comp_priv_obj,
448 		QDF_STATUS status);
449 
450 /**
451  * wlan_objmgr_psoc_component_obj_detach() - psoc comp object detach
452  * @psoc: PSOC object
453  * @id: Component id
454  * @comp_priv_obj: component's private object pointer
455  *
456  * API to be used for detaching component object with PSOC common object
457  *
458  * Return: SUCCESS on successful removal of component's object from common
459  *         object
460  *         On FAILURE (appropriate failure codes are returned)
461  */
462 QDF_STATUS wlan_objmgr_psoc_component_obj_detach(
463 		struct wlan_objmgr_psoc *psoc,
464 		enum wlan_umac_comp_id id,
465 		void *comp_priv_obj);
466 
467 /**
468  ** APIs to operations on psoc objects
469  */
470 typedef void (*wlan_objmgr_op_handler)(struct wlan_objmgr_psoc *psoc,
471 					void *object,
472 					void *arg);
473 
474 /**
475  * wlan_objmgr_iterate_obj_list() - iterate through all psoc objects
476  *                                  (CREATED state)
477  * @psoc: PSOC object
478  * @obj_type: PDEV_OP/VDEV_OP/PEER_OP
479  * @handler: the handler will be called for each object of requested type
480  *            the handler should be implemented to perform required operation
481  * @arg:     agruments passed by caller
482  * @lock_free_op: its obsolete
483  * @dbg_id: id of the caller
484  *
485  * API to be used for performing the operations on all PDEV/VDEV/PEER objects
486  * of psoc
487  *
488  * Return: SUCCESS/FAILURE
489  */
490 QDF_STATUS wlan_objmgr_iterate_obj_list(
491 		struct wlan_objmgr_psoc *psoc,
492 		enum wlan_objmgr_obj_type obj_type,
493 		wlan_objmgr_op_handler handler,
494 		void *arg, uint8_t lock_free_op,
495 		wlan_objmgr_ref_dbgid dbg_id);
496 
497 /**
498  * wlan_objmgr_iterate_obj_list_all() - iterate through all psoc objects
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_all(
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_free_all_objects_per_psoc() - free all psoc objects
521  * @psoc: PSOC object
522  *
523  * API to be used free all the objects(pdev/vdev/peer) of psoc
524  *
525  * Return: SUCCESS/FAILURE
526  */
527 QDF_STATUS wlan_objmgr_free_all_objects_per_psoc(
528 		struct wlan_objmgr_psoc *psoc);
529 
530 /**
531  * wlan_objmgr_trigger_psoc_comp_priv_object_creation() - create
532  * psoc comp object
533  * @psoc: PSOC object
534  * @id: Component id
535  *
536  * API to create component private object in run time, this would
537  * be used for features which gets enabled in run time
538  *
539  * Return: SUCCESS on successful creation
540  *         On FAILURE (appropriate failure codes are returned)
541  */
542 QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_creation(
543 		struct wlan_objmgr_psoc *psoc,
544 		enum wlan_umac_comp_id id);
545 
546 /**
547  * wlan_objmgr_trigger_psoc_comp_priv_object_deletion() - destroy
548  * psoc comp object
549  * @psoc: PSOC object
550  * @id: Component id
551  *
552  * API to destroy component private object in run time, this would
553  * be used for features which gets disabled in run time
554  *
555  * Return: SUCCESS on successful deletion
556  *         On FAILURE (appropriate failure codes are returned)
557  */
558 QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_deletion(
559 		struct wlan_objmgr_psoc *psoc,
560 		enum wlan_umac_comp_id id);
561 
562 /**
563  * wlan_objmgr_get_peer_by_mac() - find peer from psoc's peer list
564  * @psoc: PSOC object
565  * @macaddr: MAC address
566  * @dbg_id: id of the caller
567  *
568  * API to find peer object pointer by MAC addr
569  *
570  * This API increments the ref count of the peer object internally, the
571  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
572  * ref count
573  *
574  * Return: peer pointer
575  *         NULL on FAILURE
576  */
577 #ifdef WLAN_OBJMGR_REF_ID_TRACE
578 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_debug(
579 		struct wlan_objmgr_psoc *psoc, uint8_t *macaddr,
580 		wlan_objmgr_ref_dbgid dbg_id, const char *func, int line);
581 
582 #define wlan_objmgr_get_peer_by_mac(psoc, macaddr, dbgid) \
583 		wlan_objmgr_get_peer_by_mac_debug(psoc, macaddr, dbgid, \
584 		__func__, __LINE__)
585 #else
586 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac(
587 		struct wlan_objmgr_psoc *psoc, uint8_t *macaddr,
588 		wlan_objmgr_ref_dbgid dbg_id);
589 #endif
590 
591 /**
592  * wlan_objmgr_get_peer() - find peer from psoc's peer list
593  * @psoc: PSOC object
594  * @pdev_id: Pdev id
595  * @macaddr: MAC address
596  * @dbg_id: id of the caller
597  *
598  * API to find peer object pointer by MAC addr and pdev id
599  *
600  * This API increments the ref count of the peer object internally, the
601  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
602  * ref count
603  *
604  * Return: peer pointer
605  *         NULL on FAILURE
606  */
607 #ifdef WLAN_OBJMGR_REF_ID_TRACE
608 struct wlan_objmgr_peer *wlan_objmgr_get_peer_debug(
609 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
610 			uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id,
611 			const char *func, int line);
612 
613 #define wlan_objmgr_get_peer(psoc, pdev_id, macaddr, dbgid) \
614 		wlan_objmgr_get_peer_debug(psoc, pdev_id, macaddr, dbgid, \
615 		__func__, __LINE__)
616 #else
617 struct wlan_objmgr_peer *wlan_objmgr_get_peer(
618 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
619 			uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id);
620 #endif
621 
622 /**
623  * wlan_objmgr_get_peer_nolock() - find peer from psoc's peer list (lock free)
624  * @psoc: PSOC object
625  * @pdev_id: Pdev id
626  * @macaddr: MAC address
627  * @dbg_id: id of the caller
628  *
629  * API to find peer object pointer by MAC addr
630  *
631  * This API increments the ref count of the peer object internally, the
632  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
633  * ref count
634  *
635  * Return: peer pointer
636  *         NULL on FAILURE
637  */
638 #ifdef WLAN_OBJMGR_REF_ID_TRACE
639 struct wlan_objmgr_peer *wlan_objmgr_get_peer_nolock_debug(
640 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
641 			uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id,
642 			const char *func, int line);
643 
644 #define wlan_objmgr_get_peer_nolock(psoc, pdev_id, macaddr, dbgid) \
645 		wlan_objmgr_get_peer_nolock_debug(psoc, pdev_id, macaddr, \
646 		dbgid, __func__, __LINE__)
647 #else
648 struct wlan_objmgr_peer *wlan_objmgr_get_peer_nolock(
649 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
650 			uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id);
651 #endif
652 
653 /**
654  * wlan_objmgr_get_peer_logically_deleted() - find peer
655  * from psoc's peer list
656  * @psoc: PSOC object
657  * @macaddr: MAC address
658  * @dbg_id: id of the caller
659  *
660  * API to find peer object pointer of logically deleted peer
661  *
662  * This API increments the ref count of the peer object internally, the
663  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
664  * ref count
665  *
666  * Return: peer pointer
667  *         NULL on FAILURE
668  */
669 #ifdef WLAN_OBJMGR_REF_ID_TRACE
670 struct wlan_objmgr_peer *wlan_objmgr_get_peer_logically_deleted_debug(
671 			struct wlan_objmgr_psoc *psoc, uint8_t *macaddr,
672 			wlan_objmgr_ref_dbgid dbg_id,
673 			const char *func, int line);
674 
675 #define wlan_objmgr_get_peer_logically_deleted(psoc, macaddr, dbgid) \
676 		wlan_objmgr_get_peer_logically_deleted_debug(psoc, macaddr, \
677 		dbgid, __func__, __LINE__)
678 #else
679 struct wlan_objmgr_peer *wlan_objmgr_get_peer_logically_deleted(
680 			struct wlan_objmgr_psoc *psoc, uint8_t *macaddr,
681 			wlan_objmgr_ref_dbgid dbg_id);
682 #endif
683 
684 /**
685  * wlan_objmgr_get_peer_no_state() - find peer from psoc's peer list
686  * @psoc: PSOC object
687  * @pdev_id: Pdev id
688  * @macaddr: MAC address
689  * @dbg_id: id of the caller
690  *
691  * API to find peer object pointer by MAC addr and pdev id,
692  * ignores the state check
693  *
694  * This API increments the ref count of the peer object internally, the
695  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
696  * ref count
697  *
698  * Return: peer pointer
699  *         NULL on FAILURE
700  */
701 #ifdef WLAN_OBJMGR_REF_ID_TRACE
702 struct wlan_objmgr_peer *wlan_objmgr_get_peer_no_state_debug(
703 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
704 			uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id,
705 			const char *func, int line);
706 
707 #define wlan_objmgr_get_peer_no_state(psoc, pdev_id, macaddr, dbgid) \
708 		wlan_objmgr_get_peer_no_state_debug(psoc, pdev_id, macaddr, \
709 		dbgid, __func__, __LINE__)
710 #else
711 struct wlan_objmgr_peer *wlan_objmgr_get_peer_no_state(
712 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
713 			uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id);
714 #endif
715 
716 /**
717  * wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev() - get peer from
718  *                                                psoc peer list using
719  *                                                mac and vdev
720  *                                                self mac
721  * @psoc: PSOC object
722  * @pdev_id: Pdev id
723  * @bssid: BSSID address
724  * @macaddr: MAC address
725  * @dbg_id: id of the caller
726  *
727  * API to find peer object pointer by MAC addr, vdev self mac
728  * address and pdev id for a node that is logically in deleted state
729  *
730  * This API increments the ref count of the peer object internally, the
731  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
732  * ref count
733  *
734  * Return: List of peer pointers
735  *         NULL on FAILURE
736  */
737 #ifdef WLAN_OBJMGR_REF_ID_TRACE
738 qdf_list_t *wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev_debug(
739 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
740 			uint8_t *bssid, uint8_t *macaddr,
741 			wlan_objmgr_ref_dbgid dbg_id,
742 			const char *func, int line);
743 
744 #define wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev( \
745 	psoc, pdev_id, bssid, macaddr, dbgid) \
746 		wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev_debug( \
747 		psoc, pdev_id, bssid, macaddr, dbgid, __func__, __LINE__)
748 #else
749 qdf_list_t *wlan_objmgr_populate_logically_deleted_peerlist_by_mac_n_vdev(
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 #endif
754 
755 /**
756  * wlan_objmgr_get_peer_by_mac_n_vdev() - find peer from psoc's peer list
757  *                                          using mac address and bssid
758  * @psoc: PSOC object
759  * @pdev_id: Pdev id
760  * @bssid: MAC address of AP its associated
761  * @macaddr: MAC address
762  * @dbg_id: id of the caller
763  *
764  * API to find peer object pointer by MAC addr and vdev self mac address
765  * and pdev id
766  *
767  * This API increments the ref count of the peer object internally, the
768  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
769  * ref count
770  *
771  * Return: peer pointer
772  *         NULL on FAILURE
773  */
774 #ifdef WLAN_OBJMGR_REF_ID_TRACE
775 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev_debug(
776 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
777 			uint8_t *bssid, uint8_t *macaddr,
778 			wlan_objmgr_ref_dbgid dbg_id,
779 			const char *func, int line);
780 
781 #define wlan_objmgr_get_peer_by_mac_n_vdev(psoc, pdevid, bssid, macaddr, \
782 	dbgid) \
783 		wlan_objmgr_get_peer_by_mac_n_vdev_debug(psoc, pdevid, \
784 		bssid, macaddr, dbgid, __func__, __LINE__)
785 #else
786 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev(
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 #endif
791 
792 /**
793  * wlan_objmgr_get_peer_by_mac_n_vdev_no_state() - find peer from psoc's peer
794  *                                          list using mac address and bssid
795  * @psoc: PSOC object
796  * @pdev_id: Pdev id
797  * @bssid: MAC address of AP its associated
798  * @macaddr: MAC address
799  * @dbg_id: id of the caller
800  *
801  * API to find peer object pointer by MAC addr, vdev self mac address,
802  * and pdev id ,ignores the state
803  *
804  * This API increments the ref count of the peer object internally, the
805  * caller has to invoke the wlan_objmgr_peer_release_ref() to decrement
806  * ref count
807  *
808  * Return: peer pointer
809  *         NULL on FAILURE
810  */
811 #ifdef WLAN_OBJMGR_REF_ID_TRACE
812 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev_no_state_debug(
813 			struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
814 			uint8_t *bssid,  uint8_t *macaddr,
815 			wlan_objmgr_ref_dbgid dbg_id,
816 			const char *func, int line);
817 
818 #define wlan_objmgr_get_peer_by_mac_n_vdev_no_state(psoc, pdevid, bssid, \
819 	macaddr, dbgid) \
820 		wlan_objmgr_get_peer_by_mac_n_vdev_no_state_debug(psoc, \
821 		pdevid, bssid, macaddr, dbgid, __func__, __LINE__)
822 #else
823 struct wlan_objmgr_peer *wlan_objmgr_get_peer_by_mac_n_vdev_no_state(
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 #endif
828 
829 /**
830  * wlan_objmgr_get_pdev_by_id() - retrieve pdev by id
831  * @psoc: PSOC object
832  * @id: pdev id
833  * @dbg_id: id of the caller
834  *
835  * API to find pdev object pointer by pdev id
836  *
837  * This API increments the ref count of the pdev object internally, the
838  * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement
839  * ref count
840  *
841  * Return: pdev pointer
842  *         NULL on FAILURE
843  */
844 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_id(
845 		struct wlan_objmgr_psoc *psoc, uint8_t id,
846 		wlan_objmgr_ref_dbgid dbg_id);
847 
848 /**
849  * wlan_objmgr_get_pdev_by_id_no_state() - retrieve pdev by id
850  * @psoc: PSOC object
851  * @id: pdev id
852  * @dbg_id: id of the caller
853  *
854  * API to find pdev object pointer by pdev id, Ignores the state check
855  *
856  * This API increments the ref count of the pdev object internally, the
857  * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement
858  * ref count
859  *
860  * Return: pdev pointer
861  *         NULL on FAILURE
862  */
863 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_id_no_state(
864 			struct wlan_objmgr_psoc *psoc, uint8_t id,
865 			wlan_objmgr_ref_dbgid dbg_id);
866 
867 /**
868  * wlan_objmgr_get_pdev_by_macaddr() - retrieve pdev by macaddr
869  * @psoc: PSOC object
870  * @macaddr: MAC address
871  * @dbg_id: id of the caller
872  *
873  * API to find pdev object pointer by pdev macaddr
874  *
875  * This API increments the ref count of the pdev object internally, the
876  * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement
877  * ref count
878  *
879  * Return: pdev pointer
880  *         NULL on FAILURE
881  */
882 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_macaddr(
883 		struct wlan_objmgr_psoc *psoc, uint8_t *macaddr,
884 		wlan_objmgr_ref_dbgid dbg_id);
885 
886 /**
887  * wlan_objmgr_get_pdev_by_macaddr_no_state() - retrieve pdev by macaddr
888  * @psoc: PSOC object
889  * @macaddr: MAC address
890  * @dbg_id: id of the caller
891  *
892  * API to find pdev object pointer by pdev macaddr, ignores the state check
893  *
894  * This API increments the ref count of the pdev object internally, the
895  * caller has to invoke the wlan_objmgr_pdev_release_ref() to decrement
896  * ref count
897  *
898  * Return: pdev pointer
899  *         NULL on FAILURE
900  */
901 struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_macaddr_no_state(
902 		struct wlan_objmgr_psoc *psoc, uint8_t *macaddr,
903 		wlan_objmgr_ref_dbgid dbg_id);
904 
905 /**
906  * wlan_objmgr_get_vdev_by_opmode_from_psoc() - retrieve vdev by opmode
907  * @psoc: PSOC object
908  * @opmode: vdev operating mode
909  * @dbg_id: id of the caller
910  *
911  * API to find vdev object pointer by vdev operating mode from psoc
912  *
913  * This API increments the ref count of the vdev object internally, the
914  * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
915  * ref count
916  *
917  * Return: vdev pointer
918  *         NULL on FAILURE
919  */
920 #ifdef WLAN_OBJMGR_REF_ID_TRACE
921 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_opmode_from_psoc_debug(
922 			struct wlan_objmgr_psoc *psoc,
923 			enum QDF_OPMODE opmode,
924 			wlan_objmgr_ref_dbgid dbg_id,
925 			const char *func, int line);
926 
927 #define wlan_objmgr_get_vdev_by_opmode_from_psoc(psoc, opmode, dbgid) \
928 		wlan_objmgr_get_vdev_by_opmode_from_psoc_debug(psoc, opmode, \
929 		dbgid, __func__, __LINE__)
930 #else
931 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_opmode_from_psoc(
932 			struct wlan_objmgr_psoc *psoc,
933 			enum QDF_OPMODE opmode,
934 			wlan_objmgr_ref_dbgid dbg_id);
935 #endif
936 
937 /**
938  * wlan_objmgr_get_vdev_by_id_from_psoc() - retrieve vdev by id
939  * @psoc: PSOC object
940  * @id: vdev id
941  * @dbg_id: id of the caller
942  *
943  * API to find vdev object pointer by vdev id from psoc
944  *
945  * This API increments the ref count of the vdev object internally, the
946  * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
947  * ref count
948  *
949  * Return: vdev pointer
950  *         NULL on FAILURE
951  */
952 #ifdef WLAN_OBJMGR_REF_ID_TRACE
953 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_debug(
954 			struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
955 			wlan_objmgr_ref_dbgid dbg_id,
956 			const char *func, int line);
957 
958 #define wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, dbgid) \
959 		wlan_objmgr_get_vdev_by_id_from_psoc_debug(psoc, vdev_id, \
960 		dbgid, __func__, __LINE__)
961 #else
962 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc(
963 			struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
964 			wlan_objmgr_ref_dbgid dbg_id);
965 #endif
966 
967 /**
968  * wlan_objmgr_get_vdev_by_id_from_psoc_no_state() - retrieve vdev by id
969  * @psoc: PSOC object
970  * @id: vdev id
971  * @dbg_id: id of the caller
972  *
973  * API to find vdev object pointer by vdev id from psoc, ignores the
974  * state check
975  *
976  * This API increments the ref count of the vdev object internally, the
977  * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
978  * ref count
979  *
980  * Return: vdev pointer
981  *         NULL on FAILURE
982  */
983 #ifdef WLAN_OBJMGR_REF_ID_TRACE
984 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_no_state_debug(
985 			struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
986 			wlan_objmgr_ref_dbgid dbg_id,
987 			const char *func, int line);
988 
989 #define wlan_objmgr_get_vdev_by_id_from_psoc_no_state(psoc, vdev_id, dbgid) \
990 		wlan_objmgr_get_vdev_by_id_from_psoc_no_state_debug(psoc, \
991 		vdev_id, dbgid, __func__, __LINE__)
992 #else
993 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_no_state(
994 			struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
995 			wlan_objmgr_ref_dbgid dbg_id);
996 #endif
997 
998 /**
999  * wlan_objmgr_get_vdev_by_macaddr_from_psoc() - retrieve vdev by macaddr
1000  * @psoc: PSOC object
1001  * @pdev_id: Pdev id
1002  * @macaddr: macaddr
1003  * @dbg_id: id of the caller
1004  *
1005  * API to find vdev object pointer by vdev macaddr from pdev
1006  *
1007  * This API increments the ref count of the vdev object internally, the
1008  * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
1009  * ref count
1010  *
1011  * Return: vdev pointer
1012  *         NULL on FAILURE
1013  */
1014 #ifdef WLAN_OBJMGR_REF_ID_TRACE
1015 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc_debug(
1016 		struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
1017 		uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id,
1018 		const char *func, int line);
1019 
1020 #define wlan_objmgr_get_vdev_by_macaddr_from_psoc(psoc, pdev_id, macaddr, \
1021 	dbgid) \
1022 		wlan_objmgr_get_vdev_by_macaddr_from_psoc_debug(psoc, pdev_id, \
1023 		macaddr, dbgid, __func__, __LINE__)
1024 #else
1025 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc(
1026 		struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
1027 		uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id);
1028 #endif
1029 
1030 /**
1031  * wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state() - retrieve vdev by
1032  *                                                           macaddr
1033  * @psoc: PSOC object
1034  * @pdev_id: Pdev id
1035  * @macaddr: macaddr
1036  * @dbg_id: id of the caller
1037  *
1038  * API to find vdev object pointer by vdev macaddr from psoc, ignores the state
1039  * check
1040  *
1041  * This API increments the ref count of the vdev object internally, the
1042  * caller has to invoke the wlan_objmgr_vdev_release_ref() to decrement
1043  * ref count
1044  *
1045  * Return: vdev pointer
1046  *         NULL on FAILURE
1047  */
1048 #ifdef WLAN_OBJMGR_REF_ID_TRACE
1049 struct wlan_objmgr_vdev
1050 	*wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state_debug(
1051 		struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
1052 		uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id,
1053 		const char *func, int line);
1054 
1055 #define wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state(psoc, pdev_id, \
1056 	macaddr, dbgid) \
1057 		wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state_debug(psoc, \
1058 		pdev_id, macaddr, dbgid, __func__, __LINE__)
1059 #else
1060 struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state(
1061 		struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
1062 		uint8_t *macaddr, wlan_objmgr_ref_dbgid dbg_id);
1063 #endif
1064 
1065 /**
1066  * wlan_psoc_obj_lock() - Acquire PSOC spinlock
1067  * @psoc: PSOC object
1068  *
1069  * API to acquire PSOC lock
1070  * Parent lock should not be taken in child lock context
1071  * but child lock can be taken in parent lock context
1072  * (for ex: psoc lock can't be invoked in pdev/vdev/peer lock context)
1073  *
1074  * Return: void
1075  */
1076 static inline void wlan_psoc_obj_lock(struct wlan_objmgr_psoc *psoc)
1077 {
1078 	qdf_spin_lock_bh(&psoc->psoc_lock);
1079 }
1080 
1081 /**
1082  * wlan_psoc_obj_unlock() - Release PSOC spinlock
1083  * @psoc: PSOC object
1084  *
1085  * API to Release PSOC lock
1086  *
1087  * Return: void
1088  */
1089 static inline void wlan_psoc_obj_unlock(struct wlan_objmgr_psoc *psoc)
1090 {
1091 	qdf_spin_unlock_bh(&psoc->psoc_lock);
1092 }
1093 
1094 /**
1095  * wlan_psoc_set_nif_phy_version() - set nif phy version
1096  * @psoc: PSOC object
1097  * @phy_ver: phy version
1098  *
1099  * API to set nif phy version in psoc
1100  *
1101  * Return: void
1102  */
1103 static inline void wlan_psoc_set_nif_phy_version(struct wlan_objmgr_psoc *psoc,
1104 			uint32_t phy_ver)
1105 {
1106 	psoc->soc_nif.phy_version = phy_ver;
1107 }
1108 
1109 /**
1110  * wlan_psoc_get_nif_phy_version() - get nif phy version
1111  * @psoc: PSOC object
1112  *
1113  * API to set nif phy version in psoc
1114  *
1115  * Return: @phy_ver: phy version
1116  */
1117 static inline uint32_t wlan_psoc_get_nif_phy_version(
1118 			struct wlan_objmgr_psoc *psoc)
1119 {
1120 	if (!psoc)
1121 		return (uint32_t)-1;
1122 
1123 	return psoc->soc_nif.phy_version;
1124 }
1125 
1126 /**
1127  * wlan_psoc_set_dev_type() - set dev type
1128  * @psoc: PSOC object
1129  * @phy_type: phy type (OL/DA)
1130  *
1131  * API to set dev type in psoc
1132  *
1133  * Return: void
1134  */
1135 static inline void wlan_psoc_set_dev_type(struct wlan_objmgr_psoc *psoc,
1136 				WLAN_DEV_TYPE phy_type)
1137 {
1138 	psoc->soc_nif.phy_type = phy_type;
1139 }
1140 
1141 /**
1142  * wlan_objmgr_psoc_get_dev_type - get dev type
1143  * @psoc: PSOC object
1144  *
1145  * API to get dev type in psoc
1146  *
1147  * Return: phy type (OL/DA)
1148  */
1149 static inline WLAN_DEV_TYPE wlan_objmgr_psoc_get_dev_type(
1150 				struct wlan_objmgr_psoc *psoc)
1151 {
1152 	if (!psoc)
1153 		return (uint32_t)-1;
1154 
1155 	return psoc->soc_nif.phy_type;
1156 }
1157 
1158 /**
1159  * wlan_psoc_nif_fw_cap_set() - set fw caps
1160  * @psoc: PSOC object
1161  * @cap: capability flag to be set
1162  *
1163  * API to set fw caps in psoc
1164  *
1165  * Return: void
1166  */
1167 static inline void wlan_psoc_nif_fw_cap_set(struct wlan_objmgr_psoc *psoc,
1168 					uint32_t cap)
1169 {
1170 	psoc->soc_nif.soc_fw_caps |= cap;
1171 }
1172 
1173 /**
1174  * wlan_psoc_nif_fw_cap_clear() - clear fw caps
1175  * @psoc: PSOC object
1176  * @cap: capability flag to be cleared
1177  *
1178  * API to clear fw caps in psoc
1179  *
1180  * Return: void
1181  */
1182 static inline void wlan_psoc_nif_fw_cap_clear(struct wlan_objmgr_psoc *psoc,
1183 				uint32_t cap)
1184 {
1185 	psoc->soc_nif.soc_fw_caps &= ~cap;
1186 }
1187 
1188 /**
1189  * wlan_psoc_nif_fw_cap_get() - get fw caps
1190  * @psoc: PSOC object
1191  * @cap: capability flag to be checked
1192  *
1193  * API to know, whether particular fw caps flag is set in psoc
1194  *
1195  * Return: 1 (for set) or 0 (for not set)
1196  */
1197 static inline uint8_t wlan_psoc_nif_fw_cap_get(struct wlan_objmgr_psoc *psoc,
1198 				uint32_t cap)
1199 {
1200 	return (psoc->soc_nif.soc_fw_caps & cap) ? 1 : 0;
1201 }
1202 
1203 /**
1204  * wlan_psoc_nif_fw_ext_cap_set() - set fw ext caps
1205  * @psoc: PSOC object
1206  * @ext_cap: capability flag to be set
1207  *
1208  * API to set fw ext caps in psoc
1209  *
1210  * Return: void
1211  */
1212 static inline void wlan_psoc_nif_fw_ext_cap_set(struct wlan_objmgr_psoc *psoc,
1213 				uint32_t ext_cap)
1214 {
1215 	psoc->soc_nif.soc_fw_ext_caps |= ext_cap;
1216 }
1217 
1218 /**
1219  * wlan_psoc_nif_fw_ext_cap_clear() - clear fw ext caps
1220  * @psoc: PSOC object
1221  * @ext_cap: capability flag to be cleared
1222  *
1223  * API to clear fw ext caps in psoc
1224  *
1225  * Return: void
1226  */
1227 static inline void wlan_psoc_nif_fw_ext_cap_clear(struct wlan_objmgr_psoc *psoc,
1228 				uint32_t ext_cap)
1229 {
1230 	psoc->soc_nif.soc_fw_ext_caps &= ~ext_cap;
1231 }
1232 
1233 /**
1234  * wlan_psoc_nif_fw_ext_cap_get() - get fw caps
1235  * @psoc: PSOC object
1236  * @ext_cap: capability flag to be checked
1237  *
1238  * API to know, whether particular fw caps flag is set in psoc
1239  *
1240  * Return: 1 (for set) or 0 (for not set)
1241  */
1242 static inline uint8_t wlan_psoc_nif_fw_ext_cap_get(
1243 		struct wlan_objmgr_psoc *psoc, uint32_t ext_cap)
1244 {
1245 	return (psoc->soc_nif.soc_fw_ext_caps & ext_cap) ? 1 : 0;
1246 }
1247 
1248 /**
1249  * wlan_psoc_nif_feat_cap_set() - set feature caps
1250  * @psoc: PSOC object
1251  * @cap: feature flag to be set
1252  *
1253  * API to set feature caps in psoc
1254  *
1255  * Return: void
1256  */
1257 static inline void wlan_psoc_nif_feat_cap_set(struct wlan_objmgr_psoc *psoc,
1258 				uint32_t feat_cap)
1259 {
1260 	psoc->soc_nif.soc_feature_caps |= feat_cap;
1261 }
1262 
1263 /**
1264  * wlan_psoc_nif_feat_cap_clear() - clear feature caps
1265  * @psoc: PSOC object
1266  * @cap: feature flag to be cleared
1267  *
1268  * API to clear feature caps in psoc
1269  *
1270  * Return: void
1271  */
1272 static inline void wlan_psoc_nif_feat_cap_clear(struct wlan_objmgr_psoc *psoc,
1273 				uint32_t feat_cap)
1274 {
1275 	psoc->soc_nif.soc_feature_caps &= ~feat_cap;
1276 }
1277 
1278 /**
1279  * wlan_psoc_nif_feat_cap_get() - get feature caps
1280  * @psoc: PSOC object
1281  * @cap: feature flag to be checked
1282  *
1283  * API to know, whether particular feature cap flag is set in psoc
1284  *
1285  * Return: 1 (for set) or 0 (for not set)
1286  */
1287 static inline uint8_t wlan_psoc_nif_feat_cap_get(struct wlan_objmgr_psoc *psoc,
1288 							uint32_t feat_cap)
1289 {
1290 	return (psoc->soc_nif.soc_feature_caps & feat_cap) ? 1 : 0;
1291 }
1292 
1293 /**
1294  * wlan_psoc_nif_op_flag_get() - get op flags
1295  * @psoc: PSOC object
1296  * @flag: op flag to be checked
1297  *
1298  * API to know, whether particular op flag is set in psoc
1299  *
1300  * Return: 1 (for set) or 0 (for not set)
1301  */
1302 static inline uint8_t wlan_psoc_nif_op_flag_get(struct wlan_objmgr_psoc *psoc,
1303 						uint32_t flag)
1304 {
1305 	return (psoc->soc_nif.soc_op_flags & flag) ? 1 : 0;
1306 }
1307 
1308 /**
1309  * wlan_psoc_nif_op_flag_set() - set op flag
1310  * @psoc: PSOC object
1311  * @flag: op flag to be set
1312  *
1313  * API to set op flag in psoc
1314  *
1315  * Return: void
1316  */
1317 static inline void wlan_psoc_nif_op_flag_set(struct wlan_objmgr_psoc *psoc,
1318 						uint32_t flag)
1319 {
1320 	psoc->soc_nif.soc_op_flags |= flag;
1321 }
1322 
1323 /**
1324  * wlan_psoc_nif_op_flag_clear() - clear op flag
1325  * @psoc: PSOC object
1326  * @flag: op flag to be cleared
1327  *
1328  * API to clear op flag in psoc
1329  *
1330  * Return: void
1331  */
1332 static inline void wlan_psoc_nif_op_flag_clear(struct wlan_objmgr_psoc *psoc,
1333 						uint32_t flag)
1334 {
1335 	psoc->soc_nif.soc_op_flags &= ~flag;
1336 }
1337 
1338 /**
1339  * wlan_psoc_set_hw_macaddr() - set hw mac addr
1340  * @psoc: PSOC object
1341  * @macaddr: hw macaddr
1342  *
1343  * API to set hw macaddr of psoc
1344  *
1345  * Caller need to acquire lock with wlan_psoc_obj_lock()
1346  *
1347  * Return: void
1348  */
1349 static inline void wlan_psoc_set_hw_macaddr(struct wlan_objmgr_psoc *psoc,
1350 					uint8_t *macaddr)
1351 {
1352 	/* This API is invoked with lock acquired, do not add log prints */
1353 	if (psoc)
1354 		WLAN_ADDR_COPY(psoc->soc_nif.soc_hw_macaddr, macaddr);
1355 }
1356 
1357 /**
1358  * wlan_psoc_get_hw_macaddr() - get hw macaddr
1359  * @psoc: PSOC object
1360  *
1361  * API to set hw macaddr of psoc
1362  *
1363  * Return: hw macaddr
1364  */
1365 static inline uint8_t *wlan_psoc_get_hw_macaddr(struct wlan_objmgr_psoc *psoc)
1366 {
1367 	if (!psoc)
1368 		return NULL;
1369 
1370 	return psoc->soc_nif.soc_hw_macaddr;
1371 }
1372 
1373 /**
1374  * wlan_objmgr_psoc_get_comp_private_obj(): API to retrieve component object
1375  * @psoc: Psoc pointer
1376  * @id: component id
1377  *
1378  * This API is used to get the component private object pointer tied to the
1379  * corresponding psoc object
1380  *
1381  * Return: Component private object
1382  */
1383 void *wlan_objmgr_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc,
1384 					enum wlan_umac_comp_id id);
1385 /**
1386  * wlan_psoc_get_pdev_count() - get pdev count for psoc
1387  * @psoc: PSOC object
1388  *
1389  * API to get number of pdev's attached to the psoc
1390  *
1391  * Return: number of pdev's
1392  */
1393 static inline uint8_t wlan_psoc_get_pdev_count(struct wlan_objmgr_psoc *psoc)
1394 {
1395 	if (!psoc)
1396 		return 0;
1397 
1398 	return psoc->soc_objmgr.wlan_pdev_count;
1399 }
1400 
1401 /**
1402  * wlan_psoc_set_tgt_if_handle(): API to set target if handle in psoc object
1403  * @psoc: Psoc pointer
1404  * @tgt_if_handle: target interface handle
1405  *
1406  * API to set target interface handle in psoc object
1407  *
1408  * Return: None
1409  */
1410 static inline
1411 void wlan_psoc_set_tgt_if_handle(struct wlan_objmgr_psoc *psoc,
1412 				 target_psoc_info_t *tgt_if_handle)
1413 {
1414 	if (!psoc)
1415 		return;
1416 
1417 	psoc->tgt_if_handle = tgt_if_handle;
1418 }
1419 
1420 /**
1421  * wlan_psoc_get_tgt_if_handle(): API to get target interface handle
1422  * @psoc: Psoc pointer
1423  *
1424  * API to get target interface handle from psoc object
1425  *
1426  * Return: target interface handle
1427  */
1428 static inline
1429 target_psoc_info_t *wlan_psoc_get_tgt_if_handle(struct wlan_objmgr_psoc *psoc)
1430 {
1431 	if (!psoc)
1432 		return NULL;
1433 
1434 	return psoc->tgt_if_handle;
1435 }
1436 
1437 /**
1438  * wlan_psoc_get_qdf_dev(): API to get qdf device
1439  * @psoc: Psoc pointer
1440  *
1441  * API to get qdf device from psoc object
1442  *
1443  * Return: qdf_device_t
1444  */
1445 static inline qdf_device_t wlan_psoc_get_qdf_dev(
1446 			struct wlan_objmgr_psoc *psoc)
1447 {
1448 	if (!psoc)
1449 		return NULL;
1450 
1451 	return psoc->soc_objmgr.qdf_dev;
1452 }
1453 
1454 /**
1455  * wlan_psoc_set_qdf_dev(): API to get qdf device
1456  * @psoc: Psoc pointer
1457  * dev: qdf device
1458  *
1459  * API to set qdf device from psoc object
1460  *
1461  * Return: None
1462  */
1463 static inline void wlan_psoc_set_qdf_dev(
1464 			struct wlan_objmgr_psoc *psoc,
1465 			qdf_device_t dev)
1466 {
1467 	if (!psoc)
1468 		return;
1469 
1470 	psoc->soc_objmgr.qdf_dev = dev;
1471 }
1472 
1473 /**
1474  * wlan_psoc_set_max_vdev_count() - set psoc max vdev count
1475  * @psoc: PSOC object
1476  * @vdev count: Max vdev count
1477  *
1478  * API to set Max vdev count
1479  *
1480  * Return: void
1481  */
1482 static inline void wlan_psoc_set_max_vdev_count(struct wlan_objmgr_psoc *psoc,
1483 						uint8_t max_vdev_count)
1484 {
1485 	psoc->soc_objmgr.max_vdev_count = max_vdev_count;
1486 }
1487 
1488 /**
1489  * wlan_psoc_get_max_vdev_count() - get psoc max vdev count
1490  * @psoc: PSOC object
1491  *
1492  * API to set Max vdev count
1493  *
1494  * Return: @vdev count: Max vdev count
1495  */
1496 static inline uint8_t wlan_psoc_get_max_vdev_count(
1497 					struct wlan_objmgr_psoc *psoc)
1498 {
1499 	return psoc->soc_objmgr.max_vdev_count;
1500 }
1501 
1502 /**
1503  * wlan_psoc_set_max_peer_count() - set psoc max peer count
1504  * @psoc: PSOC object
1505  * @peer count: Max peer count
1506  *
1507  * API to set Max peer count
1508  *
1509  * Return: void
1510  */
1511 static inline void wlan_psoc_set_max_peer_count(struct wlan_objmgr_psoc *psoc,
1512 						uint16_t max_peer_count)
1513 {
1514 	psoc->soc_objmgr.max_peer_count = max_peer_count;
1515 }
1516 
1517 /**
1518  * wlan_psoc_get_max_peer_count() - get psoc max peer count
1519  * @psoc: PSOC object
1520  *
1521  * API to set Max peer count
1522  *
1523  * Return: @peer count: Max peer count
1524  */
1525 static inline uint16_t wlan_psoc_get_max_peer_count(
1526 					struct wlan_objmgr_psoc *psoc)
1527 {
1528 	return psoc->soc_objmgr.max_peer_count;
1529 }
1530 
1531 /**
1532  * wlan_psoc_get_peer_count() - get psoc peer count
1533  * @psoc: PSOC object
1534  *
1535  * API to get peer count
1536  *
1537  * Return: @peer count: peer count
1538  */
1539 static inline uint16_t wlan_psoc_get_peer_count(
1540 					struct wlan_objmgr_psoc *psoc)
1541 {
1542 	return psoc->soc_objmgr.wlan_peer_count;
1543 }
1544 
1545 
1546 /**
1547  * DOC: Examples to use PSOC ref count APIs
1548  *
1549  * In all the scenarios, the pair of API should be followed
1550  * other it lead to memory leak
1551  *
1552  *  scenario 1:
1553  *
1554  *     wlan_objmgr_psoc_obj_create()
1555  *     ----
1556  *     wlan_objmgr_psoc_obj_delete()
1557  *
1558  *  scenario 2:
1559  *
1560  *     wlan_objmgr_psoc_get_ref()
1561  *     ----
1562  *     the operations which are done on
1563  *     psoc object
1564  *     ----
1565  *     wlan_objmgr_psoc_release_ref()
1566  */
1567 
1568 /**
1569  * wlan_objmgr_psoc_get_ref() - increment ref count
1570  * @psoc: PSOC object
1571  * @id:   Object Manager ref debug id
1572  *
1573  * API to increment ref count of psoc
1574  *
1575  * Return: void
1576  */
1577 void wlan_objmgr_psoc_get_ref(struct wlan_objmgr_psoc *psoc,
1578 					wlan_objmgr_ref_dbgid id);
1579 
1580 /**
1581  * wlan_objmgr_psoc_try_get_ref() - increment ref count, if allowed
1582  * @psoc: PSOC object
1583  * @id:   Object Manager ref debug id
1584  *
1585  * API to increment ref count after checking valid object state
1586  *
1587  * Return: void
1588  */
1589 QDF_STATUS wlan_objmgr_psoc_try_get_ref(struct wlan_objmgr_psoc *psoc,
1590 						wlan_objmgr_ref_dbgid id);
1591 
1592 /**
1593  * wlan_objmgr_psoc_release_ref() - decrement ref count
1594  * @psoc: PSOC object
1595  * @id:   Object Manager ref debug id
1596  *
1597  * API to decrement ref count of psoc, if ref count is 1, it initiates the
1598  * PSOC deletion
1599  *
1600  * Return: void
1601  */
1602 void wlan_objmgr_psoc_release_ref(struct wlan_objmgr_psoc *psoc,
1603 						wlan_objmgr_ref_dbgid id);
1604 
1605 /**
1606  * wlan_objmgr_print_ref_all_objects_per_psoc() - print all psoc objects'
1607  *                                                ref counts
1608  * @psoc: PSOC object
1609  *
1610  * API to be used for printing all the objects(pdev/vdev/peer) ref counts
1611  *
1612  * Return: SUCCESS/FAILURE
1613  */
1614 QDF_STATUS wlan_objmgr_print_ref_all_objects_per_psoc(
1615 		struct wlan_objmgr_psoc *psoc);
1616 
1617 /**
1618 * wlan_objmgr_psoc_set_user_config () - populate user config
1619 * data in psoc
1620 * @psoc: psoc object pointer
1621 * @user_config_data: pointer to user config data filled up by os
1622 *                  dependent component
1623 * it is intended to set all elements by OSIF/HDD and it not
1624 * intended to modify a single element
1625 * Return: QDF status
1626 */
1627 QDF_STATUS wlan_objmgr_psoc_set_user_config(struct wlan_objmgr_psoc *psoc,
1628 		struct wlan_objmgr_psoc_user_config *user_config_data);
1629 
1630 /**
1631  * wlan_objmgr_psoc_check_for_pdev_leaks() - Assert no pdevs attached to @psoc
1632  * @psoc: The psoc to check
1633  *
1634  * Return: No. of psoc leaks
1635  */
1636 uint32_t wlan_objmgr_psoc_check_for_pdev_leaks(struct wlan_objmgr_psoc *psoc);
1637 
1638 /**
1639  * wlan_objmgr_psoc_check_for_vdev_leaks() - Assert no vdevs attached to @psoc
1640  * @psoc: The psoc to check
1641  *
1642  * Return: No. of vdev leaks
1643  */
1644 uint32_t wlan_objmgr_psoc_check_for_vdev_leaks(struct wlan_objmgr_psoc *psoc);
1645 
1646 /**
1647  * wlan_objmgr_psoc_check_for_peer_leaks() - Assert no peers attached to @psoc
1648  * @psoc: The psoc to check
1649  *
1650  * Return: No. of peer leaks
1651  */
1652 uint32_t wlan_objmgr_psoc_check_for_peer_leaks(struct wlan_objmgr_psoc *psoc);
1653 
1654 /**
1655  * wlan_objmgr_psoc_check_for_leaks() - Assert on leak
1656  * @psoc: The psoc to check
1657  *
1658  * Return: None
1659  */
1660 void wlan_objmgr_psoc_check_for_leaks(struct wlan_objmgr_psoc *psoc);
1661 
1662 /**
1663 * wlan_objmgr_psoc_get_band_capability () - get user config
1664 * data for band capability
1665 * @psoc: psoc object pointer
1666 *
1667 * Return: band_capability
1668 */
1669 static inline uint8_t wlan_objmgr_psoc_get_band_capability(
1670 		struct wlan_objmgr_psoc *psoc)
1671 {
1672 	if (!psoc)
1673 		return 0;
1674 
1675 	return psoc->soc_nif.user_config.band_capability;
1676 }
1677 
1678 /**
1679  * wlan_psoc_set_dp_handle() - set dp handle
1680  * @psoc: psoc object pointer
1681  * @dp_handle: Data path module handle
1682  *
1683  * Return: void
1684  */
1685 static inline void wlan_psoc_set_dp_handle(struct wlan_objmgr_psoc *psoc,
1686 		void *dp_handle)
1687 {
1688 	if (qdf_unlikely(!psoc)) {
1689 		QDF_BUG(0);
1690 		return;
1691 	}
1692 
1693 	psoc->dp_handle = dp_handle;
1694 }
1695 
1696 /**
1697  * wlan_psoc_get_dp_handle() - get dp handle
1698  * @psoc: psoc object pointer
1699  *
1700  * Return: dp handle
1701  */
1702 static inline void *wlan_psoc_get_dp_handle(struct wlan_objmgr_psoc *psoc)
1703 {
1704 	if (qdf_unlikely(!psoc)) {
1705 		QDF_BUG(0);
1706 		return NULL;
1707 	}
1708 
1709 	return psoc->dp_handle;
1710 }
1711 
1712 struct wlan_logically_del_peer {
1713 	qdf_list_node_t list;
1714 	struct wlan_objmgr_peer *peer;
1715 };
1716 
1717 /**
1718  * wlan_psoc_get_lmac_if_txops() - get lmac if txops for the psoc
1719  * @psoc: psoc object pointer
1720  *
1721  * Return: Pointer to wlan_lmac_if_tx_ops
1722  */
1723 static inline struct wlan_lmac_if_tx_ops *
1724 wlan_psoc_get_lmac_if_txops(struct wlan_objmgr_psoc *psoc)
1725 {
1726 	return &((psoc->soc_cb.tx_ops));
1727 }
1728 
1729 /**
1730  * wlan_psoc_get_id() - get psoc id
1731  * @psoc: PSOC object
1732  *
1733  * API to get psoc id
1734  *
1735  * Return: @psoc_id: psoc id
1736  */
1737 static inline uint8_t wlan_psoc_get_id(
1738 			struct wlan_objmgr_psoc *psoc)
1739 {
1740 	if (!psoc)
1741 		return (uint8_t)-1;
1742 
1743 	return psoc->soc_objmgr.psoc_id;
1744 }
1745 
1746 /**
1747  * wlan_print_psoc_info() - print psoc members
1748  * @psoc: psoc object pointer
1749  *
1750  * Return: void
1751  */
1752 #ifdef WLAN_OBJMGR_DEBUG
1753 void wlan_print_psoc_info(struct wlan_objmgr_psoc *psoc);
1754 #else
1755 static inline void wlan_print_psoc_info(struct wlan_objmgr_psoc *psoc) {}
1756 #endif
1757 
1758 #endif /* _WLAN_OBJMGR_PSOC_OBJ_H_*/
1759