xref: /wlan-dirver/qca-wifi-host-cmn/target_if/core/inc/target_if.h (revision 1397a33f48ea6455be40871470b286e535820eb8)
1 /*
2  * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: This target interface shall be used
21  *      to communicate with target using WMI.
22  */
23 #ifndef _WLAN_TARGET_IF_H_
24 #define _WLAN_TARGET_IF_H_
25 
26 #include "qdf_types.h"
27 #include "qdf_util.h"
28 #include "wlan_objmgr_psoc_obj.h"
29 #include "wmi_unified_api.h"
30 #include "wmi_unified_priv.h"
31 #include "wmi_unified_param.h"
32 
33 #define TGT_WMI_PDEV_ID_SOC	0	/* WMI SOC ID */
34 
35 /* ASCII "TGT\0" */
36 #define TGT_MAGIC 0x54575400
37 
38 #define target_if_fatal(params...) \
39 	QDF_TRACE_FATAL(QDF_MODULE_ID_TARGET_IF, params)
40 #define target_if_err(params...) \
41 	QDF_TRACE_ERROR(QDF_MODULE_ID_TARGET_IF, params)
42 #define target_if_warn(params...) \
43 	QDF_TRACE_WARN(QDF_MODULE_ID_TARGET_IF, params)
44 #define target_if_info(params...) \
45 	QDF_TRACE_INFO(QDF_MODULE_ID_TARGET_IF, params)
46 #define target_if_debug(params...) \
47 	QDF_TRACE_DEBUG(QDF_MODULE_ID_TARGET_IF, params)
48 #define TARGET_IF_ENTER() \
49 	QDF_TRACE_ENTER(QDF_MODULE_ID_TARGET_IF, "enter")
50 #define TARGET_IF_EXIT() \
51 	QDF_TRACE_EXIT(QDF_MODULE_ID_TARGET_IF, "exit")
52 #define target_if_err_rl(params...) \
53 	QDF_TRACE_ERROR_RL(QDF_MODULE_ID_TARGET_IF, params)
54 
55 
56 #define targetif_nofl_fatal(params...) \
57 	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
58 #define targetif_nofl_err(params...) \
59 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
60 #define targetif_nofl_warn(params...) \
61 	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
62 #define targetif_nofl_info(params...) \
63 	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
64 #define targetif_nofl_debug(params...) \
65 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TARGET_IF, params)
66 
67 #ifdef CONFIG_MCL
68 #define TARGET_TYPE_AR900B    9  /* Beeliner */
69 #define TARGET_TYPE_QCA9984   15 /* cascade */
70 #define TARGET_TYPE_IPQ4019   16 /* dakota */
71 #define TARGET_TYPE_QCA9888   17 /* besra */
72 #define TARGET_TYPE_AR9888    7  /* Peregrine */
73 #endif
74 
75 typedef struct wlan_objmgr_psoc *(*get_psoc_handle_callback)(
76 			void *scn_handle);
77 
78 typedef struct wlan_objmgr_pdev *(*get_pdev_handle_callback)(
79 			void *scn_handle);
80 
81 typedef int (*wmi_legacy_service_ready_callback)(uint32_t event_id,
82 						void *handle,
83 						uint8_t *event_data,
84 						uint32_t length);
85 
86 /**
87  * struct target_if_ctx - target_interface context
88  * @magic: magic for target if ctx
89  * @get_psoc_hdl_cb:  function pointer to get psoc
90  * @get_pdev_hdl_cb:  function pointer to get pdev
91  * @lock: spin lock for protecting the ctx
92  */
93 struct target_if_ctx {
94 	uint32_t magic;
95 	get_psoc_handle_callback get_psoc_hdl_cb;
96 	get_pdev_handle_callback get_pdev_hdl_cb;
97 	wmi_legacy_service_ready_callback service_ready_cb;
98 	qdf_spinlock_t lock;
99 };
100 
101 struct target_psoc_info;
102 /**
103  * struct host_fw_ver - holds host fw version
104  * @host_ver: Host version
105  * @target_ver: Target version ID
106  * @target_rev: Target revision ID
107  * @wlan_ver: FW SW version
108  * @wlan_ver_1: FW SW version second dword
109  * @abi_ver: ABI version
110  */
111 struct host_fw_ver {
112 	uint32_t host_ver;
113 	uint32_t target_ver;
114 	uint32_t target_rev;
115 	uint32_t wlan_ver;
116 	uint32_t wlan_ver_1;
117 	uint32_t abi_ver;
118 };
119 
120 struct common_dbglog_handle;
121 struct common_hif_handle;
122 struct common_htc_handle;
123 struct common_wmi_handle;
124 struct common_accelerator_handle;
125 
126 /**
127  * struct comp_hdls - Non-umac/lower layer components handles, it is a sub
128  *                    structure of target psoc information
129  * @hif_hdl: HIF handle
130  * @htc_hdl: HTC handle
131  * @wmi_hdl: WMI handle
132  * @accelerator_hdl: NSS offload/IPA handle
133  * @dbglog_hdl: Debug log handle
134  */
135 struct comp_hdls {
136 	struct common_hif_handle *hif_hdl;
137 	struct common_htc_handle *htc_hdl;
138 	struct common_wmi_handle *wmi_hdl;
139 	struct common_accelerator_handle *accelerator_hdl;
140 	struct common_dbglog_handle *dbglog_hdl;
141 };
142 
143 /**
144  * struct target_supported_modes - List of HW modes supported by target.
145  *
146  * @num_modes: Number of modes supported
147  * @hw_mode_ids: List of HW mode ids
148  */
149 struct target_supported_modes {
150 	uint8_t num_modes;
151 	uint32_t hw_mode_ids[WMI_HOST_HW_MODE_MAX];
152 };
153 
154 /**
155  * struct tgt_info - FW or lower layer related info(required by target_if),
156  *                   it is a sub structure of taarget psoc information
157  * @version: Host FW version struct
158  * @wlan_res_cfg:  target_resource_config info
159  * @wlan_ext_res_cfg: wmi_host_ext_resource_config info
160  * @wmi_service_ready: is service ready received
161  * @wmi_ready: is ready event received
162  * @total_mac_phy_cnt: num of mac phys
163  * @num_radios: number of radios
164  * @wlan_init_status: Target init status
165  * @target_type: Target type
166  * @max_descs: Max descriptors
167  * @preferred_hw_mode: preferred hw mode
168  * @wmi_timeout: wait timeout for target events
169  * @event: qdf_event for target events
170  * @service_bitmap: WMI service bitmap
171  * @target_cap: target capabilities
172  * @service_ext_param: ext service params
173  * @mac_phy_cap: phy caps array
174  * @reg_cap: regulatory caps array
175  * @num_mem_chunks: number of mem chunks allocated
176  * @hw_mode_caps: HW mode caps of preferred mode
177  * @mem_chunks: allocated memory blocks for FW
178  */
179 struct tgt_info {
180 	struct host_fw_ver version;
181 	target_resource_config wlan_res_cfg;
182 	wmi_host_ext_resource_config wlan_ext_res_cfg;
183 	bool wmi_service_ready;
184 	bool wmi_ready;
185 	uint8_t total_mac_phy_cnt;
186 	uint8_t num_radios;
187 	uint32_t wlan_init_status;
188 	uint32_t target_type;
189 	uint32_t max_descs;
190 	uint32_t preferred_hw_mode;
191 	uint32_t wmi_timeout;
192 	qdf_event_t event;
193 	uint32_t service_bitmap[PSOC_SERVICE_BM_SIZE];
194 	struct wlan_psoc_target_capability_info target_caps;
195 	struct wlan_psoc_host_service_ext_param service_ext_param;
196 	struct wlan_psoc_host_mac_phy_caps
197 			mac_phy_cap[PSOC_MAX_MAC_PHY_CAP];
198 	struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap;
199 	uint32_t num_mem_chunks;
200 	struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
201 	struct wlan_psoc_host_hw_mode_caps hw_mode_cap;
202 	struct target_supported_modes hw_modes;
203 };
204 
205 /**
206  * struct target_ops - Holds feature specific function pointers, which would be
207  *                     invoked as part of service ready or ext service ready
208  * @ext_resource_config_enable: Ext resource config
209  * @peer_config: Peer config enable
210  * @mesh_support_enable: Mesh support enable
211  * @smart_antenna_enable: Smart antenna enable
212  * @atf_config_enable: ATF config enable
213  * @qwrap_config_enable: QWRAP config enable
214  * @btcoex_config_enable: BTCOEX config enable
215  * @lteu_ext_support_enable: LTE-U Ext config enable
216  * @set_init_cmd_dev_based_params: Sets Init command params
217  * @alloc_pdevs: Allocates PDEVs
218  * @update_pdev_tgt_info: Updates PDEV target info
219  * @mem_mgr_alloc_chunk: Allocates memory through MEM manager
220  * @mem_mgr_free_chunks: Free memory chunks through MEM manager
221  * @print_svc_ready_ex_param: Print service ready ext params
222  * @add_11ax_modes: Adds 11ax modes to reg cap
223  * @set_default_tgt_config: Sets target config with default values
224  * @sw_version_check: Checks the SW version
225  * @smart_log_enable: Enable Smart Logs feature
226  */
227 struct target_ops {
228 	QDF_STATUS (*ext_resource_config_enable)
229 		(struct wlan_objmgr_psoc *psoc,
230 		 struct target_psoc_info *tgt_info, uint8_t *event);
231 	void (*peer_config)
232 		(struct wlan_objmgr_psoc *psoc,
233 		 struct target_psoc_info *tgt_info, uint8_t *event);
234 	void (*mesh_support_enable)
235 		(struct wlan_objmgr_psoc *psoc,
236 		 struct target_psoc_info *tgt_info, uint8_t *event);
237 	void (*smart_antenna_enable)
238 		(struct wlan_objmgr_psoc *psoc,
239 		 struct target_psoc_info *tgt_info, uint8_t *event);
240 	void (*atf_config_enable)
241 		(struct wlan_objmgr_psoc *psoc,
242 		 struct target_psoc_info *tgt_info, uint8_t *event);
243 	void (*qwrap_config_enable)
244 		(struct wlan_objmgr_psoc *psoc,
245 		 struct target_psoc_info *tgt_info, uint8_t *event);
246 	void (*btcoex_config_enable)
247 		(struct wlan_objmgr_psoc *psoc,
248 		 struct target_psoc_info *tgt_info, uint8_t *event);
249 	void (*lteu_ext_support_enable)
250 		(struct wlan_objmgr_psoc *psoc,
251 		 struct target_psoc_info *tgt_info, uint8_t *event);
252 	void (*set_init_cmd_dev_based_params)
253 		(struct wlan_objmgr_psoc *psoc,
254 		 struct target_psoc_info *tgt_info);
255 	QDF_STATUS (*alloc_pdevs)
256 		(struct wlan_objmgr_psoc *psoc,
257 		 struct target_psoc_info *tgt_info);
258 	QDF_STATUS (*update_pdev_tgt_info)
259 		(struct wlan_objmgr_psoc *psoc,
260 		 struct target_psoc_info *tgt_info);
261 	uint32_t (*mem_mgr_alloc_chunk)(struct wlan_objmgr_psoc *psoc,
262 		struct target_psoc_info *tgt_info,
263 		u_int32_t req_id, u_int32_t idx, u_int32_t num_units,
264 		u_int32_t unit_len, u_int32_t num_unit_info);
265 	QDF_STATUS (*mem_mgr_free_chunks)(struct wlan_objmgr_psoc *psoc,
266 			struct target_psoc_info *tgt_hdl);
267 	void (*print_svc_ready_ex_param)(
268 		 struct wlan_objmgr_psoc *psoc,
269 		 struct target_psoc_info *tgt_info);
270 	void (*add_11ax_modes)(
271 		 struct wlan_objmgr_psoc *psoc,
272 		 struct target_psoc_info *tgt_info);
273 	void (*set_default_tgt_config)(
274 		 struct wlan_objmgr_psoc *psoc,
275 		 struct target_psoc_info *tgt_info);
276 	QDF_STATUS (*sw_version_check)(
277 		 struct wlan_objmgr_psoc *psoc,
278 		 struct target_psoc_info *tgt_hdl,
279 		 uint8_t *evt_buf);
280 	void (*smart_log_enable)
281 		(struct wlan_objmgr_psoc *psoc,
282 		 struct target_psoc_info *tgt_info, uint8_t *event);
283 	void (*eapol_minrate_enable)
284 		(struct wlan_objmgr_psoc *psoc,
285 		 struct target_psoc_info *tgt_info, uint8_t *event);
286 };
287 
288 
289 
290 /**
291  * struct target_psoc_info - target psoc information
292  * @hdls: component handles (htc/htt/wmi) sub structure
293  * @info: target related info sub structure
294  * @feature_ptr: stores legacy pointer or few driver specific structures
295  * @tif_ops: holds driver specific function pointers
296  */
297 struct target_psoc_info {
298 	struct comp_hdls hdls;
299 	struct tgt_info info;
300 	void *feature_ptr;
301 	struct target_ops *tif_ops;
302 };
303 
304 /**
305  * struct target_pdev_info - target pdev information
306  * @wmi_handle: WMI handle
307  * @accelerator_hdl: NSS offload/IPA handles
308  * @pdev_idx: pdev id (of FW)
309  * @phy_idx: phy id (of FW)
310  * @feature_ptr: stores legacy pointer or few driver specific structures
311  */
312 struct target_pdev_info {
313 	struct common_wmi_handle *wmi_handle;
314 	struct common_accelerator_handle *accelerator_hdl;
315 	int32_t pdev_idx;
316 	int32_t phy_idx;
317 	void *feature_ptr;
318 };
319 
320 
321 /**
322  * target_if_init() - target_if Initialization
323  * @get_wmi_handle: function pointer to get wmi handle
324  *
325  *
326  * Return: QDF_STATUS
327  */
328 QDF_STATUS target_if_init(get_psoc_handle_callback psoc_hdl_cb);
329 
330 /**
331  * target_if_deinit() - Close target_if
332  * @scn_handle: scn handle
333  *
334  * Return: QDF_STATUS_SUCCESS - in case of success
335  */
336 QDF_STATUS target_if_deinit(void);
337 
338 /**
339  * target_if_store_pdev_target_if_ctx() - stores objmgr pdev in target if ctx
340  * @pdev_hdl_cb: function pointer to get objmgr pdev
341  *
342  * Return: QDF_STATUS_SUCCESS - in case of success
343  */
344 QDF_STATUS target_if_store_pdev_target_if_ctx(
345 		get_pdev_handle_callback pdev_hdl_cb);
346 
347 /**
348  * wlan_get_tgt_if_ctx() -Get target if ctx
349  *
350  * Return: target if ctx
351  */
352 struct target_if_ctx *target_if_get_ctx(void);
353 
354 /**
355  * target_if_get_psoc_from_scn_hdl() - get psoc from scn handle
356  * @scn_handle: scn handle
357  *
358  * This API is generally used while processing wmi event.
359  * In wmi event SCN handle will be passed by wmi hence
360  * using this API we can get psoc from scn handle.
361  *
362  * Return: index for matching scn handle
363  */
364 struct wlan_objmgr_psoc *target_if_get_psoc_from_scn_hdl(void *scn_handle);
365 
366 /**
367  * target_if_get_pdev_from_scn_hdl() - get pdev from scn handle
368  * @scn_handle: scn handle
369  *
370  * This API is generally used while processing wmi event.
371  * In wmi event SCN handle will be passed by wmi hence
372  * using this API we can get pdev from scn handle.
373  *
374  * Return: pdev for matching scn handle
375  */
376 struct wlan_objmgr_pdev *target_if_get_pdev_from_scn_hdl(void *scn_handle);
377 
378 /** target_if_register_tx_ops() - register tx_ops
379  * @tx_ops: tx_ops structure
380  *
381  * This function is to be used by components to populate
382  * the OL function pointers (tx_ops) required by the component
383  * for UMAC-LMAC interaction, with the appropriate handler
384  *
385  * Return: QDF STATUS
386  */
387 QDF_STATUS target_if_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
388 
389 /**
390  * target_if_get_psoc_legacy_service_ready_cb() - get psoc from scn handle
391  *
392  * This API is generally used while processing wmi event.
393  * In wmi event SCN handle will be passed by wmi hence
394  * using this API we can get psoc from scn handle.
395  *
396  * Return: wmi_legacy_service_ready_callback
397  */
398 wmi_legacy_service_ready_callback
399 		target_if_get_psoc_legacy_service_ready_cb(void);
400 
401 /**
402  * target_if_register_legacy_service_ready_cb() - get legacy
403  *                                       service ready handler from scn handle
404  *
405  * @service_ready_cb: function pointer to service ready callback
406  *
407  * Return: QDF Status
408  */
409 QDF_STATUS target_if_register_legacy_service_ready_cb(
410 	wmi_legacy_service_ready_callback service_ready_cb);
411 
412 /**
413  * target_if_alloc_pdev_tgt_info() - alloc pdev tgt info
414  * @pdev: pointer to pdev
415  *
416  * API to allocate memory for target_pdev_info
417  *
418  * Return: SUCCESS on successful memory allocation or Failure
419  */
420 QDF_STATUS target_if_alloc_pdev_tgt_info(struct wlan_objmgr_pdev *pdev);
421 
422 /**
423  * target_if_free_pdev_tgt_info() - free pdev tgt info
424  * @pdev: pointer to pdev
425  *
426  * API to free allocated memory for target_pdev_info
427  *
428  * Return: SUCCESS on successful memory deallocation or Failure
429  */
430 QDF_STATUS target_if_free_pdev_tgt_info(struct wlan_objmgr_pdev *pdev);
431 
432 /**
433  * target_if_alloc_psoc_tgt_info() - alloc psoc tgt info
434  * @psoc: pointer to psoc
435  *
436  * API to allocate memory for target_psoc_info
437  *
438  * Return: SUCCESS on successful memory allocation or Failure
439  */
440 QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc);
441 
442 /**
443  * target_if_free_psoc_tgt_info() - free psoc tgt info
444  * @psoc: pointer to psoc
445  *
446  * API to free allocated memory for target_psoc_info
447  *
448  * Return: SUCCESS on successful memory deallocation or Failure
449  */
450 QDF_STATUS target_if_free_psoc_tgt_info(struct wlan_objmgr_psoc *psoc);
451 
452 /**
453  * target_is_tgt_type_ar900b() - Check if the target type is AR900B
454  * @target_type: target type to be checked.
455  *
456  * Return: true if the target_type is AR900B, else false.
457  */
458 bool target_is_tgt_type_ar900b(uint32_t target_type);
459 
460 /**
461  * target_is_tgt_type_ipq4019() - Check if the target type is IPQ4019
462  * @target_type: target type to be checked.
463  *
464  * Return: true if the target_type is IPQ4019, else false.
465  */
466 bool target_is_tgt_type_ipq4019(uint32_t target_type);
467 
468 /**
469  * target_is_tgt_type_qca9984() - Check if the target type is QCA9984
470  * @target_type: target type to be checked.
471  *
472  * Return: true if the target_type is QCA9984, else false.
473  */
474 bool target_is_tgt_type_qca9984(uint32_t target_type);
475 
476 /**
477  * target_is_tgt_type_qca9888() - Check if the target type is QCA9888
478  * @target_type: target type to be checked.
479  *
480  * Return: true if the target_type is QCA9888, else false.
481  */
482 bool target_is_tgt_type_qca9888(uint32_t target_type);
483 
484 
485 /**
486  * target_psoc_set_wlan_init_status() - set info wlan_init_status
487  * @psoc_info:          pointer to structure target_psoc_info
488  * @wlan_init_status:   FW init status
489  *
490  * API to set wlan_init_status
491  *
492  * Return: void
493  */
494 static inline void target_psoc_set_wlan_init_status
495 		(struct target_psoc_info *psoc_info, uint32_t wlan_init_status)
496 {
497 	if (psoc_info == NULL)
498 		return;
499 
500 	psoc_info->info.wlan_init_status = wlan_init_status;
501 }
502 
503 /**
504  * target_psoc_get_wlan_init_status() - get info wlan_init_status
505  * @psoc_info:  pointer to structure target_psoc_info
506  *
507  * API to get wlan_init_status
508  *
509  * Return: uint32_t
510  */
511 static inline uint32_t target_psoc_get_wlan_init_status
512 		(struct target_psoc_info *psoc_info)
513 {
514 	if (psoc_info == NULL)
515 		return (uint32_t)-1;
516 
517 	return psoc_info->info.wlan_init_status;
518 }
519 
520 /**
521  * target_psoc_set_target_type() - set info target_type
522  * @psoc_info:  pointer to structure target_psoc_info
523  * @target_type: Target type
524  *
525  * API to set target_type
526  *
527  * Return: void
528  */
529 static inline void target_psoc_set_target_type
530 		(struct target_psoc_info *psoc_info, uint32_t target_type)
531 {
532 	if (psoc_info == NULL)
533 		return;
534 
535 	psoc_info->info.target_type = target_type;
536 }
537 
538 /**
539  * target_psoc_get_target_type() - get info target_type
540  * @psoc_info:  pointer to structure target_psoc_info
541  *
542  * API to get target_type
543  *
544  * Return: unit32_t
545  */
546 static inline uint32_t target_psoc_get_target_type
547 		(struct target_psoc_info *psoc_info)
548 {
549 	if (psoc_info == NULL)
550 		return (uint32_t)-1;
551 
552 	return psoc_info->info.target_type;
553 }
554 
555 /**
556  * target_psoc_set_max_descs() - set info max_descs
557  * @psoc_info:  pointer to structure target_psoc_info
558  * @max_descs:  Max descriptors
559  *
560  * API to set max_descs
561  *
562  * Return: void
563  */
564 static inline void target_psoc_set_max_descs
565 		(struct target_psoc_info *psoc_info, uint32_t max_descs)
566 {
567 	if (psoc_info == NULL)
568 		return;
569 
570 	psoc_info->info.max_descs = max_descs;
571 }
572 
573 /**
574  * target_psoc_get_max_descs() - get info max_descs
575  * @psoc_info:  pointer to structure target_psoc_info
576  *
577  * API to get max_descs
578  *
579  * Return: unint32_t
580  */
581 static inline uint32_t target_psoc_get_max_descs
582 		(struct target_psoc_info *psoc_info)
583 {
584 	if (psoc_info == NULL)
585 		return (uint32_t)-1;
586 
587 	return psoc_info->info.max_descs;
588 }
589 
590 /**
591  * target_psoc_set_wmi_service_ready() - set info wmi_service_ready
592  * @psoc_info:         pointer to structure target_psoc_info
593  * @wmi_service_ready: service ready flag
594  *
595  * API to set wmi_service_ready
596  *
597  * Return: void
598  */
599 static inline void target_psoc_set_wmi_service_ready
600 		(struct target_psoc_info *psoc_info, bool wmi_service_ready)
601 {
602 	if (psoc_info == NULL)
603 		return;
604 
605 	psoc_info->info.wmi_service_ready = wmi_service_ready;
606 }
607 
608 /**
609  * target_psoc_get_wmi_service_ready() - get info wmi_service_ready
610  * @psoc_info:  pointer to structure target_psoc_info
611  *
612  * API to get wmi_service_ready
613  *
614  * Return: bool
615  */
616 static inline bool target_psoc_get_wmi_service_ready
617 		(struct target_psoc_info *psoc_info)
618 {
619 	return psoc_info->info.wmi_service_ready;
620 }
621 
622 /**
623  * target_psoc_set_wmi_ready() - set info wmi_ready
624  * @psoc_info:  pointer to structure target_psoc_info
625  * @wmi_ready:  Ready event flag
626  *
627  * API to set wmi_ready
628  *
629  * Return: void
630  */
631 static inline void target_psoc_set_wmi_ready
632 		(struct target_psoc_info *psoc_info, bool wmi_ready)
633 {
634 	if (psoc_info == NULL)
635 		return;
636 
637 	psoc_info->info.wmi_ready = wmi_ready;
638 }
639 
640 /**
641  * target_psoc_get_wmi_ready() - get info wmi_ready
642  * @psoc_info:  pointer to structure target_psoc_info
643  *
644  * API to get wmi_ready
645  *
646  * Return: bool
647  */
648 static inline bool target_psoc_get_wmi_ready
649 		(struct target_psoc_info *psoc_info)
650 {
651 	return psoc_info->info.wmi_ready;
652 }
653 
654 /**
655  * target_psoc_set_preferred_hw_mode() - set preferred_hw_mode
656  * @psoc_info:  pointer to structure target_psoc_info
657  * @preferred_hw_mode: Preferred HW mode
658  *
659  * API to set preferred_hw_mode
660  *
661  * Return: void
662  */
663 static inline void target_psoc_set_preferred_hw_mode(
664 		struct target_psoc_info *psoc_info, uint32_t preferred_hw_mode)
665 {
666 	if (psoc_info == NULL)
667 		return;
668 
669 	psoc_info->info.preferred_hw_mode = preferred_hw_mode;
670 }
671 
672 /**
673  * target_psoc_get_preferred_hw_mode() - get preferred_hw_mode
674  * @psoc_info:  pointer to structure target_psoc_info
675  *
676  * API to get preferred_hw_mode
677  *
678  * Return: unint32_t
679  */
680 static inline uint32_t target_psoc_get_preferred_hw_mode
681 		(struct target_psoc_info *psoc_info)
682 {
683 	if (psoc_info == NULL)
684 		return WMI_HOST_HW_MODE_MAX;
685 
686 	return psoc_info->info.preferred_hw_mode;
687 }
688 
689 /**
690  * target_psoc_get_supported_hw_modes() - get supported_hw_mode in target
691  * @psoc_info:  pointer to structure target_psoc_info
692  *
693  * API to get list of supported HW modes
694  *
695  * Return: pointer to target_supported_modes
696  */
697 static inline struct target_supported_modes *target_psoc_get_supported_hw_modes
698 		(struct target_psoc_info *psoc_info)
699 {
700 	if (!psoc_info)
701 		return NULL;
702 
703 	return &psoc_info->info.hw_modes;
704 }
705 
706 /**
707  * target_psoc_set_wmi_timeout() - set wmi_timeout
708  * @psoc_info:  pointer to structure target_psoc_info
709  * @wmi_timeout: WMI timeout value in sec
710  *
711  * API to set wmi_timeout
712  *
713  * Return: void
714  */
715 static inline void target_psoc_set_wmi_timeout
716 		(struct target_psoc_info *psoc_info, uint32_t wmi_timeout)
717 {
718 	if (psoc_info == NULL)
719 		return;
720 
721 	psoc_info->info.wmi_timeout = wmi_timeout;
722 }
723 
724 /**
725  * target_psoc_get_wmi_timeout() - get wmi_timeout
726  * @psoc_info:  pointer to structure target_psoc_info
727  *
728  * API to get wmi_timeout
729  *
730  * Return: unint32_t
731  */
732 static inline uint32_t target_psoc_get_wmi_timeout
733 		(struct target_psoc_info *psoc_info)
734 {
735 	if (psoc_info == NULL)
736 		return (uint32_t)-1;
737 
738 	return psoc_info->info.wmi_timeout;
739 }
740 
741 /**
742  * target_psoc_set_total_mac_phy_cnt() - set total_mac_phy
743  * @psoc_info:  pointer to structure target_psoc_infoa
744  * @total_mac_phy_cnt: Total MAC PHY cnt
745  *
746  * API to set total_mac_phy
747  *
748  * Return: void
749  */
750 static inline void target_psoc_set_total_mac_phy_cnt
751 		(struct target_psoc_info *psoc_info, uint8_t total_mac_phy_cnt)
752 {
753 	if (psoc_info == NULL)
754 		return;
755 
756 	psoc_info->info.total_mac_phy_cnt = total_mac_phy_cnt;
757 }
758 
759 /**
760  * target_psoc_get_total_mac_phy_cnt() - get total_mac_phy
761  * @psoc_info:  pointer to structure target_psoc_info
762  *
763  * API to get total_mac_phy
764  *
765  * Return: unint8_t
766  */
767 static inline uint8_t target_psoc_get_total_mac_phy_cnt(
768 		struct target_psoc_info *psoc_info)
769 {
770 	if (psoc_info == NULL)
771 		return 0;
772 
773 	return psoc_info->info.total_mac_phy_cnt;
774 }
775 
776 /**
777  * target_psoc_set_num_radios() - set num of radios
778  * @psoc_info:  pointer to structure target_psoc_info
779  * @num_radios: Number of radios
780  *
781  * API to set number of radios
782  *
783  * Return: number of radios
784  */
785 static inline void target_psoc_set_num_radios(
786 		struct target_psoc_info *psoc_info, uint8_t num_radios)
787 {
788 	if (psoc_info == NULL)
789 		return;
790 
791 	psoc_info->info.num_radios = num_radios;
792 }
793 
794 /**
795  * target_psoc_get_num_radios() - get number of radios
796  * @psoc_info:  pointer to structure target_psoc_info
797  *
798  * API to get number_of_radios
799  *
800  * Return: number of radios
801  */
802 static inline uint8_t target_psoc_get_num_radios
803 		(struct target_psoc_info *psoc_info)
804 {
805 	if (psoc_info == NULL)
806 		return 0;
807 
808 	return psoc_info->info.num_radios;
809 }
810 
811 /**
812  * target_psoc_set_service_bitmap() - set service_bitmap
813  * @psoc_info:  pointer to structure target_psoc_info
814  * @service_bitmap: FW service bitmap
815  *
816  * API to set service_bitmap
817  *
818  * Return: void
819  */
820 static inline void target_psoc_set_service_bitmap
821 		(struct target_psoc_info *psoc_info, uint32_t *service_bitmap)
822 {
823 	qdf_mem_copy(psoc_info->info.service_bitmap, service_bitmap,
824 			sizeof(psoc_info->info.service_bitmap));
825 }
826 
827 /**
828  * target_psoc_get_service_bitmap() - get service_bitmap
829  * @psoc_info:  pointer to structure target_psoc_info
830  *
831  * API to get service_bitmap
832  *
833  * Return: unint32_t
834  */
835 static inline uint32_t *target_psoc_get_service_bitmap
836 		(struct target_psoc_info *psoc_info)
837 {
838 	return psoc_info->info.service_bitmap;
839 }
840 
841 /**
842  * target_psoc_set_num_mem_chunks - set num_mem_chunks
843  * @psoc_info:  pointer to structure target_psoc_info
844  & @num_mem_chunks: Num Memory chunks allocated for FW
845  *
846  * API to set num_mem_chunks
847  *
848  * Return: void
849  */
850 static inline void target_psoc_set_num_mem_chunks(
851 		struct target_psoc_info *psoc_info, uint32_t num_mem_chunks)
852 {
853 	if (psoc_info == NULL)
854 		return;
855 	psoc_info->info.num_mem_chunks = num_mem_chunks;
856 }
857 
858 /**
859  * target_psoc_get_num_mem_chunks() - get num_mem_chunks
860  * @psoc_info:  pointer to structure target_psoc_info
861  *
862  * API to get total_mac_phy
863  *
864  * Return: unint8_t
865  */
866 static inline uint32_t target_psoc_get_num_mem_chunks
867 		(struct target_psoc_info *psoc_info)
868 {
869 	if (psoc_info == NULL)
870 		return (uint32_t)-1;
871 
872 	return psoc_info->info.num_mem_chunks;
873 }
874 /**
875  * target_psoc_set_hif_hdl - set hif_hdl
876  * @psoc_info:  pointer to structure target_psoc_info
877  * @hif_hdl:    HIF handle
878  *
879  * API to set hif_hdl
880  *
881  * Return: void
882  */
883 static inline void target_psoc_set_hif_hdl
884 		(struct target_psoc_info *psoc_info,
885 		 struct common_hif_handle *hif_hdl)
886 {
887 	if (psoc_info == NULL)
888 		return;
889 
890 	psoc_info->hdls.hif_hdl = hif_hdl;
891 }
892 
893 /**
894  * target_psoc_get_hif_hdl() - get hif_hdl
895  * @psoc_info:  pointer to structure target_psoc_info
896  *
897  * API to get hif_hdl
898  *
899  * Return: hif_hdl
900  */
901 static inline struct common_hif_handle *target_psoc_get_hif_hdl
902 		(struct target_psoc_info *psoc_info)
903 {
904 	if (psoc_info == NULL)
905 		return NULL;
906 
907 	return psoc_info->hdls.hif_hdl;
908 }
909 
910 /**
911  * target_psoc_set_hif_hdl - set htc_hdl
912  * @psoc_info:  pointer to structure target_psoc_info
913  * @htc_hdl:    HTC handle
914  *
915  * API to set htc_hdl
916  *
917  * Return: void
918  */
919 static inline void target_psoc_set_htc_hdl
920 		(struct target_psoc_info *psoc_info,
921 		 struct common_htc_handle *htc_hdl)
922 {
923 	if (psoc_info == NULL)
924 		return;
925 
926 	psoc_info->hdls.htc_hdl = htc_hdl;
927 }
928 
929 /**
930  * target_psoc_get_htc_hdl() - get htc_hdl
931  * @psoc_info:  pointer to structure target_psoc_info
932  *
933  * API to get htc_hdl
934  *
935  * Return: htc_hdl
936  */
937 static inline struct common_htc_handle *target_psoc_get_htc_hdl
938 		(struct target_psoc_info *psoc_info)
939 {
940 	if (psoc_info == NULL)
941 		return NULL;
942 
943 	return psoc_info->hdls.htc_hdl;
944 }
945 /**
946  * target_psoc_set_wmi_hdl - set wmi_hdl
947  * @psoc_info:  pointer to structure target_psoc_info
948  * @wmi_hdl:    WMI handle
949  *
950  * API to set wmi_hdl
951  *
952  * Return: void
953  */
954 static inline void target_psoc_set_wmi_hdl
955 		(struct target_psoc_info *psoc_info,
956 		 struct common_wmi_handle *wmi_hdl)
957 {
958 	if (psoc_info == NULL)
959 		return;
960 
961 	psoc_info->hdls.wmi_hdl = wmi_hdl;
962 }
963 
964 /**
965  * target_psoc_get_wmi_hdl() - get wmi_hdl
966  * @psoc_info:  pointer to structure target_psoc_info
967  *
968  * API to get wmi_hdl
969  *
970  * Return: wmi_hdl
971  */
972 static inline struct common_wmi_handle *target_psoc_get_wmi_hdl
973 		(struct target_psoc_info *psoc_info)
974 {
975 	if (psoc_info == NULL)
976 		return NULL;
977 
978 	return psoc_info->hdls.wmi_hdl;
979 }
980 
981 /**
982  * target_psoc_set_accelerator_hdl - set accelerator_hdl
983  * @psoc_info:  pointer to structure target_psoc_info
984  * @accelerator_hdl: Accelator handle
985  *
986  * API to set accelerator_hdl
987  *
988  * Return: void
989  */
990 static inline void target_psoc_set_accelerator_hdl
991 		(struct target_psoc_info *psoc_info,
992 		 struct common_accelerator_handle *accelerator_hdl)
993 {
994 	if (psoc_info == NULL)
995 		return;
996 
997 	psoc_info->hdls.accelerator_hdl = accelerator_hdl;
998 }
999 
1000 /**
1001  * target_psoc_get_accelerator_hdl() - get accelerator_hdl
1002  * @psoc_info:  pointer to structure target_psoc_info
1003  *
1004  * API to get accelerator_hdl
1005  *
1006  * Return: accelerator_hdl
1007  */
1008 static inline
1009 struct common_accelerator_handle *target_psoc_get_accelerator_hdl
1010 		(struct target_psoc_info *psoc_info)
1011 {
1012 	if (psoc_info == NULL)
1013 		return NULL;
1014 
1015 	return psoc_info->hdls.accelerator_hdl;
1016 }
1017 
1018 /**
1019  * target_psoc_set_feature_ptr - set feature_ptr
1020  * @psoc_info:  pointer to structure target_psoc_info
1021  * @feature_ptr: set feature pointer
1022  *
1023  * API to set feature_ptr
1024  *
1025  * Return: void
1026  */
1027 static inline void target_psoc_set_feature_ptr
1028 		(struct target_psoc_info *psoc_info, void *feature_ptr)
1029 {
1030 	if (psoc_info == NULL)
1031 		return;
1032 
1033 	psoc_info->feature_ptr = feature_ptr;
1034 }
1035 
1036 /**
1037  * target_psoc_get_feature_ptr() - get feature_ptr
1038  * @psoc_info:  pointer to structure target_psoc_info
1039  *
1040  * API to get feature_ptr
1041  *
1042  * Return: feature_ptr
1043  */
1044 static inline void *target_psoc_get_feature_ptr
1045 		(struct target_psoc_info *psoc_info)
1046 {
1047 	if (psoc_info == NULL)
1048 		return NULL;
1049 
1050 	return psoc_info->feature_ptr;
1051 }
1052 
1053 /**
1054  * target_psoc_get_version()- get host_fw_ver version
1055  * @psoc_info:  pointer to structure target_psoc_info
1056  *
1057  * API to get host_fw_ver version
1058  *
1059  * Return: void
1060  */
1061 static inline struct host_fw_ver *target_psoc_get_version
1062 		(struct target_psoc_info *psoc_info)
1063 {
1064 	return &psoc_info->info.version;
1065 }
1066 
1067 /**
1068  * target_psoc_get_target_ver()- get target version
1069  * @psoc_info:  pointer to structure target_psoc_info
1070  *
1071  * API to get target version
1072  *
1073  * Return: target version
1074  */
1075 static inline uint32_t target_psoc_get_target_ver
1076 		(struct target_psoc_info *psoc_info)
1077 {
1078 	return psoc_info->info.version.target_ver;
1079 }
1080 
1081 /**
1082  * target_psoc_set_target_ver()- set target version
1083  * @psoc_info:  pointer to structure target_psoc_info
1084  * @target_ver: Target version
1085  *
1086  * API to set target version
1087  *
1088  * Return: void
1089  */
1090 static inline void target_psoc_set_target_ver
1091 		(struct target_psoc_info *psoc_info, uint32_t target_ver)
1092 {
1093 	if (psoc_info == NULL)
1094 		return;
1095 
1096 	psoc_info->info.version.target_ver = target_ver;
1097 }
1098 
1099 /**
1100  * target_psoc_set_target_rev()- set target revision
1101  * @psoc_info:  pointer to structure target_psoc_info
1102  * @target_rev: Target revision
1103  *
1104  * API to get target version
1105  *
1106  * Return: void
1107  */
1108 static inline void target_psoc_set_target_rev
1109 		(struct target_psoc_info *psoc_info, uint32_t target_rev)
1110 {
1111 	if (psoc_info == NULL)
1112 		return;
1113 
1114 	psoc_info->info.version.target_rev = target_rev;
1115 }
1116 
1117 /**
1118  * target_psoc_get_target_rev()- get target revision
1119  * @psoc_info:  pointer to structure target_psoc_info
1120  *
1121  * API to get target revision
1122  *
1123  * Return: target revision
1124  */
1125 static inline uint32_t target_psoc_get_target_rev
1126 		(struct target_psoc_info *psoc_info)
1127 {
1128 	return psoc_info->info.version.target_rev;
1129 }
1130 
1131 /**
1132  * target_psoc_set_dbglog_hdl - set dbglog_hdl
1133  * @psoc_info:  pointer to structure target_psoc_info
1134  * @dbglog_hdl:    dbglog handle
1135  *
1136  * API to set dbglog_hdl
1137  *
1138  * Return: void
1139  */
1140 static inline void target_psoc_set_dbglog_hdl
1141 		(struct target_psoc_info *psoc_info,
1142 		 struct common_dbglog_handle *dbglog_hdl)
1143 {
1144 	if (psoc_info == NULL)
1145 		return;
1146 
1147 	psoc_info->hdls.dbglog_hdl = dbglog_hdl;
1148 }
1149 
1150 /**
1151  * target_psoc_get_dbglog_hdl() - get dbglog_hdl
1152  * @psoc_info:  pointer to structure target_psoc_info
1153  *
1154  * API to get dbglog_hdl
1155  *
1156  * Return: dbglog_hdl
1157  */
1158 static inline struct common_dbglog_handle *target_psoc_get_dbglog_hdl
1159 		(struct target_psoc_info *psoc_info)
1160 {
1161 	if (psoc_info == NULL)
1162 		return NULL;
1163 
1164 	return psoc_info->hdls.dbglog_hdl;
1165 }
1166 
1167 /**
1168  * target_psoc_get_wlan_res_cfg() - get wlan_res_cfg
1169  * @psoc_info:  pointer to structure target_psoc_info
1170  *
1171  * API to get wlan_res_cfg
1172  *
1173  * Return: structure pointer to host_fw_ver
1174  */
1175 static inline target_resource_config *target_psoc_get_wlan_res_cfg
1176 		(struct target_psoc_info *psoc_info)
1177 {
1178 	if (psoc_info == NULL)
1179 		return NULL;
1180 
1181 	return &psoc_info->info.wlan_res_cfg;
1182 }
1183 
1184 /**
1185  * target_psoc_get_wlan_ext_res_cfg() - get wlan_ext_res_cfg
1186  * @psoc_info:  pointer to structure target_psoc_info
1187  *
1188  * API to get wlan_ext_res_cfg
1189  *
1190  * Return: structure pointer to wmi_host_ext_resource_config
1191  */
1192 static inline wmi_host_ext_resource_config *target_psoc_get_wlan_ext_res_cfg
1193 		(struct target_psoc_info *psoc_info)
1194 {
1195 	if (psoc_info == NULL)
1196 		return NULL;
1197 
1198 	return &psoc_info->info.wlan_ext_res_cfg;
1199 }
1200 
1201 /**
1202  * target_psoc_get_event_queue() - get event_queue
1203  * @psoc_info:  pointer to structure target_psoc_info
1204  *
1205  * API to get event_queue
1206  *
1207  * Return: structure pointer to qdf_wait_queue_head_t
1208  */
1209 static inline qdf_event_t *target_psoc_get_event
1210 		(struct target_psoc_info *psoc_info)
1211 {
1212 	if (psoc_info == NULL)
1213 		return NULL;
1214 
1215 	return &psoc_info->info.event;
1216 }
1217 
1218 /**
1219  * target_psoc_get_target_caps() - get target_caps
1220  * @psoc_info:  pointer to structure target_psoc_info
1221  *
1222  * API to get target_caps
1223  *
1224  * Return: structure pointer to wlan_psoc_target_capability_info
1225  */
1226 static inline struct wlan_psoc_target_capability_info
1227 		*target_psoc_get_target_caps(struct target_psoc_info *psoc_info)
1228 {
1229 	if (psoc_info == NULL)
1230 		return NULL;
1231 
1232 	return &psoc_info->info.target_caps;
1233 }
1234 
1235 /**
1236  * target_psoc_get_service_ext_param() - get service_ext_param
1237  * @psoc_info:  pointer to structure target_psoc_info
1238  *
1239  * API to get service_ext_param
1240  *
1241  * Return: structure pointer to wlan_psoc_host_service_ext_param
1242  */
1243 static inline struct wlan_psoc_host_service_ext_param
1244 		*target_psoc_get_service_ext_param
1245 		(struct target_psoc_info *psoc_info)
1246 {
1247 	if (psoc_info == NULL)
1248 		return NULL;
1249 
1250 	return &psoc_info->info.service_ext_param;
1251 }
1252 
1253 
1254 /**
1255  * target_psoc_get_mac_phy_cap() - get mac_phy_cap
1256  * @psoc_info:  pointer to structure target_psoc_info
1257  *
1258  * API to get mac_phy_cap
1259  *
1260  * Return: structure pointer to wlan_psoc_host_mac_phy_caps
1261  */
1262 static inline struct wlan_psoc_host_mac_phy_caps *target_psoc_get_mac_phy_cap
1263 		(struct target_psoc_info *psoc_info)
1264 {
1265 	if (psoc_info == NULL)
1266 		return NULL;
1267 
1268 	return psoc_info->info.mac_phy_cap;
1269 }
1270 
1271 /**
1272  * target_psoc_get_dbr_ring_caps() - get dbr_ring_cap
1273  * @psoc_info:  pointer to structure target_psoc_info
1274  *
1275  * API to get dbr_ring_cap
1276  *
1277  * Return: structure pointer to wlan_psoc_host_dbr_ring_caps
1278  */
1279 static inline struct wlan_psoc_host_dbr_ring_caps
1280 	*target_psoc_get_dbr_ring_caps(struct target_psoc_info *psoc_info)
1281 {
1282 	if (psoc_info == NULL)
1283 		return NULL;
1284 
1285 	return psoc_info->info.dbr_ring_cap;
1286 }
1287 /**
1288  * target_psoc_get_mem_chunks() - get mem_chunks
1289  * @psoc_info:  pointer to structure target_psoc_info
1290  *
1291  * API to get mem_chunks
1292  *
1293  * Return: structure pointer to wmi_host_mem_chunk
1294  */
1295 static inline struct wmi_host_mem_chunk *target_psoc_get_mem_chunks
1296 		(struct target_psoc_info *psoc_info)
1297 {
1298 	if (psoc_info == NULL)
1299 		return NULL;
1300 
1301 	return psoc_info->info.mem_chunks;
1302 }
1303 
1304 /**
1305  * target_psoc_get_tif_ops() - get tif_ops
1306  * @psoc_info:  pointer to structure target_psoc_info
1307  *
1308  * API to get tif_ops
1309  *
1310  * Return: structure pointer to target_ops
1311  */
1312 static inline struct target_ops *target_psoc_get_tif_ops
1313 		(struct target_psoc_info *psoc_info)
1314 {
1315 	if (psoc_info == NULL)
1316 		return NULL;
1317 
1318 	return psoc_info->tif_ops;
1319 }
1320 
1321 /**
1322  * target_pdev_set_feature_ptr - set feature_ptr
1323  * @pdev_info:  pointer to structure target_pdev_info
1324  * @feature_ptr: Feature pointer
1325  *
1326  * API to set feature_ptr
1327  *
1328  * Return: void
1329  */
1330 static inline void target_pdev_set_feature_ptr
1331 		(struct target_pdev_info *pdev_info, void *feature_ptr)
1332 {
1333 	if (pdev_info == NULL)
1334 		return;
1335 
1336 	pdev_info->feature_ptr = feature_ptr;
1337 }
1338 
1339 /**
1340  * target_pdev_get_feature_ptr() - get feature_ptr
1341  * @pdev_info:  pointer to structure target_pdev_info
1342  *
1343  * API to get feature_ptr
1344  *
1345  * Return: feature_ptr
1346  */
1347 static inline void *target_pdev_get_feature_ptr
1348 		(struct target_pdev_info *pdev_info)
1349 {
1350 	if (pdev_info == NULL)
1351 		return NULL;
1352 
1353 	return pdev_info->feature_ptr;
1354 }
1355 
1356 /**
1357  * target_pdev_set_wmi_handle - set wmi_handle
1358  * @pdev_info:  pointer to structure target_pdev_info
1359  * @wmi_handle: WMI handle
1360  *
1361  * API to set wmi_handle
1362  *
1363  * Return: void
1364  */
1365 static inline void target_pdev_set_wmi_handle
1366 		(struct target_pdev_info *pdev_info,
1367 		 struct common_wmi_handle *wmi_handle)
1368 {
1369 	if (pdev_info == NULL)
1370 		return;
1371 
1372 	pdev_info->wmi_handle = wmi_handle;
1373 }
1374 
1375 /**
1376  * target_pdev_get_wmi_handle - get wmi_handle
1377  * @pdev_info:  pointer to structure target_dev_info
1378  *
1379  * API to get wmi_handle
1380  *
1381  * Return: wmi_handle
1382  */
1383 static inline struct common_wmi_handle *target_pdev_get_wmi_handle
1384 		(struct target_pdev_info *pdev_info)
1385 {
1386 	if (pdev_info == NULL)
1387 		return NULL;
1388 
1389 	return pdev_info->wmi_handle;
1390 }
1391 
1392 /**
1393  * target_pdev_set_accelerator_hdl - set accelerator_hdl
1394  * @pdev_info:  pointer to structure target_pdev_info
1395  * @accelerator_hdl: Accelator handle
1396  *
1397  * API to set accelerator_hdl
1398  *
1399  * Return: void
1400  */
1401 static inline void target_pdev_set_accelerator_hdl
1402 		(struct target_pdev_info *pdev_info,
1403 		 struct common_accelerator_handle *accelerator_hdl)
1404 {
1405 	if (pdev_info == NULL)
1406 		return;
1407 
1408 	pdev_info->accelerator_hdl = accelerator_hdl;
1409 }
1410 
1411 /**
1412  * target_pdev_get_accelerator_hdl - get accelerator_hdl
1413  * @pdev_info:  pointer to structure target_dev_info
1414  *
1415  * API to get accelerator_hdl
1416  *
1417  * Return: accelerator_hdl
1418  */
1419 static inline struct common_accelerator_handle *
1420 target_pdev_get_accelerator_hdl(struct target_pdev_info *pdev_info)
1421 {
1422 	if (pdev_info == NULL)
1423 		return NULL;
1424 
1425 	return pdev_info->accelerator_hdl;
1426 }
1427 
1428 /**
1429  * target_pdev_set_pdev_idx - set pdev_idx
1430  * @pdev_info:  pointer to structure target_pdev_info
1431  * @pdev_idx:   PDEV id of FW
1432  *
1433  * API to set pdev_idx
1434  *
1435  * Return: void
1436  */
1437 static inline void target_pdev_set_pdev_idx
1438 		(struct target_pdev_info *pdev_info, int32_t pdev_idx)
1439 {
1440 	if (pdev_info == NULL)
1441 		return;
1442 
1443 	pdev_info->pdev_idx = pdev_idx;
1444 }
1445 
1446 /**
1447  * target_pdev_get_pdev_idx  - get pdev_idx
1448  * @pdev_info:  pointer to structure target_dev_info
1449  *
1450  * API to get pdev_idx
1451  *
1452  * Return: int32_t
1453  */
1454 static inline int32_t  target_pdev_get_pdev_idx
1455 		(struct target_pdev_info *pdev_info)
1456 {
1457 	if (pdev_info == NULL)
1458 		return -EINVAL;
1459 
1460 	return pdev_info->pdev_idx;
1461 }
1462 
1463 /**
1464  * target_pdev_set_phy_idx - set phy_idx
1465  * @pdev_info:  pointer to structure target_pdev_info
1466  * @phy_idx:    phy ID of FW
1467  *
1468  * API to set phy_idx
1469  *
1470  * Return: void
1471  */
1472 static inline void target_pdev_set_phy_idx
1473 		(struct target_pdev_info *pdev_info, int32_t phy_idx)
1474 {
1475 	if (pdev_info == NULL)
1476 		return;
1477 
1478 	pdev_info->phy_idx  = phy_idx;
1479 }
1480 
1481 /**
1482  * target_pdev_get_phy_idx  - get phy_idx
1483  * @pdev_info:  pointer to structure target_dev_info
1484  *
1485  * API to get phy_idx
1486  *
1487  * Return: int32_t
1488  */
1489 static inline int32_t target_pdev_get_phy_idx
1490 		(struct target_pdev_info *pdev_info)
1491 {
1492 	if (pdev_info == NULL)
1493 		return -EINVAL;
1494 
1495 	return pdev_info->phy_idx;
1496 }
1497 
1498 /**
1499  * GET_WMI_HDL_FROM_PSOC - get wmi handle from psoc
1500  * @psoc:  psoc object
1501  *
1502  * API to get wmi_handle from psoc
1503  *
1504  * Return: wmi_handle on success
1505  *         if tgt handle is not initialized, it returns NULL
1506  */
1507 static inline struct common_wmi_handle *GET_WMI_HDL_FROM_PSOC(
1508 		struct wlan_objmgr_psoc *psoc)
1509 {
1510 	void *tgt_if_handle;
1511 
1512 	if (psoc) {
1513 		tgt_if_handle = psoc->tgt_if_handle;
1514 
1515 		if (tgt_if_handle)
1516 			return (target_psoc_get_wmi_hdl(
1517 				(struct target_psoc_info *)tgt_if_handle));
1518 		else
1519 			return NULL;
1520 	}
1521 
1522 	return NULL;
1523 }
1524 
1525 /**
1526  * GET_WMI_HDL_FROM_PDEV - get wmi handle from pdev
1527  * @pdev:  pdev object
1528  *
1529  * API to get wmi_handle from pdev
1530  *
1531  * Return: wmi_handle on success
1532  *         if tgt handle is not initialized, it returns NULL
1533  */
1534 static inline struct common_wmi_handle *GET_WMI_HDL_FROM_PDEV(
1535 		struct wlan_objmgr_pdev *pdev)
1536 {
1537 	void *tgt_if_handle;
1538 
1539 	if (pdev) {
1540 		tgt_if_handle =  pdev->tgt_if_handle;
1541 
1542 		if (tgt_if_handle)
1543 			return target_pdev_get_wmi_handle(tgt_if_handle);
1544 		else
1545 			return NULL;
1546 	}
1547 
1548 	return NULL;
1549 }
1550 
1551 /**
1552  * get_wmi_unified_hdl_from_psoc - get wmi handle from psoc
1553  * @psoc:  psoc object
1554  *
1555  * API to get wmi_handle from psoc
1556  *
1557  * Return: wmi_handle on success
1558  *         if tgt handle is not initialized, it returns NULL
1559  */
1560 static inline wmi_unified_t
1561 get_wmi_unified_hdl_from_psoc(struct wlan_objmgr_psoc *psoc)
1562 {
1563 	return (wmi_unified_t)GET_WMI_HDL_FROM_PSOC(psoc);
1564 }
1565 
1566 /**
1567  * get_wmi_unified_hdl_from_pdev - get wmi handle from pdev
1568  * @pdev:  pdev object
1569  *
1570  * API to get wmi_handle from pdev
1571  *
1572  * Return: wmi_handle on success
1573  *         if tgt handle is not initialized, it returns NULL
1574  */
1575 static inline wmi_unified_t
1576 get_wmi_unified_hdl_from_pdev(struct wlan_objmgr_pdev *pdev)
1577 {
1578 	return (wmi_unified_t)GET_WMI_HDL_FROM_PDEV(pdev);
1579 }
1580 
1581 /**
1582  * target_if_ext_res_cfg_enable - Enable ext resource config
1583  * @psoc:  psoc object
1584  * @tgt_hdl: target_psoc_info pointer
1585  * @evt_buf: Event buffer received from FW
1586  *
1587  * API to enable Ext resource config
1588  *
1589  * Return: none
1590  */
1591 static inline void target_if_ext_res_cfg_enable(struct wlan_objmgr_psoc *psoc,
1592 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1593 {
1594 	if ((tgt_hdl->tif_ops) &&
1595 		(tgt_hdl->tif_ops->ext_resource_config_enable))
1596 		tgt_hdl->tif_ops->ext_resource_config_enable(psoc,
1597 				tgt_hdl, evt_buf);
1598 }
1599 
1600 /**
1601  * target_if_peer_cfg_enable - Enable peer config
1602  * @psoc:  psoc object
1603  * @tgt_hdl: target_psoc_info pointer
1604  * @evt_buf: Event buffer received from FW
1605  *
1606  * API to enable peer config
1607  *
1608  * Return: none
1609  */
1610 static inline void target_if_peer_cfg_enable(struct wlan_objmgr_psoc *psoc,
1611 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1612 {
1613 	if ((tgt_hdl->tif_ops) &&
1614 		(tgt_hdl->tif_ops->peer_config))
1615 		tgt_hdl->tif_ops->peer_config(psoc, tgt_hdl, evt_buf);
1616 }
1617 
1618 /**
1619  * target_if_mesh_support_enable - Enable MESH mode support
1620  * @psoc:  psoc object
1621  * @tgt_hdl: target_psoc_info pointer
1622  * @evt_buf: Event buffer received from FW
1623  *
1624  * API to enable Mesh mode
1625  *
1626  * Return: none
1627  */
1628 static inline void target_if_mesh_support_enable(struct wlan_objmgr_psoc *psoc,
1629 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1630 {
1631 	if ((tgt_hdl->tif_ops) &&
1632 		(tgt_hdl->tif_ops->mesh_support_enable))
1633 		tgt_hdl->tif_ops->mesh_support_enable(psoc, tgt_hdl, evt_buf);
1634 }
1635 
1636 /**
1637  * target_if_eapol_minrate_enable - Enable EAPOL Minrate in Tunnel Mode
1638  * @psoc: psoc object
1639  * @tgt_hdl: target_psoc_info pointer
1640  * @evt_buf: Event buffer received from FW
1641  *
1642  * API to enable eapol minrate
1643  *
1644  * Return: none
1645  */
1646 static inline void target_if_eapol_minrate_enable(struct wlan_objmgr_psoc *psoc,
1647 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1648 {
1649 	if ((tgt_hdl->tif_ops) &&
1650 	    (tgt_hdl->tif_ops->eapol_minrate_enable))
1651 		tgt_hdl->tif_ops->eapol_minrate_enable(psoc, tgt_hdl, evt_buf);
1652 }
1653 
1654 /**
1655  * target_if_smart_antenna_enable - Enable Smart antenna module
1656  * @psoc:  psoc object
1657  * @tgt_hdl: target_psoc_info pointer
1658  * @evt_buf: Event buffer received from FW
1659  *
1660  * API to enable Smart antenna
1661  *
1662  * Return: none
1663  */
1664 static inline void target_if_smart_antenna_enable(struct wlan_objmgr_psoc *psoc,
1665 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1666 {
1667 	if ((tgt_hdl->tif_ops) &&
1668 		(tgt_hdl->tif_ops->smart_antenna_enable))
1669 		tgt_hdl->tif_ops->smart_antenna_enable(psoc, tgt_hdl, evt_buf);
1670 }
1671 
1672 /**
1673  * target_if_atf_cfg_enable - Enable ATF config
1674  * @psoc:  psoc object
1675  * @tgt_hdl: target_psoc_info pointer
1676  * @evt_buf: Event buffer received from FW
1677  *
1678  * API to enable ATF config
1679  *
1680  * Return: none
1681  */
1682 static inline void target_if_atf_cfg_enable(struct wlan_objmgr_psoc *psoc,
1683 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1684 {
1685 	if ((tgt_hdl->tif_ops) &&
1686 		(tgt_hdl->tif_ops->atf_config_enable))
1687 		tgt_hdl->tif_ops->atf_config_enable(psoc, tgt_hdl, evt_buf);
1688 }
1689 
1690 /**
1691  * target_if_qwrap_cfg_enable - Enable QWRAP config
1692  * @psoc:  psoc object
1693  * @tgt_hdl: target_psoc_info pointer
1694  * @evt_buf: Event buffer received from FW
1695  *
1696  * API to enable QWRAP config
1697  *
1698  * Return: none
1699  */
1700 static inline void target_if_qwrap_cfg_enable(struct wlan_objmgr_psoc *psoc,
1701 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1702 {
1703 	if ((tgt_hdl->tif_ops) &&
1704 		(tgt_hdl->tif_ops->qwrap_config_enable))
1705 		tgt_hdl->tif_ops->qwrap_config_enable(psoc, tgt_hdl, evt_buf);
1706 }
1707 
1708 /**
1709  * target_if_btcoex_cfg_enable - Enable BT coex config
1710  * @psoc:  psoc object
1711  * @tgt_hdl: target_psoc_info pointer
1712  * @evt_buf: Event buffer received from FW
1713  *
1714  * API to enable BT coex config
1715  *
1716  * Return: none
1717  */
1718 static inline void target_if_btcoex_cfg_enable(struct wlan_objmgr_psoc *psoc,
1719 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1720 {
1721 	if ((tgt_hdl->tif_ops) &&
1722 		(tgt_hdl->tif_ops->btcoex_config_enable))
1723 		tgt_hdl->tif_ops->btcoex_config_enable(psoc, tgt_hdl, evt_buf);
1724 }
1725 
1726 /**
1727  * target_if_lteu_cfg_enable - Enable LTEU config
1728  * @psoc:  psoc object
1729  * @tgt_hdl: target_psoc_info pointer
1730  * @evt_buf: Event buffer received from FW
1731  *
1732  * API to enable LTEU coex config
1733  *
1734  * Return: none
1735  */
1736 static inline void target_if_lteu_cfg_enable(struct wlan_objmgr_psoc *psoc,
1737 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1738 {
1739 	if ((tgt_hdl->tif_ops) &&
1740 		(tgt_hdl->tif_ops->lteu_ext_support_enable))
1741 		tgt_hdl->tif_ops->lteu_ext_support_enable(psoc,	tgt_hdl,
1742 								evt_buf);
1743 }
1744 
1745 /**
1746  * target_if_set_init_cmd_dev_param - Set init command params
1747  * @psoc:  psoc object
1748  * @tgt_hdl: target_psoc_info pointer
1749  *
1750  * API to set init command param based on config
1751  *
1752  * Return: none
1753  */
1754 static inline void target_if_set_init_cmd_dev_param(
1755 	struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl)
1756 {
1757 	if ((tgt_hdl->tif_ops) &&
1758 		(tgt_hdl->tif_ops->set_init_cmd_dev_based_params)) {
1759 		tgt_hdl->tif_ops->set_init_cmd_dev_based_params(psoc,
1760 					tgt_hdl);
1761 	}
1762 }
1763 
1764 /**
1765  * target_if_alloc_pdevs - Allocate PDEVs
1766  * @psoc:  psoc object
1767  * @tgt_hdl: target_psoc_info pointer
1768  *
1769  * API allocates PDEVs based on ext service ready param
1770  *
1771  * Return: SUCCESS on pdev allocation or PDEV allocation is not needed
1772  *         FAILURE, if allocation fails
1773  */
1774 static inline QDF_STATUS target_if_alloc_pdevs(struct wlan_objmgr_psoc *psoc,
1775 					struct target_psoc_info *tgt_hdl)
1776 {
1777 	QDF_STATUS ret_val;
1778 
1779 	if ((tgt_hdl->tif_ops) &&
1780 		(tgt_hdl->tif_ops->alloc_pdevs))
1781 		ret_val = tgt_hdl->tif_ops->alloc_pdevs(psoc, tgt_hdl);
1782 	else
1783 		ret_val = QDF_STATUS_SUCCESS;
1784 
1785 	return ret_val;
1786 }
1787 
1788 /**
1789  * target_if_update_pdev_tgt_info - Update PDEVs info
1790  * @psoc:  psoc object
1791  * @tgt_hdl: target_psoc_info pointer
1792  *
1793  * API updates PDEVs info based on config
1794  *
1795  * Return: SUCCESS on pdev updation or PDEV updation is not needed
1796  *         FAILURE, if updation fails
1797  */
1798 static inline QDF_STATUS target_if_update_pdev_tgt_info(
1799 	struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl)
1800 {
1801 	QDF_STATUS ret_val;
1802 
1803 	if ((tgt_hdl->tif_ops) &&
1804 		(tgt_hdl->tif_ops->update_pdev_tgt_info))
1805 		ret_val = tgt_hdl->tif_ops->update_pdev_tgt_info(psoc,
1806 							tgt_hdl);
1807 	else
1808 		ret_val = QDF_STATUS_SUCCESS;
1809 
1810 	return ret_val;
1811 }
1812 
1813 /**
1814  * target_if_print_service_ready_ext_param - Print Service ready ext param
1815  * @psoc:  psoc object
1816  * @tgt_hdl: target_psoc_info pointer
1817  *
1818  * API to print service ready ext param
1819  *
1820  * Return: none
1821  */
1822 static inline void target_if_print_service_ready_ext_param(
1823 	struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl)
1824 {
1825 	if ((tgt_hdl->tif_ops) &&
1826 		(tgt_hdl->tif_ops->print_svc_ready_ex_param)) {
1827 		tgt_hdl->tif_ops->print_svc_ready_ex_param(psoc,
1828 			tgt_hdl);
1829 	}
1830 }
1831 
1832 /**
1833  * target_if_add_11ax_modes - Add 11ax modes explicitly
1834  * @psoc:  psoc object
1835  * @tgt_hdl: target_psoc_info pointer
1836  *
1837  * API to adds 11ax modes
1838  *
1839  * Return: none
1840  */
1841 static inline void target_if_add_11ax_modes(struct wlan_objmgr_psoc *psoc,
1842 					struct target_psoc_info *tgt_hdl)
1843 {
1844 	if ((tgt_hdl->tif_ops) &&
1845 		(tgt_hdl->tif_ops->add_11ax_modes)) {
1846 		tgt_hdl->tif_ops->add_11ax_modes(psoc, tgt_hdl);
1847 	}
1848 }
1849 
1850 /**
1851  * target_if_set_default_config - Set default config in init command
1852  * @psoc:  psoc object
1853  * @tgt_hdl: target_psoc_info pointer
1854  *
1855  * API to set default config in init command
1856  *
1857  * Return: none
1858  */
1859 static inline void target_if_set_default_config(struct wlan_objmgr_psoc *psoc,
1860 					struct target_psoc_info *tgt_hdl)
1861 {
1862 	if ((tgt_hdl->tif_ops) &&
1863 		(tgt_hdl->tif_ops->set_default_tgt_config)) {
1864 		tgt_hdl->tif_ops->set_default_tgt_config(psoc, tgt_hdl);
1865 	}
1866 }
1867 
1868 /**
1869  * target_if_sw_version_check - SW version check
1870  * @psoc:  psoc object
1871  * @tgt_hdl: target_psoc_info pointer
1872  * @evt_buf: Event buffer received from FW
1873  *
1874  * API checks the SW version
1875  *
1876  * Return: SUCCESS on version matches or version check is not needed
1877  *         FAILURE, if check fails
1878  */
1879 static inline QDF_STATUS target_if_sw_version_check(
1880 			struct wlan_objmgr_psoc *psoc,
1881 			struct target_psoc_info *tgt_hdl, uint8_t *evt_buf)
1882 {
1883 	QDF_STATUS ret_val;
1884 
1885 	if ((tgt_hdl->tif_ops) &&
1886 		(tgt_hdl->tif_ops->sw_version_check))
1887 		ret_val = tgt_hdl->tif_ops->sw_version_check(psoc, tgt_hdl,
1888 								evt_buf);
1889 	else
1890 		ret_val = QDF_STATUS_SUCCESS;
1891 
1892 	return ret_val;
1893 }
1894 
1895 /**
1896  * target_if_get_phy_capability  - get phy capability
1897  * @target_psoc_info:  pointer to structure target_psoc_info
1898  *
1899  * API to get phy capability from the target caps
1900  *
1901  * Return: int32_t
1902  */
1903 static inline int32_t target_if_get_phy_capability
1904 			(struct target_psoc_info *target_psoc_info)
1905 {
1906 	if (target_psoc_info == NULL)
1907 		return -EINVAL;
1908 
1909 	return target_psoc_info->info.target_caps.phy_capability;
1910 }
1911 
1912 /**
1913  * target_if_set_phy_capability  - set phy capability
1914  * @target_psoc_info:  pointer to structure target_psoc_info
1915  * @phy_capab: PHY capabilities
1916  *
1917  * API to set phy capability in the target caps
1918  *
1919  * Return: None
1920  */
1921 static inline void target_if_set_phy_capability
1922 		(struct target_psoc_info *target_psoc_info, int phy_capability)
1923 {
1924 	if (target_psoc_info == NULL)
1925 		return;
1926 
1927 	target_psoc_info->info.target_caps.phy_capability = phy_capability;
1928 }
1929 
1930 /**
1931  * target_if_set_max_frag_entry  - set Maximum frag entries
1932  * @target_psoc_info:  pointer to structure target_psoc_info
1933  * @max_frag_entry: Maximum frag entries
1934  *
1935  * API to set Maximum frag entries from the target caps
1936  *
1937  * Return: None
1938  */
1939 static inline void target_if_set_max_frag_entry
1940 		(struct target_psoc_info *target_psoc_info, int max_frag_entry)
1941 {
1942 	if (target_psoc_info == NULL)
1943 		return;
1944 
1945 	target_psoc_info->info.target_caps.max_frag_entry = max_frag_entry;
1946 }
1947 
1948 /**
1949  * target_if_get_max_frag_entry  - get Maximum frag entries
1950  * @target_psoc_info:  pointer to structure target_psoc_info
1951  *
1952  * API to get Maximum frag entries from the target caps
1953  *
1954  * Return: int32_t
1955  */
1956 static inline int32_t target_if_get_max_frag_entry
1957 		(struct target_psoc_info *target_psoc_info)
1958 {
1959 	if (target_psoc_info == NULL)
1960 		return -EINVAL;
1961 
1962 	return target_psoc_info->info.target_caps.max_frag_entry;
1963 }
1964 
1965 /**
1966  * target_if_get_ht_cap_info  - get ht capabilities info
1967  * @target_psoc_info:  pointer to structure target_psoc_info
1968  *
1969  * API to get ht capabilities info from the target caps
1970  *
1971  * Return: int32_t
1972  */
1973 static inline int32_t target_if_get_ht_cap_info
1974 		(struct target_psoc_info *target_psoc_info)
1975 {
1976 	if (target_psoc_info == NULL)
1977 		return -EINVAL;
1978 
1979 	return target_psoc_info->info.target_caps.ht_cap_info;
1980 }
1981 
1982 /**
1983  * target_if_get_vht_cap_info  - get vht capabilities info
1984  * @target_psoc_info:  pointer to structure target_psoc_info
1985  *
1986  * API to get vht capabilities info from the target caps
1987  *
1988  * Return: int32_t
1989  */
1990 static inline int32_t target_if_get_vht_cap_info
1991 		(struct target_psoc_info *target_psoc_info)
1992 {
1993 	if (target_psoc_info == NULL)
1994 		return -EINVAL;
1995 
1996 	return target_psoc_info->info.target_caps.vht_cap_info;
1997 }
1998 
1999 /**
2000  * target_if_get_num_rf_chains  - get Number of RF chains supported
2001  * @target_psoc_info:  pointer to structure target_psoc_info
2002  *
2003  * API to get Number of RF chains supported from the target caps
2004  *
2005  * Return: int32_t
2006  */
2007 static inline int32_t target_if_get_num_rf_chains
2008 		(struct target_psoc_info *target_psoc_info)
2009 {
2010 	if (target_psoc_info == NULL)
2011 		return -EINVAL;
2012 
2013 	return target_psoc_info->info.target_caps.num_rf_chains;
2014 }
2015 
2016 /**
2017  * target_if_get_fw_version  - get firmware version
2018  * @target_psoc_info:  pointer to structure target_psoc_info
2019  *
2020  * API to get firmware version from the target caps
2021  *
2022  * Return: int32_t
2023  */
2024 static inline int32_t target_if_get_fw_version
2025 		(struct target_psoc_info *target_psoc_info)
2026 {
2027 	if (target_psoc_info == NULL)
2028 		return 0;
2029 
2030 	return target_psoc_info->info.target_caps.fw_version;
2031 }
2032 
2033 /**
2034  * target_if_get_wmi_fw_sub_feat_caps  - FW sub feature capabilities
2035  * @target_psoc_info:  pointer to structure target_psoc_info
2036  *
2037  * API to get FW sub feature capabilities from the target caps
2038  *
2039  * Return: int32_t
2040  */
2041 static inline int32_t target_if_get_wmi_fw_sub_feat_caps
2042 		(struct target_psoc_info *target_psoc_info)
2043 {
2044 	if (target_psoc_info == NULL)
2045 		return -EINVAL;
2046 
2047 	return target_psoc_info->info.target_caps.wmi_fw_sub_feat_caps;
2048 }
2049 
2050 /**
2051  * target_if_get_conc_scan_config_bits  - Default concurrenct scan config
2052  * @tgt_hdl:  pointer to structure target_psoc_info
2053  *
2054  * API to get Default concurrenct scan config from the target caps
2055  *
2056  * Return: int32_t
2057  */
2058 static inline int32_t target_if_get_conc_scan_config_bits
2059 		(struct target_psoc_info *tgt_hdl)
2060 {
2061 	if (tgt_hdl == NULL)
2062 		return -EINVAL;
2063 
2064 	return tgt_hdl->info.service_ext_param.default_conc_scan_config_bits;
2065 }
2066 
2067 /**
2068  * target_if_get_fw_config_bits  - Default HW config bits
2069  * @tgt_hdl:  pointer to structure target_psoc_info
2070  *
2071  * API to get Default HW config bits from the target caps
2072  *
2073  * Return: int32_t
2074  */
2075 static inline int32_t target_if_get_fw_config_bits
2076 		(struct target_psoc_info *tgt_hdl)
2077 {
2078 	if (tgt_hdl == NULL)
2079 		return -EINVAL;
2080 
2081 	return tgt_hdl->info.service_ext_param.default_fw_config_bits;
2082 }
2083 
2084 /**
2085  * target_psoc_get_num_hw_modes  - get number of dbs hardware modes
2086  * @tgt_hdl:  pointer to structure target_psoc_info
2087  *
2088  * API to get Number of Dual Band Simultaneous (DBS) hardware modes
2089  *
2090  * Return: int32_t
2091  */
2092 static inline int32_t target_psoc_get_num_hw_modes
2093 		(struct target_psoc_info *tgt_hdl)
2094 {
2095 	if (tgt_hdl == NULL)
2096 		return -EINVAL;
2097 
2098 	return tgt_hdl->info.service_ext_param.num_hw_modes;
2099 }
2100 
2101 /**
2102  * target_if_smart_log enable() - Enable Smart Logs
2103  * @psoc:  psoc object
2104  * @tgt_hdl: target_psoc_info pointer
2105  * @evt_buf: Service ready Event buffer received from FW
2106  *
2107  * API to enable Smart Logs
2108  *
2109  * Return: none
2110  */
2111 static inline void target_if_smart_log_enable
2112 				(struct wlan_objmgr_psoc *psoc,
2113 					struct target_psoc_info *tgt_hdl,
2114 					uint8_t *evt_buf)
2115 {
2116 	if ((tgt_hdl->tif_ops) && (tgt_hdl->tif_ops->smart_log_enable))
2117 		tgt_hdl->tif_ops->smart_log_enable(psoc, tgt_hdl, evt_buf);
2118 }
2119 #endif
2120 
2121