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