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