xref: /wlan-dirver/qca-wifi-host-cmn/target_if/core/inc/target_if.h (revision bd23cf7dccea2c964087a8e7bb3abed720075ec8)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: This target interface shall be used
22  *      to communicate with target using WMI.
23  */
24 #ifndef _WLAN_TARGET_IF_H_
25 #define _WLAN_TARGET_IF_H_
26 
27 #include "qdf_types.h"
28 #include "qdf_util.h"
29 #include "wlan_objmgr_psoc_obj.h"
30 #include "wmi_unified_api.h"
31 #include "wmi_unified_priv.h"
32 #include "wmi_unified_param.h"
33 
34 #define TGT_WMI_PDEV_ID_SOC	0	/* WMI SOC ID */
35 
36 /* ASCII "TGT\0" */
37 #define TGT_MAGIC 0x54575400
38 
39 #define target_if_fatal(params...) \
40 	QDF_TRACE_FATAL(QDF_MODULE_ID_TARGET_IF, params)
41 #define target_if_err(params...) \
42 	QDF_TRACE_ERROR(QDF_MODULE_ID_TARGET_IF, params)
43 #define target_if_warn(params...) \
44 	QDF_TRACE_WARN(QDF_MODULE_ID_TARGET_IF, params)
45 #define target_if_info(params...) \
46 	QDF_TRACE_INFO(QDF_MODULE_ID_TARGET_IF, params)
47 #define target_if_debug(params...) \
48 	QDF_TRACE_DEBUG(QDF_MODULE_ID_TARGET_IF, params)
49 #define TARGET_IF_ENTER() \
50 	QDF_TRACE_ENTER(QDF_MODULE_ID_TARGET_IF, "enter")
51 #define TARGET_IF_EXIT() \
52 	QDF_TRACE_EXIT(QDF_MODULE_ID_TARGET_IF, "exit")
53 #define target_if_err_rl(params...) \
54 	QDF_TRACE_ERROR_RL(QDF_MODULE_ID_TARGET_IF, params)
55 
56 
57 #define targetif_nofl_fatal(params...) \
58 	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
59 #define targetif_nofl_err(params...) \
60 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
61 #define targetif_nofl_warn(params...) \
62 	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
63 #define targetif_nofl_info(params...) \
64 	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
65 #define targetif_nofl_debug(params...) \
66 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
67 
68 typedef struct wlan_objmgr_psoc *(*get_psoc_handle_callback)(
69 			void *scn_handle);
70 
71 typedef struct wlan_objmgr_pdev *(*get_pdev_handle_callback)(
72 			void *scn_handle);
73 
74 typedef int (*wmi_legacy_service_ready_callback)(uint32_t event_id,
75 						void *handle,
76 						uint8_t *event_data,
77 						uint32_t length);
78 
79 /**
80  * struct target_if_ctx - target_interface context
81  * @magic: magic for target if ctx
82  * @get_psoc_hdl_cb:  function pointer to get psoc
83  * @get_pdev_hdl_cb:  function pointer to get pdev
84  * @lock: spin lock for protecting the ctx
85  */
86 struct target_if_ctx {
87 	uint32_t magic;
88 	get_psoc_handle_callback get_psoc_hdl_cb;
89 	get_pdev_handle_callback get_pdev_hdl_cb;
90 	wmi_legacy_service_ready_callback service_ready_cb;
91 	qdf_spinlock_t lock;
92 };
93 
94 struct target_psoc_info;
95 /**
96  * struct host_fw_ver - holds host fw version
97  * @host_ver: Host version
98  * @target_ver: Target version ID
99  * @target_rev: Target revision ID
100  * @wlan_ver: FW SW version
101  * @wlan_ver_1: FW SW version second dword
102  * @abi_ver: ABI version
103  */
104 struct host_fw_ver {
105 	uint32_t host_ver;
106 	uint32_t target_ver;
107 	uint32_t target_rev;
108 	uint32_t wlan_ver;
109 	uint32_t wlan_ver_1;
110 	uint32_t abi_ver;
111 };
112 
113 struct common_dbglog_handle;
114 struct common_accelerator_handle;
115 
116 /**
117  * struct comp_hdls - Non-umac/lower layer components handles, it is a sub
118  *                    structure of target psoc information
119  * @hif_hdl: HIF handle
120  * @htc_hdl: HTC handle
121  * @wmi_hdl: WMI handle
122  * @accelerator_hdl: NSS offload/IPA handle
123  * @dbglog_hdl: Debug log handle
124  */
125 struct comp_hdls {
126 	struct hif_opaque_softc *hif_hdl;
127 	HTC_HANDLE htc_hdl;
128 	struct wmi_unified *wmi_hdl;
129 	struct common_accelerator_handle *accelerator_hdl;
130 	struct common_dbglog_handle *dbglog_hdl;
131 };
132 
133 /**
134  * struct target_supported_modes - List of HW modes supported by target.
135  *
136  * @num_modes: Number of modes supported
137  * @hw_mode_ids: List of HW mode ids
138  * @phy_bit_map: List of Phy bit maps
139  */
140 struct target_supported_modes {
141 	uint8_t num_modes;
142 	uint32_t hw_mode_ids[WMI_HOST_HW_MODE_MAX];
143 	uint32_t phy_bit_map[WMI_HOST_HW_MODE_MAX];
144 };
145 
146 /**
147  * struct target_version_info - Target version information
148  *
149  * @reg_db_version_major: REG DB version major
150  * @reg_db_version_minor: REG DB version minor
151  * @bdf_reg_db_version_major: BDF REG DB version major
152  * @bdf_reg_db_version_minor: BDF REG DB version minor
153  */
154 struct target_version_info {
155 	uint8_t reg_db_version_major;
156 	uint8_t reg_db_version_minor;
157 	uint8_t bdf_reg_db_version_major;
158 	uint8_t bdf_reg_db_version_minor;
159 };
160 
161 /**
162  * struct tgt_info - FW or lower layer related info(required by target_if),
163  *                   it is a sub structure of taarget psoc information
164  * @version: Host FW version struct
165  * @wlan_res_cfg:  target_resource_config info
166  * @wlan_ext_res_cfg: wmi_host_ext_resource_config info
167  * @wmi_service_ready: is service ready received
168  * @wmi_ready: is ready event received
169  * @total_mac_phy_cnt: num of mac phys
170  * @num_radios: number of radios
171  * @wlan_init_status: Target init status
172  * @target_type: Target type
173  * @max_descs: Max descriptors
174  * @preferred_hw_mode: preferred hw mode
175  * @wmi_timeout: wait timeout for target events
176  * @event: qdf_event for target events
177  * @service_bitmap: WMI service bitmap
178  * @target_cap: target capabilities
179  * @service_ext2_param: service ready ext2 event params
180  * @service_ext_param: ext service params
181  * @mac_phy_cap: phy caps array
182  * @mac_phy_caps_ext2: mac phy caps ext2 params
183  * @dbr_ring_cap: dbr_ring capability info
184  * @reg_cap: regulatory caps array
185  * @scaling_params: Spectral bin scaling parameters
186  * @num_mem_chunks: number of mem chunks allocated
187  * @hw_mode_caps: HW mode caps of preferred mode
188  * @mem_chunks: allocated memory blocks for FW
189  * @scan_radio_caps: scan radio capabilities
190  * @device_mode: Global Device mode
191  * @sbs_lower_band_end_freq: sbs lower band end frequency
192  */
193 struct tgt_info {
194 	struct host_fw_ver version;
195 	target_resource_config wlan_res_cfg;
196 	wmi_host_ext_resource_config wlan_ext_res_cfg;
197 	bool wmi_service_ready;
198 	bool wmi_ready;
199 	uint8_t total_mac_phy_cnt;
200 	uint8_t num_radios;
201 	uint32_t wlan_init_status;
202 	uint32_t target_type;
203 	uint32_t max_descs;
204 	uint32_t preferred_hw_mode;
205 	uint32_t wmi_timeout;
206 	qdf_event_t event;
207 	uint32_t service_bitmap[PSOC_SERVICE_BM_SIZE];
208 	struct wlan_psoc_target_capability_info target_caps;
209 	struct wlan_psoc_host_service_ext_param service_ext_param;
210 	struct wlan_psoc_host_service_ext2_param service_ext2_param;
211 	struct wlan_psoc_host_mac_phy_caps
212 			mac_phy_cap[PSOC_MAX_MAC_PHY_CAP];
213 	struct wlan_psoc_host_mac_phy_caps_ext2
214 			mac_phy_caps_ext2[PSOC_MAX_MAC_PHY_CAP];
215 	struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap;
216 	struct wlan_psoc_host_spectral_scaling_params *scaling_params;
217 	uint32_t num_mem_chunks;
218 	struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
219 	struct wlan_psoc_host_hw_mode_caps hw_mode_cap;
220 	struct target_supported_modes hw_modes;
221 	uint8_t pdev_id_to_phy_id_map[WLAN_UMAC_MAX_PDEVS];
222 	bool is_pdevid_to_phyid_map;
223 	struct wlan_psoc_host_scan_radio_caps *scan_radio_caps;
224 	uint32_t device_mode;
225 	uint32_t sbs_lower_band_end_freq;
226 };
227 
228 /**
229  * struct target_ops - Holds feature specific function pointers, which would be
230  *                     invoked as part of service ready or ext service ready
231  * @ext_resource_config_enable: Ext resource config
232  * @peer_config: Peer config enable
233  * @mesh_support_enable: Mesh support enable
234  * @smart_antenna_enable: Smart antenna enable
235  * @atf_config_enable: ATF config enable
236  * @qwrap_config_enable: QWRAP config enable
237  * @btcoex_config_enable: BTCOEX config enable
238  * @lteu_ext_support_enable: LTE-U Ext config enable
239  * @set_init_cmd_dev_based_params: Sets Init command params
240  * @alloc_pdevs: Allocates PDEVs
241  * @update_pdev_tgt_info: Updates PDEV target info
242  * @mem_mgr_alloc_chunk: Allocates memory through MEM manager
243  * @mem_mgr_free_chunks: Free memory chunks through MEM manager
244  * @print_svc_ready_ex_param: Print service ready ext params
245  * @add_11ax_modes: Adds 11ax modes to reg cap
246  * @set_default_tgt_config: Sets target config with default values
247  * @sw_version_check: Checks the SW version
248  * @smart_log_enable: Enable Smart Logs feature
249  * @cfr_support_enable: CFR support enable
250  * @set_pktlog_checksum: Set the pktlog checksum from FW ready event to pl_dev
251  * @csa_switch_count_status: CSA event handler
252  */
253 struct target_ops {
254 	QDF_STATUS (*ext_resource_config_enable)
255 		(struct wlan_objmgr_psoc *psoc,
256 		 struct target_psoc_info *tgt_info, uint8_t *event);
257 	void (*peer_config)
258 		(struct wlan_objmgr_psoc *psoc,
259 		 struct target_psoc_info *tgt_info, uint8_t *event);
260 	void (*mesh_support_enable)
261 		(struct wlan_objmgr_psoc *psoc,
262 		 struct target_psoc_info *tgt_info, uint8_t *event);
263 	void (*smart_antenna_enable)
264 		(struct wlan_objmgr_psoc *psoc,
265 		 struct target_psoc_info *tgt_info, uint8_t *event);
266 	void (*atf_config_enable)
267 		(struct wlan_objmgr_psoc *psoc,
268 		 struct target_psoc_info *tgt_info, uint8_t *event);
269 	void (*qwrap_config_enable)
270 		(struct wlan_objmgr_psoc *psoc,
271 		 struct target_psoc_info *tgt_info, uint8_t *event);
272 	void (*btcoex_config_enable)
273 		(struct wlan_objmgr_psoc *psoc,
274 		 struct target_psoc_info *tgt_info, uint8_t *event);
275 	void (*lteu_ext_support_enable)
276 		(struct wlan_objmgr_psoc *psoc,
277 		 struct target_psoc_info *tgt_info, uint8_t *event);
278 	void (*set_init_cmd_dev_based_params)
279 		(struct wlan_objmgr_psoc *psoc,
280 		 struct target_psoc_info *tgt_info);
281 	QDF_STATUS (*alloc_pdevs)
282 		(struct wlan_objmgr_psoc *psoc,
283 		 struct target_psoc_info *tgt_info);
284 	QDF_STATUS (*update_pdev_tgt_info)
285 		(struct wlan_objmgr_psoc *psoc,
286 		 struct target_psoc_info *tgt_info);
287 	uint32_t (*mem_mgr_alloc_chunk)(struct wlan_objmgr_psoc *psoc,
288 		struct target_psoc_info *tgt_info,
289 		u_int32_t req_id, u_int32_t idx, u_int32_t num_units,
290 		u_int32_t unit_len, u_int32_t num_unit_info);
291 	QDF_STATUS (*mem_mgr_free_chunks)(struct wlan_objmgr_psoc *psoc,
292 			struct target_psoc_info *tgt_hdl);
293 	void (*print_svc_ready_ex_param)(
294 		 struct wlan_objmgr_psoc *psoc,
295 		 struct target_psoc_info *tgt_info);
296 	void (*add_11ax_modes)(
297 		 struct wlan_objmgr_psoc *psoc,
298 		 struct target_psoc_info *tgt_info);
299 	void (*set_default_tgt_config)(
300 		 struct wlan_objmgr_psoc *psoc,
301 		 struct target_psoc_info *tgt_info);
302 	QDF_STATUS (*sw_version_check)(
303 		 struct wlan_objmgr_psoc *psoc,
304 		 struct target_psoc_info *tgt_hdl,
305 		 uint8_t *evt_buf);
306 	void (*eapol_minrate_enable)
307 		(struct wlan_objmgr_psoc *psoc,
308 		 struct target_psoc_info *tgt_info, uint8_t *event);
309 	void (*cfr_support_enable)
310 		(struct wlan_objmgr_psoc *psoc,
311 		 struct target_psoc_info *tgt_info, uint8_t *event);
312 	void (*set_pktlog_checksum)
313 		(struct wlan_objmgr_pdev *pdev, uint32_t checksum);
314 	int (*csa_switch_count_status)(
315 		struct wlan_objmgr_psoc *psoc,
316 		struct pdev_csa_switch_count_status csa_status);
317 };
318 
319 
320 
321 /**
322  * struct target_psoc_info - target psoc information
323  * @hdls: component handles (htc/htt/wmi) sub structure
324  * @info: target related info sub structure
325  * @feature_ptr: stores legacy pointer or few driver specific structures
326  * @tif_ops: holds driver specific function pointers
327  */
328 struct target_psoc_info {
329 	struct comp_hdls hdls;
330 	struct tgt_info info;
331 	void *feature_ptr;
332 	struct target_ops *tif_ops;
333 };
334 
335 /**
336  * struct target_pdev_info - target pdev information
337  * @wmi_handle: WMI handle
338  * @accelerator_hdl: NSS offload/IPA handles
339  * @pdev_idx: pdev id (of FW)
340  * @phy_idx: phy id (of FW)
341  * @hw_link_id: Unique link id across SoC required in multi-soc ML
342  * @feature_ptr: stores legacy pointer or few driver specific structures
343  */
344 struct target_pdev_info {
345 	struct wmi_unified *wmi_handle;
346 	struct common_accelerator_handle *accelerator_hdl;
347 	int32_t pdev_idx;
348 	int32_t phy_idx;
349 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
350 	uint16_t hw_link_id;
351 #endif
352 	void *feature_ptr;
353 };
354 
355 /**
356  * struct target_mu_caps - max number of users per-PPDU for OFDMA/MU-MIMO
357  * @ofdma_dl: max users for Downlink OFDMA transmissions
358  * @ofdma_ul: max users for Uplink OFDMA transmissions
359  * @mumimo_dl: max users for Downlink MU-MIMO transmissions
360  * @mumimo_ul: max users for Uplink MU-MIMO transmissions
361  */
362 struct target_mu_caps {
363 	uint16_t ofdma_dl;
364 	uint16_t ofdma_ul;
365 	uint16_t mumimo_dl;
366 	uint16_t mumimo_ul;
367 };
368 
369 
370 /**
371  * target_if_init() - target_if Initialization
372  * @get_wmi_handle: function pointer to get wmi handle
373  *
374  *
375  * Return: QDF_STATUS
376  */
377 QDF_STATUS target_if_init(get_psoc_handle_callback psoc_hdl_cb);
378 
379 /**
380  * target_if_deinit() - Close target_if
381  * @scn_handle: scn handle
382  *
383  * Return: QDF_STATUS_SUCCESS - in case of success
384  */
385 QDF_STATUS target_if_deinit(void);
386 
387 /**
388  * target_if_store_pdev_target_if_ctx() - stores objmgr pdev in target if ctx
389  * @pdev_hdl_cb: function pointer to get objmgr pdev
390  *
391  * Return: QDF_STATUS_SUCCESS - in case of success
392  */
393 QDF_STATUS target_if_store_pdev_target_if_ctx(
394 		get_pdev_handle_callback pdev_hdl_cb);
395 
396 /**
397  * wlan_get_tgt_if_ctx() -Get target if ctx
398  *
399  * Return: target if ctx
400  */
401 struct target_if_ctx *target_if_get_ctx(void);
402 
403 /**
404  * target_if_get_psoc_from_scn_hdl() - get psoc from scn handle
405  * @scn_handle: scn handle
406  *
407  * This API is generally used while processing wmi event.
408  * In wmi event SCN handle will be passed by wmi hence
409  * using this API we can get psoc from scn handle.
410  *
411  * Return: index for matching scn handle
412  */
413 struct wlan_objmgr_psoc *target_if_get_psoc_from_scn_hdl(void *scn_handle);
414 
415 /**
416  * target_if_get_pdev_from_scn_hdl() - get pdev from scn handle
417  * @scn_handle: scn handle
418  *
419  * This API is generally used while processing wmi event.
420  * In wmi event SCN handle will be passed by wmi hence
421  * using this API we can get pdev from scn handle.
422  *
423  * Return: pdev for matching scn handle
424  */
425 struct wlan_objmgr_pdev *target_if_get_pdev_from_scn_hdl(void *scn_handle);
426 
427 /** target_if_register_tx_ops() - register tx_ops
428  * @tx_ops: tx_ops structure
429  *
430  * This function is to be used by components to populate
431  * the OL function pointers (tx_ops) required by the component
432  * for UMAC-LMAC interaction, with the appropriate handler
433  *
434  * Return: QDF STATUS
435  */
436 QDF_STATUS target_if_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
437 
438 /**
439  * target_if_get_psoc_legacy_service_ready_cb() - get psoc from scn handle
440  *
441  * This API is generally used while processing wmi event.
442  * In wmi event SCN handle will be passed by wmi hence
443  * using this API we can get psoc from scn handle.
444  *
445  * Return: wmi_legacy_service_ready_callback
446  */
447 wmi_legacy_service_ready_callback
448 		target_if_get_psoc_legacy_service_ready_cb(void);
449 
450 /**
451  * target_if_register_legacy_service_ready_cb() - get legacy
452  *                                       service ready handler from scn handle
453  *
454  * @service_ready_cb: function pointer to service ready callback
455  *
456  * Return: QDF Status
457  */
458 QDF_STATUS target_if_register_legacy_service_ready_cb(
459 	wmi_legacy_service_ready_callback service_ready_cb);
460 
461 /**
462  * target_if_alloc_pdev_tgt_info() - alloc pdev tgt info
463  * @pdev: pointer to pdev
464  *
465  * API to allocate memory for target_pdev_info
466  *
467  * Return: SUCCESS on successful memory allocation or Failure
468  */
469 QDF_STATUS target_if_alloc_pdev_tgt_info(struct wlan_objmgr_pdev *pdev);
470 
471 /**
472  * target_if_free_pdev_tgt_info() - free pdev tgt info
473  * @pdev: pointer to pdev
474  *
475  * API to free allocated memory for target_pdev_info
476  *
477  * Return: SUCCESS on successful memory deallocation or Failure
478  */
479 QDF_STATUS target_if_free_pdev_tgt_info(struct wlan_objmgr_pdev *pdev);
480 
481 /**
482  * target_if_alloc_psoc_tgt_info() - alloc psoc tgt info
483  * @psoc: pointer to psoc
484  *
485  * API to allocate memory for target_psoc_info
486  *
487  * Return: SUCCESS on successful memory allocation or Failure
488  */
489 QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc);
490 
491 /**
492  * target_if_free_psoc_tgt_info() - free psoc tgt info
493  * @psoc: pointer to psoc
494  *
495  * API to free allocated memory for target_psoc_info
496  *
497  * Return: SUCCESS on successful memory deallocation or Failure
498  */
499 QDF_STATUS target_if_free_psoc_tgt_info(struct wlan_objmgr_psoc *psoc);
500 
501 /**
502  * target_is_tgt_type_ar900b() - Check if the target type is AR900B
503  * @target_type: target type to be checked.
504  *
505  * Return: true if the target_type is AR900B, else false.
506  */
507 bool target_is_tgt_type_ar900b(uint32_t target_type);
508 
509 /**
510  * target_is_tgt_type_ipq4019() - Check if the target type is IPQ4019
511  * @target_type: target type to be checked.
512  *
513  * Return: true if the target_type is IPQ4019, else false.
514  */
515 bool target_is_tgt_type_ipq4019(uint32_t target_type);
516 
517 /**
518  * target_is_tgt_type_qca9984() - Check if the target type is QCA9984
519  * @target_type: target type to be checked.
520  *
521  * Return: true if the target_type is QCA9984, else false.
522  */
523 bool target_is_tgt_type_qca9984(uint32_t target_type);
524 
525 /**
526  * target_is_tgt_type_qca9888() - Check if the target type is QCA9888
527  * @target_type: target type to be checked.
528  *
529  * Return: true if the target_type is QCA9888, else false.
530  */
531 bool target_is_tgt_type_qca9888(uint32_t target_type);
532 
533 /**
534  * target_is_tgt_type_adrastea() - Check if the target type is QCS40X
535  * @target_type: target type to be checked.
536  *
537  * Return: true if the target_type is QCS40X, else false.
538  */
539 bool target_is_tgt_type_adrastea(uint32_t target_type);
540 
541 /**
542  * target_is_tgt_type_qcn9000() - Check if the target type is QCN9000 (pine)
543  * @target_type: target type to be checked.
544  *
545  * Return: true if the target_type is QCN9000, else false.
546  */
547 bool target_is_tgt_type_qcn9000(uint32_t target_type);
548 
549 /**
550  * target_is_tgt_type_qcn6122() - Check if the target type is QCN6122 (Spruce)
551  * @target_type: target type to be checked.
552  *
553  * Return: true if the target_type is QCN6122, else false.
554  */
555 bool target_is_tgt_type_qcn6122(uint32_t target_type);
556 
557 /**
558  * target_is_tgt_type_qcn7605() - Check if the target type is QCN7605
559  * @target_type: target type to be checked.
560  *
561  * Return: true if the target_type is QCN7605, else false.
562  */
563 bool target_is_tgt_type_qcn7605(uint32_t target_type);
564 
565 /**
566  * target_psoc_set_wlan_init_status() - set info wlan_init_status
567  * @psoc_info:          pointer to structure target_psoc_info
568  * @wlan_init_status:   FW init status
569  *
570  * API to set wlan_init_status
571  *
572  * Return: void
573  */
574 static inline void target_psoc_set_wlan_init_status
575 		(struct target_psoc_info *psoc_info, uint32_t wlan_init_status)
576 {
577 	if (!psoc_info)
578 		return;
579 
580 	psoc_info->info.wlan_init_status = wlan_init_status;
581 }
582 
583 /**
584  * target_psoc_get_wlan_init_status() - get info wlan_init_status
585  * @psoc_info:  pointer to structure target_psoc_info
586  *
587  * API to get wlan_init_status
588  *
589  * Return: uint32_t
590  */
591 static inline uint32_t target_psoc_get_wlan_init_status
592 		(struct target_psoc_info *psoc_info)
593 {
594 	if (!psoc_info)
595 		return (uint32_t)-1;
596 
597 	return psoc_info->info.wlan_init_status;
598 }
599 
600 /**
601  * target_psoc_set_target_type() - set info target_type
602  * @psoc_info:  pointer to structure target_psoc_info
603  * @target_type: Target type
604  *
605  * API to set target_type
606  *
607  * Return: void
608  */
609 static inline void target_psoc_set_target_type
610 		(struct target_psoc_info *psoc_info, uint32_t target_type)
611 {
612 	if (!psoc_info)
613 		return;
614 
615 	psoc_info->info.target_type = target_type;
616 }
617 
618 /**
619  * target_psoc_get_target_type() - get info target_type
620  * @psoc_info:  pointer to structure target_psoc_info
621  *
622  * API to get target_type
623  *
624  * Return: unit32_t
625  */
626 static inline uint32_t target_psoc_get_target_type
627 		(struct target_psoc_info *psoc_info)
628 {
629 	if (!psoc_info)
630 		return (uint32_t)-1;
631 
632 	return psoc_info->info.target_type;
633 }
634 
635 /**
636  * target_psoc_set_max_descs() - set info max_descs
637  * @psoc_info:  pointer to structure target_psoc_info
638  * @max_descs:  Max descriptors
639  *
640  * API to set max_descs
641  *
642  * Return: void
643  */
644 static inline void target_psoc_set_max_descs
645 		(struct target_psoc_info *psoc_info, uint32_t max_descs)
646 {
647 	if (!psoc_info)
648 		return;
649 
650 	psoc_info->info.max_descs = max_descs;
651 }
652 
653 /**
654  * target_psoc_get_max_descs() - get info max_descs
655  * @psoc_info:  pointer to structure target_psoc_info
656  *
657  * API to get max_descs
658  *
659  * Return: unint32_t
660  */
661 static inline uint32_t target_psoc_get_max_descs
662 		(struct target_psoc_info *psoc_info)
663 {
664 	if (!psoc_info)
665 		return (uint32_t)-1;
666 
667 	return psoc_info->info.max_descs;
668 }
669 
670 /**
671  * target_psoc_set_wmi_service_ready() - set info wmi_service_ready
672  * @psoc_info:         pointer to structure target_psoc_info
673  * @wmi_service_ready: service ready flag
674  *
675  * API to set wmi_service_ready
676  *
677  * Return: void
678  */
679 static inline void target_psoc_set_wmi_service_ready
680 		(struct target_psoc_info *psoc_info, bool wmi_service_ready)
681 {
682 	if (!psoc_info)
683 		return;
684 
685 	psoc_info->info.wmi_service_ready = wmi_service_ready;
686 }
687 
688 /**
689  * target_psoc_get_wmi_service_ready() - get info wmi_service_ready
690  * @psoc_info:  pointer to structure target_psoc_info
691  *
692  * API to get wmi_service_ready
693  *
694  * Return: bool
695  */
696 static inline bool target_psoc_get_wmi_service_ready
697 		(struct target_psoc_info *psoc_info)
698 {
699 	return psoc_info->info.wmi_service_ready;
700 }
701 
702 /**
703  * target_psoc_set_wmi_ready() - set info wmi_ready
704  * @psoc_info:  pointer to structure target_psoc_info
705  * @wmi_ready:  Ready event flag
706  *
707  * API to set wmi_ready
708  *
709  * Return: void
710  */
711 static inline void target_psoc_set_wmi_ready
712 		(struct target_psoc_info *psoc_info, bool wmi_ready)
713 {
714 	if (!psoc_info)
715 		return;
716 
717 	psoc_info->info.wmi_ready = wmi_ready;
718 }
719 
720 /**
721  * target_psoc_get_wmi_ready() - get info wmi_ready
722  * @psoc_info:  pointer to structure target_psoc_info
723  *
724  * API to get wmi_ready
725  *
726  * Return: bool
727  */
728 static inline bool target_psoc_get_wmi_ready
729 		(struct target_psoc_info *psoc_info)
730 {
731 	return psoc_info->info.wmi_ready;
732 }
733 
734 /**
735  * target_psoc_set_preferred_hw_mode() - set preferred_hw_mode
736  * @psoc_info:  pointer to structure target_psoc_info
737  * @preferred_hw_mode: Preferred HW mode
738  *
739  * API to set preferred_hw_mode
740  *
741  * Return: void
742  */
743 static inline void target_psoc_set_preferred_hw_mode(
744 		struct target_psoc_info *psoc_info, uint32_t preferred_hw_mode)
745 {
746 	if (!psoc_info)
747 		return;
748 
749 	psoc_info->info.preferred_hw_mode = preferred_hw_mode;
750 }
751 
752 /**
753  * target_psoc_get_preferred_hw_mode() - get preferred_hw_mode
754  * @psoc_info:  pointer to structure target_psoc_info
755  *
756  * API to get preferred_hw_mode
757  *
758  * Return: unint32_t
759  */
760 static inline uint32_t target_psoc_get_preferred_hw_mode
761 		(struct target_psoc_info *psoc_info)
762 {
763 	if (!psoc_info)
764 		return WMI_HOST_HW_MODE_MAX;
765 
766 	return psoc_info->info.preferred_hw_mode;
767 }
768 
769 /**
770  * target_psoc_get_supported_hw_modes() - get supported_hw_mode in target
771  * @psoc_info:  pointer to structure target_psoc_info
772  *
773  * API to get list of supported HW modes
774  *
775  * Return: pointer to target_supported_modes
776  */
777 static inline struct target_supported_modes *target_psoc_get_supported_hw_modes
778 		(struct target_psoc_info *psoc_info)
779 {
780 	if (!psoc_info)
781 		return NULL;
782 
783 	return &psoc_info->info.hw_modes;
784 }
785 
786 /**
787  * target_psoc_set_wmi_timeout() - set wmi_timeout
788  * @psoc_info:  pointer to structure target_psoc_info
789  * @wmi_timeout: WMI timeout value in sec
790  *
791  * API to set wmi_timeout
792  *
793  * Return: void
794  */
795 static inline void target_psoc_set_wmi_timeout
796 		(struct target_psoc_info *psoc_info, uint32_t wmi_timeout)
797 {
798 	if (!psoc_info)
799 		return;
800 
801 	psoc_info->info.wmi_timeout = wmi_timeout;
802 }
803 
804 /**
805  * target_psoc_get_wmi_timeout() - get wmi_timeout
806  * @psoc_info:  pointer to structure target_psoc_info
807  *
808  * API to get wmi_timeout
809  *
810  * Return: unint32_t
811  */
812 static inline uint32_t target_psoc_get_wmi_timeout
813 		(struct target_psoc_info *psoc_info)
814 {
815 	if (!psoc_info)
816 		return (uint32_t)-1;
817 
818 	return psoc_info->info.wmi_timeout;
819 }
820 
821 /**
822  * target_psoc_set_total_mac_phy_cnt() - set total_mac_phy
823  * @psoc_info:  pointer to structure target_psoc_infoa
824  * @total_mac_phy_cnt: Total MAC PHY cnt
825  *
826  * API to set total_mac_phy
827  *
828  * Return: void
829  */
830 static inline void target_psoc_set_total_mac_phy_cnt
831 		(struct target_psoc_info *psoc_info, uint8_t total_mac_phy_cnt)
832 {
833 	if (!psoc_info)
834 		return;
835 
836 	psoc_info->info.total_mac_phy_cnt = total_mac_phy_cnt;
837 }
838 
839 /**
840  * target_psoc_get_total_mac_phy_cnt() - get total_mac_phy
841  * @psoc_info:  pointer to structure target_psoc_info
842  *
843  * API to get total_mac_phy
844  *
845  * Return: unint8_t
846  */
847 static inline uint8_t target_psoc_get_total_mac_phy_cnt(
848 		struct target_psoc_info *psoc_info)
849 {
850 	if (!psoc_info)
851 		return 0;
852 
853 	return psoc_info->info.total_mac_phy_cnt;
854 }
855 
856 /**
857  * target_psoc_set_num_radios() - set num of radios
858  * @psoc_info:  pointer to structure target_psoc_info
859  * @num_radios: Number of radios
860  *
861  * API to set number of radios
862  *
863  * Return: number of radios
864  */
865 static inline void target_psoc_set_num_radios(
866 		struct target_psoc_info *psoc_info, uint8_t num_radios)
867 {
868 	if (!psoc_info)
869 		return;
870 
871 	psoc_info->info.num_radios = num_radios;
872 }
873 
874 /**
875  * target_psoc_set_pdev_id_to_phy_id_map() - set pdev to phy id mapping
876  * @psoc_info:  pointer to structure target_psoc_info
877  * @pdev_id: pdev id
878  * @phy_id: phy_id
879  *
880  * API to set pdev id to phy id mapping
881  *
882  * Return: void
883  */
884 static inline void target_psoc_set_pdev_id_to_phy_id_map(
885 		struct target_psoc_info *psoc_info,
886 		uint8_t *phy_id_map)
887 {
888 	if (!psoc_info)
889 		return;
890 
891 	psoc_info->info.is_pdevid_to_phyid_map = true;
892 	qdf_mem_copy(psoc_info->info.pdev_id_to_phy_id_map, phy_id_map,
893 		     PSOC_MAX_PHY_REG_CAP);
894 }
895 
896 /**
897  * target_psoc_get_num_radios() - get number of radios
898  * @psoc_info:  pointer to structure target_psoc_info
899  *
900  * API to get number_of_radios
901  *
902  * Return: number of radios
903  */
904 static inline uint8_t target_psoc_get_num_radios
905 		(struct target_psoc_info *psoc_info)
906 {
907 	if (!psoc_info)
908 		return 0;
909 
910 	return psoc_info->info.num_radios;
911 }
912 
913 /**
914  * target_psoc_get_num_radios_for_mode() - get number of radios for a hw-mode
915  * @psoc_info:  pointer to structure target_psoc_info
916  *
917  * API to get number_of_radios for a HW mode
918  *
919  * Return: number of radios
920  */
921 
922 static inline uint8_t target_psoc_get_num_radios_for_mode
923 		(struct target_psoc_info *psoc_info, uint8_t mode)
924 {
925 	uint8_t mac_phy_count;
926 	uint8_t num_radios = 0;
927 	struct tgt_info *info = &psoc_info->info;
928 
929 	if (!psoc_info)
930 		return 0;
931 
932 	for (mac_phy_count = 0;
933 		mac_phy_count < target_psoc_get_total_mac_phy_cnt(psoc_info);
934 		mac_phy_count++) {
935 		num_radios +=
936 		(info->mac_phy_cap[mac_phy_count].hw_mode_id == mode);
937 	}
938 
939 	return num_radios;
940 }
941 
942 /**
943  * target_psoc_set_service_bitmap() - set service_bitmap
944  * @psoc_info:  pointer to structure target_psoc_info
945  * @service_bitmap: FW service bitmap
946  *
947  * API to set service_bitmap
948  *
949  * Return: void
950  */
951 static inline void target_psoc_set_service_bitmap
952 		(struct target_psoc_info *psoc_info, uint32_t *service_bitmap)
953 {
954 	qdf_mem_copy(psoc_info->info.service_bitmap, service_bitmap,
955 			sizeof(psoc_info->info.service_bitmap));
956 }
957 
958 /**
959  * target_psoc_get_service_bitmap() - get service_bitmap
960  * @psoc_info:  pointer to structure target_psoc_info
961  *
962  * API to get service_bitmap
963  *
964  * Return: unint32_t
965  */
966 static inline uint32_t *target_psoc_get_service_bitmap
967 		(struct target_psoc_info *psoc_info)
968 {
969 	return psoc_info->info.service_bitmap;
970 }
971 
972 /**
973  * target_psoc_set_num_mem_chunks - set num_mem_chunks
974  * @psoc_info:  pointer to structure target_psoc_info
975  & @num_mem_chunks: Num Memory chunks allocated for FW
976  *
977  * API to set num_mem_chunks
978  *
979  * Return: void
980  */
981 static inline void target_psoc_set_num_mem_chunks(
982 		struct target_psoc_info *psoc_info, uint32_t num_mem_chunks)
983 {
984 	if (!psoc_info)
985 		return;
986 	psoc_info->info.num_mem_chunks = num_mem_chunks;
987 }
988 
989 /**
990  * target_psoc_get_num_mem_chunks() - get num_mem_chunks
991  * @psoc_info:  pointer to structure target_psoc_info
992  *
993  * API to get total_mac_phy
994  *
995  * Return: unint8_t
996  */
997 static inline uint32_t target_psoc_get_num_mem_chunks
998 		(struct target_psoc_info *psoc_info)
999 {
1000 	if (!psoc_info)
1001 		return (uint32_t)-1;
1002 
1003 	return psoc_info->info.num_mem_chunks;
1004 }
1005 /**
1006  * target_psoc_set_hif_hdl - set hif_hdl
1007  * @psoc_info:  pointer to structure target_psoc_info
1008  * @hif_hdl:    HIF handle
1009  *
1010  * API to set hif_hdl
1011  *
1012  * Return: void
1013  */
1014 static inline void target_psoc_set_hif_hdl
1015 		(struct target_psoc_info *psoc_info,
1016 		 struct hif_opaque_softc *hif_hdl)
1017 {
1018 	if (!psoc_info)
1019 		return;
1020 
1021 	psoc_info->hdls.hif_hdl = hif_hdl;
1022 }
1023 
1024 /**
1025  * target_psoc_get_hif_hdl() - get hif_hdl
1026  * @psoc_info:  pointer to structure target_psoc_info
1027  *
1028  * API to get hif_hdl
1029  *
1030  * Return: hif_hdl
1031  */
1032 static inline struct hif_opaque_softc *target_psoc_get_hif_hdl
1033 		(struct target_psoc_info *psoc_info)
1034 {
1035 	if (!psoc_info)
1036 		return NULL;
1037 
1038 	return psoc_info->hdls.hif_hdl;
1039 }
1040 
1041 /**
1042  * target_psoc_set_hif_hdl - set htc_hdl
1043  * @psoc_info:  pointer to structure target_psoc_info
1044  * @htc_hdl:    HTC handle
1045  *
1046  * API to set htc_hdl
1047  *
1048  * Return: void
1049  */
1050 static inline void target_psoc_set_htc_hdl(
1051 		struct target_psoc_info *psoc_info,
1052 		HTC_HANDLE htc_hdl)
1053 {
1054 	if (!psoc_info)
1055 		return;
1056 
1057 	psoc_info->hdls.htc_hdl = htc_hdl;
1058 }
1059 
1060 /**
1061  * target_psoc_get_htc_hdl() - get htc_hdl
1062  * @psoc_info:  pointer to structure target_psoc_info
1063  *
1064  * API to get htc_hdl
1065  *
1066  * Return: htc_hdl
1067  */
1068 static inline HTC_HANDLE target_psoc_get_htc_hdl
1069 		(struct target_psoc_info *psoc_info)
1070 {
1071 	if (!psoc_info)
1072 		return NULL;
1073 
1074 	return psoc_info->hdls.htc_hdl;
1075 }
1076 /**
1077  * target_psoc_set_wmi_hdl - set wmi_hdl
1078  * @psoc_info:  pointer to structure target_psoc_info
1079  * @wmi_hdl:    WMI handle
1080  *
1081  * API to set wmi_hdl
1082  *
1083  * Return: void
1084  */
1085 static inline void target_psoc_set_wmi_hdl
1086 		(struct target_psoc_info *psoc_info,
1087 		 struct wmi_unified *wmi_hdl)
1088 {
1089 	if (!psoc_info)
1090 		return;
1091 
1092 	psoc_info->hdls.wmi_hdl = wmi_hdl;
1093 }
1094 
1095 /**
1096  * target_psoc_get_wmi_hdl() - get wmi_hdl
1097  * @psoc_info:  pointer to structure target_psoc_info
1098  *
1099  * API to get wmi_hdl
1100  *
1101  * Return: wmi_hdl
1102  */
1103 static inline struct wmi_unified *target_psoc_get_wmi_hdl
1104 		(struct target_psoc_info *psoc_info)
1105 {
1106 	if (!psoc_info)
1107 		return NULL;
1108 
1109 	return psoc_info->hdls.wmi_hdl;
1110 }
1111 
1112 /**
1113  * target_psoc_set_accelerator_hdl - set accelerator_hdl
1114  * @psoc_info:  pointer to structure target_psoc_info
1115  * @accelerator_hdl: Accelator handle
1116  *
1117  * API to set accelerator_hdl
1118  *
1119  * Return: void
1120  */
1121 static inline void target_psoc_set_accelerator_hdl
1122 		(struct target_psoc_info *psoc_info,
1123 		 struct common_accelerator_handle *accelerator_hdl)
1124 {
1125 	if (!psoc_info)
1126 		return;
1127 
1128 	psoc_info->hdls.accelerator_hdl = accelerator_hdl;
1129 }
1130 
1131 /**
1132  * target_psoc_get_accelerator_hdl() - get accelerator_hdl
1133  * @psoc_info:  pointer to structure target_psoc_info
1134  *
1135  * API to get accelerator_hdl
1136  *
1137  * Return: accelerator_hdl
1138  */
1139 static inline
1140 struct common_accelerator_handle *target_psoc_get_accelerator_hdl
1141 		(struct target_psoc_info *psoc_info)
1142 {
1143 	if (!psoc_info)
1144 		return NULL;
1145 
1146 	return psoc_info->hdls.accelerator_hdl;
1147 }
1148 
1149 /**
1150  * target_psoc_set_feature_ptr - set feature_ptr
1151  * @psoc_info:  pointer to structure target_psoc_info
1152  * @feature_ptr: set feature pointer
1153  *
1154  * API to set feature_ptr
1155  *
1156  * Return: void
1157  */
1158 static inline void target_psoc_set_feature_ptr
1159 		(struct target_psoc_info *psoc_info, void *feature_ptr)
1160 {
1161 	if (!psoc_info)
1162 		return;
1163 
1164 	psoc_info->feature_ptr = feature_ptr;
1165 }
1166 
1167 /**
1168  * target_psoc_get_feature_ptr() - get feature_ptr
1169  * @psoc_info:  pointer to structure target_psoc_info
1170  *
1171  * API to get feature_ptr
1172  *
1173  * Return: feature_ptr
1174  */
1175 static inline void *target_psoc_get_feature_ptr
1176 		(struct target_psoc_info *psoc_info)
1177 {
1178 	if (!psoc_info)
1179 		return NULL;
1180 
1181 	return psoc_info->feature_ptr;
1182 }
1183 
1184 /**
1185  * target_psoc_get_version()- get host_fw_ver version
1186  * @psoc_info:  pointer to structure target_psoc_info
1187  *
1188  * API to get host_fw_ver version
1189  *
1190  * Return: void
1191  */
1192 static inline struct host_fw_ver *target_psoc_get_version
1193 		(struct target_psoc_info *psoc_info)
1194 {
1195 	return &psoc_info->info.version;
1196 }
1197 
1198 /**
1199  * target_psoc_get_target_ver()- get target version
1200  * @psoc_info:  pointer to structure target_psoc_info
1201  *
1202  * API to get target version
1203  *
1204  * Return: target version
1205  */
1206 static inline uint32_t target_psoc_get_target_ver
1207 		(struct target_psoc_info *psoc_info)
1208 {
1209 	return psoc_info->info.version.target_ver;
1210 }
1211 
1212 /**
1213  * target_psoc_set_target_ver()- set target version
1214  * @psoc_info:  pointer to structure target_psoc_info
1215  * @target_ver: Target version
1216  *
1217  * API to set target version
1218  *
1219  * Return: void
1220  */
1221 static inline void target_psoc_set_target_ver
1222 		(struct target_psoc_info *psoc_info, uint32_t target_ver)
1223 {
1224 	if (!psoc_info)
1225 		return;
1226 
1227 	psoc_info->info.version.target_ver = target_ver;
1228 }
1229 
1230 /**
1231  * target_psoc_set_target_rev()- set target revision
1232  * @psoc_info:  pointer to structure target_psoc_info
1233  * @target_rev: Target revision
1234  *
1235  * API to get target version
1236  *
1237  * Return: void
1238  */
1239 static inline void target_psoc_set_target_rev
1240 		(struct target_psoc_info *psoc_info, uint32_t target_rev)
1241 {
1242 	if (!psoc_info)
1243 		return;
1244 
1245 	psoc_info->info.version.target_rev = target_rev;
1246 }
1247 
1248 /**
1249  * target_psoc_get_target_rev()- get target revision
1250  * @psoc_info:  pointer to structure target_psoc_info
1251  *
1252  * API to get target revision
1253  *
1254  * Return: target revision
1255  */
1256 static inline uint32_t target_psoc_get_target_rev
1257 		(struct target_psoc_info *psoc_info)
1258 {
1259 	return psoc_info->info.version.target_rev;
1260 }
1261 
1262 /**
1263  * target_psoc_set_dbglog_hdl - set dbglog_hdl
1264  * @psoc_info:  pointer to structure target_psoc_info
1265  * @dbglog_hdl:    dbglog handle
1266  *
1267  * API to set dbglog_hdl
1268  *
1269  * Return: void
1270  */
1271 static inline void target_psoc_set_dbglog_hdl
1272 		(struct target_psoc_info *psoc_info,
1273 		 struct common_dbglog_handle *dbglog_hdl)
1274 {
1275 	if (!psoc_info)
1276 		return;
1277 
1278 	psoc_info->hdls.dbglog_hdl = dbglog_hdl;
1279 }
1280 
1281 /**
1282  * target_psoc_get_dbglog_hdl() - get dbglog_hdl
1283  * @psoc_info:  pointer to structure target_psoc_info
1284  *
1285  * API to get dbglog_hdl
1286  *
1287  * Return: dbglog_hdl
1288  */
1289 static inline struct common_dbglog_handle *target_psoc_get_dbglog_hdl
1290 		(struct target_psoc_info *psoc_info)
1291 {
1292 	if (!psoc_info)
1293 		return NULL;
1294 
1295 	return psoc_info->hdls.dbglog_hdl;
1296 }
1297 
1298 /**
1299  * target_psoc_get_wlan_res_cfg() - get wlan_res_cfg
1300  * @psoc_info:  pointer to structure target_psoc_info
1301  *
1302  * API to get wlan_res_cfg
1303  *
1304  * Return: structure pointer to host_fw_ver
1305  */
1306 static inline target_resource_config *target_psoc_get_wlan_res_cfg
1307 		(struct target_psoc_info *psoc_info)
1308 {
1309 	if (!psoc_info)
1310 		return NULL;
1311 
1312 	return &psoc_info->info.wlan_res_cfg;
1313 }
1314 
1315 /**
1316  * target_psoc_get_wlan_ext_res_cfg() - get wlan_ext_res_cfg
1317  * @psoc_info:  pointer to structure target_psoc_info
1318  *
1319  * API to get wlan_ext_res_cfg
1320  *
1321  * Return: structure pointer to wmi_host_ext_resource_config
1322  */
1323 static inline wmi_host_ext_resource_config *target_psoc_get_wlan_ext_res_cfg
1324 		(struct target_psoc_info *psoc_info)
1325 {
1326 	if (!psoc_info)
1327 		return NULL;
1328 
1329 	return &psoc_info->info.wlan_ext_res_cfg;
1330 }
1331 
1332 /**
1333  * target_psoc_get_event_queue() - get event_queue
1334  * @psoc_info:  pointer to structure target_psoc_info
1335  *
1336  * API to get event_queue
1337  *
1338  * Return: structure pointer to qdf_wait_queue_head_t
1339  */
1340 static inline qdf_event_t *target_psoc_get_event
1341 		(struct target_psoc_info *psoc_info)
1342 {
1343 	if (!psoc_info)
1344 		return NULL;
1345 
1346 	return &psoc_info->info.event;
1347 }
1348 
1349 /**
1350  * target_psoc_get_target_caps() - get target_caps
1351  * @psoc_info:  pointer to structure target_psoc_info
1352  *
1353  * API to get target_caps
1354  *
1355  * Return: structure pointer to wlan_psoc_target_capability_info
1356  */
1357 static inline struct wlan_psoc_target_capability_info
1358 		*target_psoc_get_target_caps(struct target_psoc_info *psoc_info)
1359 {
1360 	if (!psoc_info)
1361 		return NULL;
1362 
1363 	return &psoc_info->info.target_caps;
1364 }
1365 
1366 /**
1367  * target_psoc_get_service_ext_param() - get service_ext_param
1368  * @psoc_info:  pointer to structure target_psoc_info
1369  *
1370  * API to get service_ext_param
1371  *
1372  * Return: structure pointer to wlan_psoc_host_service_ext_param
1373  */
1374 static inline struct wlan_psoc_host_service_ext_param
1375 		*target_psoc_get_service_ext_param
1376 		(struct target_psoc_info *psoc_info)
1377 {
1378 	if (!psoc_info)
1379 		return NULL;
1380 
1381 	return &psoc_info->info.service_ext_param;
1382 }
1383 
1384 /**
1385  * target_psoc_get_num_dbr_ring_caps() - get no of dbr_ring_caps
1386  * @psoc_info:  pointer to structure target_psoc_info
1387  *
1388  * API to get num_dbr_ring_caps
1389  *
1390  * Return: no of dbr_ring_caps
1391  */
1392 static inline uint32_t target_psoc_get_num_dbr_ring_caps
1393 		(struct target_psoc_info *psoc_info)
1394 {
1395 	if (!psoc_info)
1396 		return 0;
1397 
1398 	if (psoc_info->info.service_ext_param.num_dbr_ring_caps)
1399 		return psoc_info->info.service_ext_param.num_dbr_ring_caps;
1400 
1401 	return psoc_info->info.service_ext2_param.num_dbr_ring_caps;
1402 }
1403 
1404 /**
1405  * target_psoc_get_num_scan_radio_caps() - get no of scan_radio_caps
1406  * @psoc_info:  pointer to structure target_psoc_info
1407  *
1408  * API to get num_scan_radio_caps
1409  *
1410  * Return: no of scan_radio_caps
1411  */
1412 static inline uint32_t target_psoc_get_num_scan_radio_caps
1413 		(struct target_psoc_info *psoc_info)
1414 {
1415 	if (!psoc_info)
1416 		return 0;
1417 
1418 	return psoc_info->info.service_ext2_param.num_scan_radio_caps;
1419 }
1420 
1421 /**
1422  * target_psoc_get_mac_phy_cap_for_mode() - get mac_phy_cap for a hw-mode
1423  * @psoc_info:  pointer to structure target_psoc_info
1424  *
1425  * API to get mac_phy_cap for a specified hw-mode
1426  *
1427  * Return: structure pointer to wlan_psoc_host_mac_phy_caps
1428  */
1429 
1430 static inline struct wlan_psoc_host_mac_phy_caps
1431 		*target_psoc_get_mac_phy_cap_for_mode
1432 		(struct target_psoc_info *psoc_info, uint8_t mode)
1433 {
1434 	uint8_t mac_phy_idx;
1435 	struct tgt_info *info = &psoc_info->info;
1436 
1437 	if (!psoc_info)
1438 		return NULL;
1439 
1440 	for (mac_phy_idx = 0;
1441 		mac_phy_idx < PSOC_MAX_MAC_PHY_CAP;
1442 			mac_phy_idx++)
1443 		if (info->mac_phy_cap[mac_phy_idx].hw_mode_id == mode)
1444 			break;
1445 
1446 	if (mac_phy_idx == PSOC_MAX_MAC_PHY_CAP)
1447 		return NULL;
1448 
1449 	return &info->mac_phy_cap[mac_phy_idx];
1450 }
1451 
1452 /**
1453  * target_psoc_get_mac_phy_cap_ext2_for_mode() - get mac_phy_caps_ext2
1454  *                                               for a hw-mode
1455  * @psoc_info:  pointer to structure target_psoc_info
1456  * @mode: hw mode
1457  *
1458  * API to get mac_phy_cap for a specified hw-mode
1459  *
1460  * Return: structure pointer to wlan_psoc_host_mac_phy_caps_ext2
1461  */
1462 
1463 static inline struct wlan_psoc_host_mac_phy_caps_ext2
1464 		*target_psoc_get_mac_phy_cap_ext2_for_mode
1465 		(struct target_psoc_info *psoc_info, uint8_t mode)
1466 {
1467 	uint8_t mac_phy_idx;
1468 	struct tgt_info *info = &psoc_info->info;
1469 
1470 	if (!psoc_info)
1471 		return NULL;
1472 
1473 	for (mac_phy_idx = 0;
1474 		mac_phy_idx < PSOC_MAX_MAC_PHY_CAP;
1475 			mac_phy_idx++)
1476 		if (info->mac_phy_caps_ext2[mac_phy_idx].hw_mode_id == mode)
1477 			break;
1478 
1479 	if (mac_phy_idx == PSOC_MAX_MAC_PHY_CAP)
1480 		return NULL;
1481 
1482 	return &info->mac_phy_caps_ext2[mac_phy_idx];
1483 }
1484 
1485 /**
1486  * target_psoc_get_mac_phy_cap() - get mac_phy_cap
1487  * @psoc_info:  pointer to structure target_psoc_info
1488  *
1489  * API to get mac_phy_cap
1490  *
1491  * Return: structure pointer to wlan_psoc_host_mac_phy_caps
1492  */
1493 static inline struct wlan_psoc_host_mac_phy_caps *target_psoc_get_mac_phy_cap
1494 		(struct target_psoc_info *psoc_info)
1495 {
1496 	uint32_t preferred_hw_mode;
1497 	struct wlan_psoc_host_mac_phy_caps *mac_phy_cap;
1498 
1499 	if (!psoc_info)
1500 		return NULL;
1501 
1502 	preferred_hw_mode =
1503 		target_psoc_get_preferred_hw_mode(psoc_info);
1504 
1505 	if (preferred_hw_mode < WMI_HOST_HW_MODE_MAX) {
1506 		mac_phy_cap =
1507 			target_psoc_get_mac_phy_cap_for_mode
1508 			(psoc_info, preferred_hw_mode);
1509 	} else {
1510 		mac_phy_cap = psoc_info->info.mac_phy_cap;
1511 	}
1512 
1513 	return mac_phy_cap;
1514 }
1515 
1516 /**
1517  * target_psoc_get_mac_phy_cap_ext2() - get mac_phy_caps_ext2
1518  * @psoc_info:  pointer to structure target_psoc_info
1519  *
1520  * API to get mac_phy_caps_ext2
1521  *
1522  * Return: structure pointer to wlan_psoc_host_mac_phy_caps
1523  */
1524 static inline struct wlan_psoc_host_mac_phy_caps_ext2
1525 		*target_psoc_get_mac_phy_cap_ext2
1526 		(struct target_psoc_info *psoc_info)
1527 {
1528 	uint32_t preferred_hw_mode;
1529 	struct wlan_psoc_host_mac_phy_caps_ext2 *mac_phy_caps_ext2;
1530 
1531 	if (!psoc_info)
1532 		return NULL;
1533 
1534 	preferred_hw_mode =
1535 		target_psoc_get_preferred_hw_mode(psoc_info);
1536 
1537 	if (preferred_hw_mode < WMI_HOST_HW_MODE_MAX) {
1538 		mac_phy_caps_ext2 =
1539 			target_psoc_get_mac_phy_cap_ext2_for_mode
1540 			(psoc_info, preferred_hw_mode);
1541 	} else {
1542 		mac_phy_caps_ext2 = psoc_info->info.mac_phy_caps_ext2;
1543 	}
1544 
1545 	return mac_phy_caps_ext2;
1546 }
1547 
1548 /**
1549  * target_psoc_get_dbr_ring_caps() - get dbr_ring_cap
1550  * @psoc_info:  pointer to structure target_psoc_info
1551  *
1552  * API to get dbr_ring_cap
1553  *
1554  * Return: structure pointer to wlan_psoc_host_dbr_ring_caps
1555  */
1556 static inline struct wlan_psoc_host_dbr_ring_caps
1557 	*target_psoc_get_dbr_ring_caps(struct target_psoc_info *psoc_info)
1558 {
1559 	if (!psoc_info)
1560 		return NULL;
1561 
1562 	return psoc_info->info.dbr_ring_cap;
1563 }
1564 
1565 /**
1566  * target_psoc_get_scan_radio_caps() - get scan_radio_cap
1567  * @psoc_info:  pointer to structure target_psoc_info
1568  *
1569  * API to get scan_radio_cap
1570  *
1571  * Return: structure pointer to wlan_psoc_host_scan_radio_caps
1572  */
1573 static inline struct wlan_psoc_host_scan_radio_caps
1574 	*target_psoc_get_scan_radio_caps(struct target_psoc_info *psoc_info)
1575 {
1576 	if (!psoc_info)
1577 		return NULL;
1578 
1579 	return psoc_info->info.scan_radio_caps;
1580 }
1581 
1582 /**
1583  * target_psoc_get_spectral_scaling_params() - get Spectral scaling params
1584  * @psoc_info:  pointer to structure target_psoc_info
1585  *
1586  * API to get Spectral scaling params
1587  *
1588  * Return: structure pointer to wlan_psoc_host_spectral_scaling_params
1589  */
1590 static inline struct wlan_psoc_host_spectral_scaling_params
1591 		*target_psoc_get_spectral_scaling_params(
1592 		struct target_psoc_info *psoc_info)
1593 {
1594 	if (!psoc_info)
1595 		return NULL;
1596 
1597 	return psoc_info->info.scaling_params;
1598 }
1599 
1600 /**
1601  * target_psoc_get_mem_chunks() - get mem_chunks
1602  * @psoc_info:  pointer to structure target_psoc_info
1603  *
1604  * API to get mem_chunks
1605  *
1606  * Return: structure pointer to wmi_host_mem_chunk
1607  */
1608 static inline struct wmi_host_mem_chunk *target_psoc_get_mem_chunks
1609 		(struct target_psoc_info *psoc_info)
1610 {
1611 	if (!psoc_info)
1612 		return NULL;
1613 
1614 	return psoc_info->info.mem_chunks;
1615 }
1616 
1617 /**
1618  * target_psoc_get_tif_ops() - get tif_ops
1619  * @psoc_info:  pointer to structure target_psoc_info
1620  *
1621  * API to get tif_ops
1622  *
1623  * Return: structure pointer to target_ops
1624  */
1625 static inline struct target_ops *target_psoc_get_tif_ops
1626 		(struct target_psoc_info *psoc_info)
1627 {
1628 	if (!psoc_info)
1629 		return NULL;
1630 
1631 	return psoc_info->tif_ops;
1632 }
1633 
1634 /**
1635  * target_pdev_set_feature_ptr - set feature_ptr
1636  * @pdev_info:  pointer to structure target_pdev_info
1637  * @feature_ptr: Feature pointer
1638  *
1639  * API to set feature_ptr
1640  *
1641  * Return: void
1642  */
1643 static inline void target_pdev_set_feature_ptr
1644 		(struct target_pdev_info *pdev_info, void *feature_ptr)
1645 {
1646 	if (!pdev_info)
1647 		return;
1648 
1649 	pdev_info->feature_ptr = feature_ptr;
1650 }
1651 
1652 /**
1653  * target_pdev_get_feature_ptr() - get feature_ptr
1654  * @pdev_info:  pointer to structure target_pdev_info
1655  *
1656  * API to get feature_ptr
1657  *
1658  * Return: feature_ptr
1659  */
1660 static inline void *target_pdev_get_feature_ptr
1661 		(struct target_pdev_info *pdev_info)
1662 {
1663 	if (!pdev_info)
1664 		return NULL;
1665 
1666 	return pdev_info->feature_ptr;
1667 }
1668 
1669 /**
1670  * target_pdev_set_wmi_handle - set wmi_handle
1671  * @pdev_info:  pointer to structure target_pdev_info
1672  * @wmi_handle: WMI handle
1673  *
1674  * API to set wmi_handle
1675  *
1676  * Return: void
1677  */
1678 static inline void target_pdev_set_wmi_handle
1679 		(struct target_pdev_info *pdev_info,
1680 		 struct wmi_unified *wmi_handle)
1681 {
1682 	if (!pdev_info)
1683 		return;
1684 
1685 	pdev_info->wmi_handle = wmi_handle;
1686 }
1687 
1688 /**
1689  * target_pdev_get_wmi_handle - get wmi_handle
1690  * @pdev_info:  pointer to structure target_dev_info
1691  *
1692  * API to get wmi_handle
1693  *
1694  * Return: wmi_handle
1695  */
1696 static inline struct wmi_unified *target_pdev_get_wmi_handle
1697 		(struct target_pdev_info *pdev_info)
1698 {
1699 	if (!pdev_info)
1700 		return NULL;
1701 
1702 	return pdev_info->wmi_handle;
1703 }
1704 
1705 /**
1706  * target_pdev_set_accelerator_hdl - set accelerator_hdl
1707  * @pdev_info:  pointer to structure target_pdev_info
1708  * @accelerator_hdl: Accelator handle
1709  *
1710  * API to set accelerator_hdl
1711  *
1712  * Return: void
1713  */
1714 static inline void target_pdev_set_accelerator_hdl
1715 		(struct target_pdev_info *pdev_info,
1716 		 struct common_accelerator_handle *accelerator_hdl)
1717 {
1718 	if (!pdev_info)
1719 		return;
1720 
1721 	pdev_info->accelerator_hdl = accelerator_hdl;
1722 }
1723 
1724 /**
1725  * target_pdev_get_accelerator_hdl - get accelerator_hdl
1726  * @pdev_info:  pointer to structure target_dev_info
1727  *
1728  * API to get accelerator_hdl
1729  *
1730  * Return: accelerator_hdl
1731  */
1732 static inline struct common_accelerator_handle *
1733 target_pdev_get_accelerator_hdl(struct target_pdev_info *pdev_info)
1734 {
1735 	if (!pdev_info)
1736 		return NULL;
1737 
1738 	return pdev_info->accelerator_hdl;
1739 }
1740 
1741 /**
1742  * target_pdev_set_pdev_idx - set pdev_idx
1743  * @pdev_info:  pointer to structure target_pdev_info
1744  * @pdev_idx:   PDEV id of FW
1745  *
1746  * API to set pdev_idx
1747  *
1748  * Return: void
1749  */
1750 static inline void target_pdev_set_pdev_idx
1751 		(struct target_pdev_info *pdev_info, int32_t pdev_idx)
1752 {
1753 	if (!pdev_info)
1754 		return;
1755 
1756 	pdev_info->pdev_idx = pdev_idx;
1757 }
1758 
1759 /**
1760  * target_pdev_get_pdev_idx  - get pdev_idx
1761  * @pdev_info:  pointer to structure target_dev_info
1762  *
1763  * API to get pdev_idx
1764  *
1765  * Return: int32_t
1766  */
1767 static inline int32_t  target_pdev_get_pdev_idx
1768 		(struct target_pdev_info *pdev_info)
1769 {
1770 	if (!pdev_info)
1771 		return -EINVAL;
1772 
1773 	return pdev_info->pdev_idx;
1774 }
1775 
1776 /**
1777  * target_pdev_set_phy_idx - set phy_idx
1778  * @pdev_info:  pointer to structure target_pdev_info
1779  * @phy_idx:    phy ID of FW
1780  *
1781  * API to set phy_idx
1782  *
1783  * Return: void
1784  */
1785 static inline void target_pdev_set_phy_idx
1786 		(struct target_pdev_info *pdev_info, int32_t phy_idx)
1787 {
1788 	if (!pdev_info)
1789 		return;
1790 
1791 	pdev_info->phy_idx  = phy_idx;
1792 }
1793 
1794 /**
1795  * target_pdev_get_phy_idx  - get phy_idx
1796  * @pdev_info:  pointer to structure target_dev_info
1797  *
1798  * API to get phy_idx
1799  *
1800  * Return: int32_t
1801  */
1802 static inline int32_t target_pdev_get_phy_idx
1803 		(struct target_pdev_info *pdev_info)
1804 {
1805 	if (!pdev_info)
1806 		return -EINVAL;
1807 
1808 	return pdev_info->phy_idx;
1809 }
1810 
1811 /**
1812  * GET_WMI_HDL_FROM_PSOC - get wmi handle from psoc
1813  * @psoc:  psoc object
1814  *
1815  * API to get wmi_handle from psoc
1816  *
1817  * Return: wmi_handle on success
1818  *         if tgt handle is not initialized, it returns NULL
1819  */
1820 static inline struct wmi_unified *GET_WMI_HDL_FROM_PSOC(
1821 		struct wlan_objmgr_psoc *psoc)
1822 {
1823 	struct target_psoc_info *tgt_if_handle;
1824 
1825 	if (psoc) {
1826 		tgt_if_handle = psoc->tgt_if_handle;
1827 
1828 		if (tgt_if_handle)
1829 			return target_psoc_get_wmi_hdl(tgt_if_handle);
1830 		else
1831 			return NULL;
1832 	}
1833 
1834 	return NULL;
1835 }
1836 
1837 /**
1838  * GET_WMI_HDL_FROM_PDEV - get wmi handle from pdev
1839  * @pdev:  pdev object
1840  *
1841  * API to get wmi_handle from pdev
1842  *
1843  * Return: wmi_handle on success
1844  *         if tgt handle is not initialized, it returns NULL
1845  */
1846 static inline struct wmi_unified *GET_WMI_HDL_FROM_PDEV(
1847 		struct wlan_objmgr_pdev *pdev)
1848 {
1849 	struct target_pdev_info *tgt_if_handle;
1850 
1851 	if (pdev) {
1852 		tgt_if_handle =  pdev->tgt_if_handle;
1853 
1854 		if (tgt_if_handle)
1855 			return target_pdev_get_wmi_handle(tgt_if_handle);
1856 		else
1857 			return NULL;
1858 	}
1859 
1860 	return NULL;
1861 }
1862 
1863 /**
1864  * get_wmi_unified_hdl_from_psoc - get wmi handle from psoc
1865  * @psoc:  psoc object
1866  *
1867  * API to get wmi_handle from psoc
1868  *
1869  * Return: wmi_handle on success
1870  *         if tgt handle is not initialized, it returns NULL
1871  */
1872 static inline wmi_unified_t
1873 get_wmi_unified_hdl_from_psoc(struct wlan_objmgr_psoc *psoc)
1874 {
1875 	return (wmi_unified_t)GET_WMI_HDL_FROM_PSOC(psoc);
1876 }
1877 
1878 /**
1879  * get_wmi_unified_hdl_from_pdev - get wmi handle from pdev
1880  * @pdev:  pdev object
1881  *
1882  * API to get wmi_handle from pdev
1883  *
1884  * Return: wmi_handle on success
1885  *         if tgt handle is not initialized, it returns NULL
1886  */
1887 static inline wmi_unified_t
1888 get_wmi_unified_hdl_from_pdev(struct wlan_objmgr_pdev *pdev)
1889 {
1890 	return (wmi_unified_t)GET_WMI_HDL_FROM_PDEV(pdev);
1891 }
1892 
1893 /**
1894  * target_if_ext_res_cfg_enable - Enable ext resource config
1895  * @psoc:  psoc object
1896  * @tgt_hdl: target_psoc_info pointer
1897  * @evt_buf: Event buffer received from FW
1898  *
1899  * API to enable Ext resource config
1900  *
1901  * Return: none
1902  */
1903 static inline void target_if_ext_res_cfg_enable(struct wlan_objmgr_psoc *psoc,
1904 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1905 {
1906 	if ((tgt_hdl->tif_ops) &&
1907 		(tgt_hdl->tif_ops->ext_resource_config_enable))
1908 		tgt_hdl->tif_ops->ext_resource_config_enable(psoc,
1909 				tgt_hdl, evt_buf);
1910 }
1911 
1912 /**
1913  * target_if_peer_cfg_enable - Enable peer config
1914  * @psoc:  psoc object
1915  * @tgt_hdl: target_psoc_info pointer
1916  * @evt_buf: Event buffer received from FW
1917  *
1918  * API to enable peer config
1919  *
1920  * Return: none
1921  */
1922 static inline void target_if_peer_cfg_enable(struct wlan_objmgr_psoc *psoc,
1923 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1924 {
1925 	if ((tgt_hdl->tif_ops) &&
1926 		(tgt_hdl->tif_ops->peer_config))
1927 		tgt_hdl->tif_ops->peer_config(psoc, tgt_hdl, evt_buf);
1928 }
1929 
1930 /**
1931  * target_if_mesh_support_enable - Enable MESH mode support
1932  * @psoc:  psoc object
1933  * @tgt_hdl: target_psoc_info pointer
1934  * @evt_buf: Event buffer received from FW
1935  *
1936  * API to enable Mesh mode
1937  *
1938  * Return: none
1939  */
1940 static inline void target_if_mesh_support_enable(struct wlan_objmgr_psoc *psoc,
1941 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1942 {
1943 	if ((tgt_hdl->tif_ops) &&
1944 		(tgt_hdl->tif_ops->mesh_support_enable))
1945 		tgt_hdl->tif_ops->mesh_support_enable(psoc, tgt_hdl, evt_buf);
1946 }
1947 
1948 /**
1949  * target_if_eapol_minrate_enable - Enable EAPOL Minrate in Tunnel Mode
1950  * @psoc: psoc object
1951  * @tgt_hdl: target_psoc_info pointer
1952  * @evt_buf: Event buffer received from FW
1953  *
1954  * API to enable eapol minrate
1955  *
1956  * Return: none
1957  */
1958 static inline void target_if_eapol_minrate_enable(struct wlan_objmgr_psoc *psoc,
1959 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1960 {
1961 	if ((tgt_hdl->tif_ops) &&
1962 	    (tgt_hdl->tif_ops->eapol_minrate_enable))
1963 		tgt_hdl->tif_ops->eapol_minrate_enable(psoc, tgt_hdl, evt_buf);
1964 }
1965 
1966 /**
1967  * target_if_smart_antenna_enable - Enable Smart antenna module
1968  * @psoc:  psoc object
1969  * @tgt_hdl: target_psoc_info pointer
1970  * @evt_buf: Event buffer received from FW
1971  *
1972  * API to enable Smart antenna
1973  *
1974  * Return: none
1975  */
1976 static inline void target_if_smart_antenna_enable(struct wlan_objmgr_psoc *psoc,
1977 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1978 {
1979 	if ((tgt_hdl->tif_ops) &&
1980 		(tgt_hdl->tif_ops->smart_antenna_enable))
1981 		tgt_hdl->tif_ops->smart_antenna_enable(psoc, tgt_hdl, evt_buf);
1982 }
1983 
1984 /**
1985  * target_if_cfr_support_enable - Enable cfr support
1986  * @psoc:  psoc object
1987  * @tgt_hdl: target_psoc_info pointer
1988  * @evt_buf: Event buffer received from FW
1989  *
1990  * API to enable cfr support
1991  *
1992  * Return: none
1993  */
1994 static inline void target_if_cfr_support_enable(struct wlan_objmgr_psoc *psoc,
1995 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1996 {
1997 	if ((tgt_hdl->tif_ops) &&
1998 	    (tgt_hdl->tif_ops->cfr_support_enable))
1999 		tgt_hdl->tif_ops->cfr_support_enable(psoc, tgt_hdl, evt_buf);
2000 }
2001 
2002 /**
2003  * target_if_set_pktlog_checksum - Set pktlog checksum
2004  * @pdev: pdev object
2005  * @tgt_hdl: target_psoc_info pointer
2006  * @checksum: checksum received from FW
2007  *
2008  * API to set pktlog checksum
2009  *
2010  * Return: none
2011  */
2012 static inline void target_if_set_pktlog_checksum(struct wlan_objmgr_pdev *pdev,
2013 			struct target_psoc_info *tgt_hdl, uint32_t checksum)
2014 {
2015 	if ((tgt_hdl->tif_ops) &&
2016 	    (tgt_hdl->tif_ops->set_pktlog_checksum))
2017 		tgt_hdl->tif_ops->set_pktlog_checksum(pdev, checksum);
2018 }
2019 
2020 /**
2021  * target_if_atf_cfg_enable - Enable ATF config
2022  * @psoc:  psoc object
2023  * @tgt_hdl: target_psoc_info pointer
2024  * @evt_buf: Event buffer received from FW
2025  *
2026  * API to enable ATF config
2027  *
2028  * Return: none
2029  */
2030 static inline void target_if_atf_cfg_enable(struct wlan_objmgr_psoc *psoc,
2031 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
2032 {
2033 	if ((tgt_hdl->tif_ops) &&
2034 		(tgt_hdl->tif_ops->atf_config_enable))
2035 		tgt_hdl->tif_ops->atf_config_enable(psoc, tgt_hdl, evt_buf);
2036 }
2037 
2038 /**
2039  * target_if_qwrap_cfg_enable - Enable QWRAP config
2040  * @psoc:  psoc object
2041  * @tgt_hdl: target_psoc_info pointer
2042  * @evt_buf: Event buffer received from FW
2043  *
2044  * API to enable QWRAP config
2045  *
2046  * Return: none
2047  */
2048 static inline void target_if_qwrap_cfg_enable(struct wlan_objmgr_psoc *psoc,
2049 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
2050 {
2051 	if ((tgt_hdl->tif_ops) &&
2052 		(tgt_hdl->tif_ops->qwrap_config_enable))
2053 		tgt_hdl->tif_ops->qwrap_config_enable(psoc, tgt_hdl, evt_buf);
2054 }
2055 
2056 /**
2057  * target_if_btcoex_cfg_enable - Enable BT coex config
2058  * @psoc:  psoc object
2059  * @tgt_hdl: target_psoc_info pointer
2060  * @evt_buf: Event buffer received from FW
2061  *
2062  * API to enable BT coex config
2063  *
2064  * Return: none
2065  */
2066 static inline void target_if_btcoex_cfg_enable(struct wlan_objmgr_psoc *psoc,
2067 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
2068 {
2069 	if ((tgt_hdl->tif_ops) &&
2070 		(tgt_hdl->tif_ops->btcoex_config_enable))
2071 		tgt_hdl->tif_ops->btcoex_config_enable(psoc, tgt_hdl, evt_buf);
2072 }
2073 
2074 /**
2075  * target_if_lteu_cfg_enable - Enable LTEU config
2076  * @psoc:  psoc object
2077  * @tgt_hdl: target_psoc_info pointer
2078  * @evt_buf: Event buffer received from FW
2079  *
2080  * API to enable LTEU coex config
2081  *
2082  * Return: none
2083  */
2084 static inline void target_if_lteu_cfg_enable(struct wlan_objmgr_psoc *psoc,
2085 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
2086 {
2087 	if ((tgt_hdl->tif_ops) &&
2088 		(tgt_hdl->tif_ops->lteu_ext_support_enable))
2089 		tgt_hdl->tif_ops->lteu_ext_support_enable(psoc,	tgt_hdl,
2090 								evt_buf);
2091 }
2092 
2093 /**
2094  * target_if_set_init_cmd_dev_param - Set init command params
2095  * @psoc:  psoc object
2096  * @tgt_hdl: target_psoc_info pointer
2097  *
2098  * API to set init command param based on config
2099  *
2100  * Return: none
2101  */
2102 static inline void target_if_set_init_cmd_dev_param(
2103 	struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl)
2104 {
2105 	if ((tgt_hdl->tif_ops) &&
2106 		(tgt_hdl->tif_ops->set_init_cmd_dev_based_params)) {
2107 		tgt_hdl->tif_ops->set_init_cmd_dev_based_params(psoc,
2108 					tgt_hdl);
2109 	}
2110 }
2111 
2112 /**
2113  * target_if_alloc_pdevs - Allocate PDEVs
2114  * @psoc:  psoc object
2115  * @tgt_hdl: target_psoc_info pointer
2116  *
2117  * API allocates PDEVs based on ext service ready param
2118  *
2119  * Return: SUCCESS on pdev allocation or PDEV allocation is not needed
2120  *         FAILURE, if allocation fails
2121  */
2122 static inline QDF_STATUS target_if_alloc_pdevs(struct wlan_objmgr_psoc *psoc,
2123 					struct target_psoc_info *tgt_hdl)
2124 {
2125 	QDF_STATUS ret_val;
2126 
2127 	if ((tgt_hdl->tif_ops) &&
2128 		(tgt_hdl->tif_ops->alloc_pdevs))
2129 		ret_val = tgt_hdl->tif_ops->alloc_pdevs(psoc, tgt_hdl);
2130 	else
2131 		ret_val = QDF_STATUS_SUCCESS;
2132 
2133 	return ret_val;
2134 }
2135 
2136 /**
2137  * target_if_update_pdev_tgt_info - Update PDEVs info
2138  * @psoc:  psoc object
2139  * @tgt_hdl: target_psoc_info pointer
2140  *
2141  * API updates PDEVs info based on config
2142  *
2143  * Return: SUCCESS on pdev updation or PDEV updation is not needed
2144  *         FAILURE, if updation fails
2145  */
2146 static inline QDF_STATUS target_if_update_pdev_tgt_info(
2147 	struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl)
2148 {
2149 	QDF_STATUS ret_val;
2150 
2151 	if ((tgt_hdl->tif_ops) &&
2152 		(tgt_hdl->tif_ops->update_pdev_tgt_info))
2153 		ret_val = tgt_hdl->tif_ops->update_pdev_tgt_info(psoc,
2154 							tgt_hdl);
2155 	else
2156 		ret_val = QDF_STATUS_SUCCESS;
2157 
2158 	return ret_val;
2159 }
2160 
2161 /**
2162  * target_if_print_service_ready_ext_param - Print Service ready ext param
2163  * @psoc:  psoc object
2164  * @tgt_hdl: target_psoc_info pointer
2165  *
2166  * API to print service ready ext param
2167  *
2168  * Return: none
2169  */
2170 static inline void target_if_print_service_ready_ext_param(
2171 	struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl)
2172 {
2173 	if ((tgt_hdl->tif_ops) &&
2174 		(tgt_hdl->tif_ops->print_svc_ready_ex_param)) {
2175 		tgt_hdl->tif_ops->print_svc_ready_ex_param(psoc,
2176 			tgt_hdl);
2177 	}
2178 }
2179 
2180 /**
2181  * target_if_add_11ax_modes - Add 11ax modes explicitly
2182  * @psoc:  psoc object
2183  * @tgt_hdl: target_psoc_info pointer
2184  *
2185  * API to adds 11ax modes
2186  *
2187  * Return: none
2188  */
2189 #ifdef QCA_HOST_ADD_11AX_MODE_WAR
2190 static inline void target_if_add_11ax_modes(struct wlan_objmgr_psoc *psoc,
2191 					    struct target_psoc_info *tgt_hdl)
2192 {
2193 	if ((tgt_hdl->tif_ops) &&
2194 		(tgt_hdl->tif_ops->add_11ax_modes)) {
2195 		tgt_hdl->tif_ops->add_11ax_modes(psoc, tgt_hdl);
2196 	}
2197 }
2198 #else
2199 static inline void target_if_add_11ax_modes(struct wlan_objmgr_psoc *psoc,
2200 					    struct target_psoc_info *tgt_hdl)
2201 {
2202 }
2203 #endif
2204 
2205 /**
2206  * target_if_csa_switch_count_status - Calls a function to process CSA event
2207  * @psoc:  psoc object
2208  * @tgt_hdl: target_psoc_info pointer
2209  * @csa_status: CSA switch count status event param
2210  *
2211  * Return: 0 on success, -1 on failure
2212  */
2213 static inline int target_if_csa_switch_count_status(
2214 		struct wlan_objmgr_psoc *psoc,
2215 		struct target_psoc_info *tgt_hdl,
2216 		struct pdev_csa_switch_count_status csa_status)
2217 {
2218 	if (tgt_hdl->tif_ops && tgt_hdl->tif_ops->csa_switch_count_status)
2219 		return tgt_hdl->tif_ops->csa_switch_count_status(
2220 				psoc, csa_status);
2221 
2222 	return -1;
2223 }
2224 
2225 /**
2226  * target_if_set_default_config - Set default config in init command
2227  * @psoc:  psoc object
2228  * @tgt_hdl: target_psoc_info pointer
2229  *
2230  * API to set default config in init command
2231  *
2232  * Return: none
2233  */
2234 static inline void target_if_set_default_config(struct wlan_objmgr_psoc *psoc,
2235 					struct target_psoc_info *tgt_hdl)
2236 {
2237 	if ((tgt_hdl->tif_ops) &&
2238 		(tgt_hdl->tif_ops->set_default_tgt_config)) {
2239 		tgt_hdl->tif_ops->set_default_tgt_config(psoc, tgt_hdl);
2240 	}
2241 }
2242 
2243 /**
2244  * target_if_sw_version_check - SW version check
2245  * @psoc:  psoc object
2246  * @tgt_hdl: target_psoc_info pointer
2247  * @evt_buf: Event buffer received from FW
2248  *
2249  * API checks the SW version
2250  *
2251  * Return: SUCCESS on version matches or version check is not needed
2252  *         FAILURE, if check fails
2253  */
2254 static inline QDF_STATUS target_if_sw_version_check(
2255 			struct wlan_objmgr_psoc *psoc,
2256 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
2257 {
2258 	QDF_STATUS ret_val;
2259 
2260 	if ((tgt_hdl->tif_ops) &&
2261 		(tgt_hdl->tif_ops->sw_version_check))
2262 		ret_val = tgt_hdl->tif_ops->sw_version_check(psoc, tgt_hdl,
2263 								evt_buf);
2264 	else
2265 		ret_val = QDF_STATUS_SUCCESS;
2266 
2267 	return ret_val;
2268 }
2269 
2270 /**
2271  * target_if_get_phy_capability  - get phy capability
2272  * @target_psoc_info:  pointer to structure target_psoc_info
2273  *
2274  * API to get phy capability from the target caps
2275  *
2276  * Return: int32_t
2277  */
2278 static inline int32_t target_if_get_phy_capability
2279 			(struct target_psoc_info *target_psoc_info)
2280 {
2281 	if (!target_psoc_info)
2282 		return -EINVAL;
2283 
2284 	return target_psoc_info->info.target_caps.phy_capability;
2285 }
2286 
2287 /**
2288  * target_if_set_phy_capability  - set phy capability
2289  * @target_psoc_info:  pointer to structure target_psoc_info
2290  * @phy_capab: PHY capabilities
2291  *
2292  * API to set phy capability in the target caps
2293  *
2294  * Return: None
2295  */
2296 static inline void target_if_set_phy_capability
2297 		(struct target_psoc_info *target_psoc_info, int phy_capability)
2298 {
2299 	if (!target_psoc_info)
2300 		return;
2301 
2302 	target_psoc_info->info.target_caps.phy_capability = phy_capability;
2303 }
2304 
2305 /**
2306  * target_if_set_max_frag_entry  - set Maximum frag entries
2307  * @target_psoc_info:  pointer to structure target_psoc_info
2308  * @max_frag_entry: Maximum frag entries
2309  *
2310  * API to set Maximum frag entries from the target caps
2311  *
2312  * Return: None
2313  */
2314 static inline void target_if_set_max_frag_entry
2315 		(struct target_psoc_info *target_psoc_info, int max_frag_entry)
2316 {
2317 	if (!target_psoc_info)
2318 		return;
2319 
2320 	target_psoc_info->info.target_caps.max_frag_entry = max_frag_entry;
2321 }
2322 
2323 /**
2324  * target_if_get_max_frag_entry  - get Maximum frag entries
2325  * @target_psoc_info:  pointer to structure target_psoc_info
2326  *
2327  * API to get Maximum frag entries from the target caps
2328  *
2329  * Return: int32_t
2330  */
2331 static inline int32_t target_if_get_max_frag_entry
2332 		(struct target_psoc_info *target_psoc_info)
2333 {
2334 	if (!target_psoc_info)
2335 		return -EINVAL;
2336 
2337 	return target_psoc_info->info.target_caps.max_frag_entry;
2338 }
2339 
2340 /**
2341  * target_if_get_ht_cap_info  - get ht capabilities info
2342  * @target_psoc_info:  pointer to structure target_psoc_info
2343  *
2344  * API to get ht capabilities info from the target caps
2345  *
2346  * Return: int32_t
2347  */
2348 static inline int32_t target_if_get_ht_cap_info
2349 		(struct target_psoc_info *target_psoc_info)
2350 {
2351 	if (!target_psoc_info)
2352 		return -EINVAL;
2353 
2354 	return target_psoc_info->info.target_caps.ht_cap_info;
2355 }
2356 
2357 /**
2358  * target_if_get_vht_cap_info  - get vht capabilities info
2359  * @target_psoc_info:  pointer to structure target_psoc_info
2360  *
2361  * API to get vht capabilities info from the target caps
2362  *
2363  * Return: int32_t
2364  */
2365 static inline int32_t target_if_get_vht_cap_info
2366 		(struct target_psoc_info *target_psoc_info)
2367 {
2368 	if (!target_psoc_info)
2369 		return -EINVAL;
2370 
2371 	return target_psoc_info->info.target_caps.vht_cap_info;
2372 }
2373 
2374 /**
2375  * target_if_get_num_rf_chains  - get Number of RF chains supported
2376  * @target_psoc_info:  pointer to structure target_psoc_info
2377  *
2378  * API to get Number of RF chains supported from the target caps
2379  *
2380  * Return: int32_t
2381  */
2382 static inline int32_t target_if_get_num_rf_chains
2383 		(struct target_psoc_info *target_psoc_info)
2384 {
2385 	if (!target_psoc_info)
2386 		return -EINVAL;
2387 
2388 	return target_psoc_info->info.target_caps.num_rf_chains;
2389 }
2390 
2391 /**
2392  * target_if_get_fw_version  - get firmware version
2393  * @target_psoc_info:  pointer to structure target_psoc_info
2394  *
2395  * API to get firmware version from the target caps
2396  *
2397  * Return: int32_t
2398  */
2399 static inline int32_t target_if_get_fw_version
2400 		(struct target_psoc_info *target_psoc_info)
2401 {
2402 	if (!target_psoc_info)
2403 		return 0;
2404 
2405 	return target_psoc_info->info.target_caps.fw_version;
2406 }
2407 
2408 /**
2409  * target_if_get_wmi_fw_sub_feat_caps  - FW sub feature capabilities
2410  * @target_psoc_info:  pointer to structure target_psoc_info
2411  *
2412  * API to get FW sub feature capabilities from the target caps
2413  *
2414  * Return: int32_t
2415  */
2416 static inline int32_t target_if_get_wmi_fw_sub_feat_caps
2417 		(struct target_psoc_info *target_psoc_info)
2418 {
2419 	if (!target_psoc_info)
2420 		return -EINVAL;
2421 
2422 	return target_psoc_info->info.target_caps.wmi_fw_sub_feat_caps;
2423 }
2424 
2425 /**
2426  * target_if_get_conc_scan_config_bits  - Default concurrenct scan config
2427  * @tgt_hdl:  pointer to structure target_psoc_info
2428  *
2429  * API to get Default concurrenct scan config from the target caps
2430  *
2431  * Return: int32_t
2432  */
2433 static inline int32_t target_if_get_conc_scan_config_bits
2434 		(struct target_psoc_info *tgt_hdl)
2435 {
2436 	if (!tgt_hdl)
2437 		return -EINVAL;
2438 
2439 	return tgt_hdl->info.service_ext_param.default_conc_scan_config_bits;
2440 }
2441 
2442 /**
2443  * target_if_get_fw_config_bits  - Default HW config bits
2444  * @tgt_hdl:  pointer to structure target_psoc_info
2445  *
2446  * API to get Default HW config bits from the target caps
2447  *
2448  * Return: int32_t
2449  */
2450 static inline int32_t target_if_get_fw_config_bits
2451 		(struct target_psoc_info *tgt_hdl)
2452 {
2453 	if (!tgt_hdl)
2454 		return -EINVAL;
2455 
2456 	return tgt_hdl->info.service_ext_param.default_fw_config_bits;
2457 }
2458 
2459 /**
2460  * target_psoc_get_num_hw_modes  - get number of dbs hardware modes
2461  * @tgt_hdl:  pointer to structure target_psoc_info
2462  *
2463  * API to get Number of Dual Band Simultaneous (DBS) hardware modes
2464  *
2465  * Return: int32_t
2466  */
2467 static inline int32_t target_psoc_get_num_hw_modes
2468 		(struct target_psoc_info *tgt_hdl)
2469 {
2470 	if (!tgt_hdl)
2471 		return -EINVAL;
2472 
2473 	return tgt_hdl->info.service_ext_param.num_hw_modes;
2474 }
2475 
2476 #ifdef WLAN_SUPPORT_TWT
2477 #ifdef WLAN_TWT_AP_PDEV_COUNT_NUM_PHY
2478 static inline void target_if_set_twt_ap_pdev_count
2479 		(struct tgt_info *info, struct target_psoc_info *tgt_hdl)
2480 {
2481 	if (!tgt_hdl)
2482 		return;
2483 
2484 	info->wlan_res_cfg.twt_ap_pdev_count =
2485 					info->service_ext_param.num_phy;
2486 }
2487 #else
2488 static inline void target_if_set_twt_ap_pdev_count
2489 		(struct tgt_info *info, struct target_psoc_info *tgt_hdl)
2490 {
2491 	if (!tgt_hdl)
2492 		return;
2493 
2494 	info->wlan_res_cfg.twt_ap_pdev_count =
2495 					target_psoc_get_num_radios(tgt_hdl);
2496 }
2497 #endif /* WLAN_TWT_AP_PDEV_COUNT_NUM_PHY */
2498 #else
2499 static inline void target_if_set_twt_ap_pdev_count
2500 		(struct tgt_info *info, struct target_psoc_info *tgt_hdl)
2501 {
2502 }
2503 #endif /* WLAN_SUPPORT_TWT */
2504 
2505 /**
2506  * target_psoc_get_version_info() - Get version info from tgt info
2507  * @psoc_info: pointer to structure target_psoc_info
2508  * @reg_major: reg db version major
2509  * @reg_minor: reg db version minor
2510  * @bdf_major: bdf reg db version major
2511  * @bdf_minor: bdf reg db version minor
2512  *
2513  * API to get target version information.
2514  *
2515  * Return: void
2516  */
2517 static inline void target_psoc_get_version_info(
2518 					struct target_psoc_info *psoc_info,
2519 					uint8_t *reg_major, uint8_t *reg_minor,
2520 					uint8_t *bdf_major, uint8_t *bdf_minor)
2521 {
2522 	if (!psoc_info)
2523 		return;
2524 
2525 	*reg_major = psoc_info->info.service_ext2_param.reg_db_version_major;
2526 	*reg_minor = psoc_info->info.service_ext2_param.reg_db_version_minor;
2527 	*bdf_major =
2528 		psoc_info->info.service_ext2_param.bdf_reg_db_version_major;
2529 	*bdf_minor =
2530 		psoc_info->info.service_ext2_param.bdf_reg_db_version_minor;
2531 }
2532 
2533 /**
2534  * target_psoc_get_chan_width_switch_num_peers() - Get peer limit
2535  * @psoc_info: pointer to structure target_psoc_info
2536  *
2537  * API to get the number of peers supported per WMI command with the ID
2538  * WMI_PEER_CHAN_WIDTH_SWITCH_CMDID.
2539  *
2540  * Return: maximum peers allowed in a single WMI command with the given ID.
2541  */
2542 static inline uint32_t target_psoc_get_chan_width_switch_num_peers(
2543 					    struct target_psoc_info *psoc_info)
2544 {
2545 	if (!psoc_info)
2546 		return 0;
2547 
2548 	return psoc_info->info.service_ext2_param.chwidth_num_peer_caps;
2549 }
2550 
2551 /**
2552  * target_if_is_scan_radio_supported() - API to check scan radio
2553  * support for the given radio
2554  * @pdev: pointer to pdev
2555  * @is_scan_radio_supported: pointer to scan radio support flag
2556  *
2557  * API to check scan radio support for the given radio
2558  *
2559  * Return: QDF_STATUS
2560  */
2561 QDF_STATUS
2562 target_pdev_is_scan_radio_supported(struct wlan_objmgr_pdev *pdev,
2563 				    bool *is_scan_radio_supported);
2564 
2565 /**
2566  * target_pdev_scan_radio_is_dfs_enabled() - API to check
2567  * whether DFS needs to be enabled/disabled for scan radio.
2568  * @pdev:  pointer to pdev
2569  * @is_dfs_en: Pointer to DFS enable flag
2570  *
2571  * API to check whether DFS needs to be enabled/disabled for
2572  * scan radio. This API should be used only for a scan radio
2573  * pdev.
2574  *
2575  * Return: QDF_STATUS
2576  */
2577 QDF_STATUS
2578 target_pdev_scan_radio_is_dfs_enabled(struct wlan_objmgr_pdev *pdev,
2579 				      bool *is_dfs_en);
2580 
2581 /**
2582  * target_psoc_get_preamble_puncture_cap() - Get Preamble Puncturing capability
2583  * @psoc_info: pointer to structure target_psoc_info
2584  *
2585  * API to get the target capability for Preamble Punctured Tx
2586  *
2587  * Return: target capability for Preamble Punctured Tx.
2588  */
2589 static inline uint32_t target_psoc_get_preamble_puncture_cap(
2590 					    struct target_psoc_info *psoc_info)
2591 {
2592 	if (!psoc_info)
2593 		return 0;
2594 
2595 	return psoc_info->info.service_ext2_param.preamble_puncture_bw_cap;
2596 }
2597 
2598 /**
2599  * target_psoc_get_mu_max_users() - Get max users for MU transmissions
2600  * @psoc_info: pointer to structure target_psoc_info
2601  * @mu_caps: pointer to structure for max OFDMA/MU-MIMO users per-PPDU
2602  *
2603  * API to get the max number of users per-PPDU supported for Uplink/Downlink
2604  * MU transmissions.
2605  *
2606  * Return: void
2607  */
2608 static inline void target_psoc_get_mu_max_users(
2609 					struct target_psoc_info *psoc_info,
2610 					struct target_mu_caps *mu_caps)
2611 {
2612 	struct wlan_psoc_host_service_ext2_param *service_ext2_param;
2613 
2614 	if (!psoc_info || !mu_caps)
2615 		return;
2616 
2617 	service_ext2_param = &psoc_info->info.service_ext2_param;
2618 
2619 	mu_caps->ofdma_dl = service_ext2_param->max_users_dl_ofdma;
2620 	mu_caps->ofdma_ul = service_ext2_param->max_users_ul_ofdma;
2621 	mu_caps->mumimo_dl = service_ext2_param->max_users_dl_mumimo;
2622 	mu_caps->mumimo_ul = service_ext2_param->max_users_ul_mumimo;
2623 }
2624 
2625 /**
2626  * target_psoc_set_device_mode() - set global device_mode
2627  * @psoc_info: pointer to structure target_psoc_info
2628  * @device_mode: device mode mission monitor/ftm etc
2629  *
2630  * API to set global device mode
2631  *
2632  * Return: void
2633  */
2634 static inline void target_psoc_set_device_mode
2635 		(struct target_psoc_info *psoc_info, uint32_t device_mode)
2636 {
2637 	if (!psoc_info)
2638 		return;
2639 
2640 	psoc_info->info.device_mode = device_mode;
2641 }
2642 
2643 /**
2644  * target_psoc_get_device_mode() - get info device_mode
2645  * @psoc_info: pointer to structure target_psoc_info
2646  *
2647  * API to get device_mode
2648  *
2649  * Return: enum QDF_GLOBAL_MODE
2650  */
2651 static inline enum QDF_GLOBAL_MODE target_psoc_get_device_mode
2652 		(struct target_psoc_info *psoc_info)
2653 {
2654 	if (!psoc_info)
2655 		return QDF_GLOBAL_MAX_MODE;
2656 
2657 	return psoc_info->info.device_mode;
2658 }
2659 
2660 /**
2661  * target_if_set_reg_cc_ext_supp() - Set reg_cc_ext_supp capability
2662  * in WMI_INIT_CMD based on host capability of reg_cc_ext_event.
2663  *
2664  * @tgt_hdl: Pointer to struct target_psoc_info.
2665  * @psoc: Pointer to struct wlan_objmgr_psoc.
2666  *
2667  */
2668 void target_if_set_reg_cc_ext_supp(struct target_psoc_info *tgt_hdl,
2669 				   struct wlan_objmgr_psoc *psoc);
2670 
2671 /**
2672  * target_psoc_set_sbs_lower_band_end() - Set lower band end sbs frequency
2673  *
2674  * @psoc_info: Pointer to struct target_psoc_info.
2675  * @val: sbs lower band end cap value
2676  *
2677  * Return: None
2678  *
2679  */
2680 static inline
2681 void target_psoc_set_sbs_lower_band_end(struct target_psoc_info *psoc_info,
2682 				    uint32_t val)
2683 {
2684 	if (!psoc_info)
2685 		return;
2686 
2687 	psoc_info->info.sbs_lower_band_end_freq = val;
2688 }
2689 
2690 /**
2691  * target_psoc_set_twt_ack_cap() - Set twt ack capability
2692  *
2693  * @psoc_info: Pointer to struct target_psoc_info.
2694  * @val: twt ack cap value
2695  *
2696  * Return: None
2697  *
2698  */
2699 static inline
2700 void target_psoc_set_twt_ack_cap(struct target_psoc_info *psoc_info, bool val)
2701 {
2702 	if (!psoc_info)
2703 		return;
2704 
2705 	psoc_info->info.service_ext2_param.twt_ack_support_cap = val;
2706 }
2707 
2708 /**
2709  * target_psoc_get_twt_ack_cap() - Get twt ack capability
2710  *
2711  * @psoc_info: Pointer to struct target_psoc_info.
2712  * @val: twt ack cap value
2713  *
2714  * Return: None
2715  *
2716  */
2717 static inline
2718 void target_psoc_get_twt_ack_cap(struct target_psoc_info *psoc_info, bool *val)
2719 {
2720 	if (!psoc_info)
2721 		return;
2722 
2723 	*val = psoc_info->info.service_ext2_param.twt_ack_support_cap;
2724 }
2725 
2726 /**
2727  * target_psoc_target_cap_flags() - flags containing information about target
2728  * capabilities
2729  * @psoc_info:  pointer to structure target_psoc_info
2730  *
2731  * API to get flags containing information about target capabilities
2732  *
2733  * Return: no of target_cap_flags
2734  */
2735 static inline uint32_t target_psoc_get_target_cap_flags
2736 		(struct target_psoc_info *psoc_info)
2737 {
2738 	if (!psoc_info)
2739 		return 0;
2740 
2741 	return psoc_info->info.service_ext2_param.target_cap_flags;
2742 }
2743 
2744 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
2745 /**
2746  * target_pdev_get_hw_link_id  - get hw_link_id
2747  * @pdev:  pointer to structure target_pdev_info
2748  *
2749  * API to get hw_link_id
2750  *
2751  * Return: uint16_t
2752  */
2753 #define PDEV_INVALID_HW_LINK_ID 0xFFFF
2754 uint16_t  target_if_pdev_get_hw_link_id
2755 		(struct wlan_objmgr_pdev *pdev);
2756 
2757 /**
2758  * target_pdev_set_hw_link_id - set hw_link_id
2759  * @pdev:  pointer to structure target_pdev_info
2760  * @hw_link_id: unique hw link id of pdev across psoc
2761  *
2762  * API to set hw_link_id
2763  *
2764  * Return: void
2765  */
2766 void target_pdev_set_hw_link_id
2767 		(struct wlan_objmgr_pdev *pdev, uint16_t hw_link_id);
2768 
2769 /**
2770  * target_if_mlo_setup_req - API to trigger MLO setup sequence
2771  * @pdev: Array of pointers to pdev object that are part of ML group
2772  * @num_pdevs: Number of pdevs in above array
2773  * @grp_id: ML Group ID
2774  *
2775  * Return: QDF_STATUS codes
2776  */
2777 QDF_STATUS target_if_mlo_setup_req(struct wlan_objmgr_pdev **pdev,
2778 				   uint8_t num_pdevs, uint8_t grp_id);
2779 
2780 /**
2781  * target_if_mlo_ready - API to send MLO ready
2782  * @pdev: Array of pointers to pdev object that are part of ML group
2783  * @num_pdevs: Number of pdevs in above array
2784  *
2785  * Return: QDF_STATUS codes
2786  */
2787 QDF_STATUS target_if_mlo_ready(struct wlan_objmgr_pdev **pdev,
2788 			       uint8_t num_pdevs);
2789 #endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/
2790 
2791 #endif
2792