xref: /wlan-driver/qcacld-3.0/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc) !
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 /**
20  * DOC: public API related to the pmo called by north bound HDD/OSIF
21  */
22 
23 #include "wlan_pmo_ucfg_api.h"
24 #include "wlan_pmo_apf.h"
25 #include "wlan_pmo_arp.h"
26 #include "wlan_pmo_ns.h"
27 #include "wlan_pmo_gtk.h"
28 #include "wlan_pmo_wow.h"
29 #include "wlan_pmo_mc_addr_filtering.h"
30 #include "wlan_pmo_main.h"
31 #include "wlan_pmo_lphb.h"
32 #include "wlan_pmo_suspend_resume.h"
33 #include "wlan_pmo_pkt_filter.h"
34 #include "wlan_pmo_hw_filter.h"
35 #include "wlan_pmo_cfg.h"
36 #include "wlan_pmo_static_config.h"
37 #include "cfg_ucfg_api.h"
38 #include "wlan_pmo_icmp.h"
39 
ucfg_pmo_psoc_open(struct wlan_objmgr_psoc * psoc)40 QDF_STATUS ucfg_pmo_psoc_open(struct wlan_objmgr_psoc *psoc)
41 {
42 	return pmo_psoc_open(psoc);
43 }
44 
ucfg_pmo_psoc_close(struct wlan_objmgr_psoc * psoc)45 QDF_STATUS ucfg_pmo_psoc_close(struct wlan_objmgr_psoc *psoc)
46 {
47 	return pmo_psoc_close(psoc);
48 }
49 
ucfg_pmo_get_apf_instruction_size(struct wlan_objmgr_psoc * psoc)50 uint32_t ucfg_pmo_get_apf_instruction_size(struct wlan_objmgr_psoc *psoc)
51 {
52 	QDF_BUG(psoc);
53 	if (!psoc)
54 		return 0;
55 
56 	return pmo_get_apf_instruction_size(psoc);
57 }
58 
ucfg_pmo_get_num_wow_filters(struct wlan_objmgr_psoc * psoc)59 uint8_t ucfg_pmo_get_num_wow_filters(struct wlan_objmgr_psoc *psoc)
60 {
61 	QDF_BUG(psoc);
62 	if (!psoc)
63 		return 0;
64 
65 	return pmo_get_num_wow_filters(psoc);
66 }
67 
ucfg_pmo_get_psoc_config(struct wlan_objmgr_psoc * psoc,struct pmo_psoc_cfg * psoc_cfg)68 QDF_STATUS ucfg_pmo_get_psoc_config(struct wlan_objmgr_psoc *psoc,
69 		struct pmo_psoc_cfg *psoc_cfg)
70 {
71 	return pmo_core_get_psoc_config(psoc, psoc_cfg);
72 }
73 
ucfg_pmo_update_psoc_config(struct wlan_objmgr_psoc * psoc,struct pmo_psoc_cfg * psoc_cfg)74 QDF_STATUS ucfg_pmo_update_psoc_config(struct wlan_objmgr_psoc *psoc,
75 		struct pmo_psoc_cfg *psoc_cfg)
76 {
77 	return pmo_core_update_psoc_config(psoc, psoc_cfg);
78 }
79 
ucfg_pmo_psoc_set_caps(struct wlan_objmgr_psoc * psoc,struct pmo_device_caps * caps)80 QDF_STATUS ucfg_pmo_psoc_set_caps(struct wlan_objmgr_psoc *psoc,
81 				  struct pmo_device_caps *caps)
82 {
83 	QDF_BUG(psoc);
84 	if (!psoc)
85 		return QDF_STATUS_E_INVAL;
86 
87 	QDF_BUG(caps);
88 	if (!caps)
89 		return QDF_STATUS_E_INVAL;
90 
91 	pmo_psoc_set_caps(psoc, caps);
92 
93 	return QDF_STATUS_SUCCESS;
94 }
95 
ucfg_pmo_is_ap_mode_supports_arp_ns(struct wlan_objmgr_psoc * psoc,enum QDF_OPMODE vdev_opmode)96 bool ucfg_pmo_is_ap_mode_supports_arp_ns(struct wlan_objmgr_psoc *psoc,
97 	enum QDF_OPMODE vdev_opmode)
98 {
99 	return pmo_core_is_ap_mode_supports_arp_ns(psoc, vdev_opmode);
100 }
101 
ucfg_pmo_is_vdev_connected(struct wlan_objmgr_vdev * vdev)102 bool ucfg_pmo_is_vdev_connected(struct wlan_objmgr_vdev *vdev)
103 {
104 	if (wlan_vdev_is_up(vdev) == QDF_STATUS_SUCCESS)
105 		return true;
106 	else
107 		return false;
108 }
109 
ucfg_pmo_is_vdev_supports_offload(struct wlan_objmgr_vdev * vdev)110 bool ucfg_pmo_is_vdev_supports_offload(struct wlan_objmgr_vdev *vdev)
111 {
112 	return pmo_core_is_vdev_supports_offload(vdev);
113 }
114 
ucfg_pmo_enable_wakeup_event(struct wlan_objmgr_psoc * psoc,uint32_t vdev_id,WOW_WAKE_EVENT_TYPE wow_event)115 void ucfg_pmo_enable_wakeup_event(struct wlan_objmgr_psoc *psoc,
116 				  uint32_t vdev_id,
117 				  WOW_WAKE_EVENT_TYPE wow_event)
118 {
119 	pmo_core_enable_wakeup_event(psoc, vdev_id, wow_event);
120 }
121 
ucfg_pmo_disable_wakeup_event(struct wlan_objmgr_psoc * psoc,uint32_t vdev_id,WOW_WAKE_EVENT_TYPE wow_event)122 void ucfg_pmo_disable_wakeup_event(struct wlan_objmgr_psoc *psoc,
123 				   uint32_t vdev_id,
124 				   WOW_WAKE_EVENT_TYPE wow_event)
125 {
126 	pmo_core_disable_wakeup_event(psoc, vdev_id, wow_event);
127 }
128 
ucfg_pmo_cache_arp_offload_req(struct pmo_arp_req * arp_req)129 QDF_STATUS ucfg_pmo_cache_arp_offload_req(struct pmo_arp_req *arp_req)
130 {
131 	return pmo_core_cache_arp_offload_req(arp_req);
132 }
133 
ucfg_pmo_check_arp_offload(struct wlan_objmgr_psoc * psoc,enum pmo_offload_trigger trigger,uint8_t vdev_id)134 QDF_STATUS ucfg_pmo_check_arp_offload(struct wlan_objmgr_psoc *psoc,
135 				      enum pmo_offload_trigger trigger,
136 				      uint8_t vdev_id)
137 {
138 	return pmo_core_arp_check_offload(psoc, trigger, vdev_id);
139 }
140 
ucfg_pmo_flush_arp_offload_req(struct wlan_objmgr_vdev * vdev)141 QDF_STATUS ucfg_pmo_flush_arp_offload_req(struct wlan_objmgr_vdev *vdev)
142 {
143 	return pmo_core_flush_arp_offload_req(vdev);
144 }
145 
ucfg_pmo_enable_arp_offload_in_fwr(struct wlan_objmgr_vdev * vdev,enum pmo_offload_trigger trigger)146 QDF_STATUS ucfg_pmo_enable_arp_offload_in_fwr(struct wlan_objmgr_vdev *vdev,
147 					      enum pmo_offload_trigger trigger)
148 {
149 	return pmo_core_enable_arp_offload_in_fwr(vdev, trigger);
150 }
151 
152 QDF_STATUS
ucfg_pmo_disable_arp_offload_in_fwr(struct wlan_objmgr_vdev * vdev,enum pmo_offload_trigger trigger)153 ucfg_pmo_disable_arp_offload_in_fwr(struct wlan_objmgr_vdev *vdev,
154 				    enum pmo_offload_trigger trigger)
155 {
156 	return pmo_core_disable_arp_offload_in_fwr(vdev, trigger);
157 }
158 
159 QDF_STATUS
ucfg_pmo_get_arp_offload_params(struct wlan_objmgr_vdev * vdev,struct pmo_arp_offload_params * params)160 ucfg_pmo_get_arp_offload_params(struct wlan_objmgr_vdev *vdev,
161 				struct pmo_arp_offload_params *params)
162 {
163 	return pmo_core_get_arp_offload_params(vdev, params);
164 }
165 
166 #ifdef WLAN_NS_OFFLOAD
ucfg_pmo_cache_ns_offload_req(struct pmo_ns_req * ns_req)167 QDF_STATUS ucfg_pmo_cache_ns_offload_req(struct pmo_ns_req *ns_req)
168 {
169 	return pmo_core_cache_ns_offload_req(ns_req);
170 }
171 
ucfg_pmo_ns_offload_check(struct wlan_objmgr_psoc * psoc,enum pmo_offload_trigger trigger,uint8_t vdev_id)172 QDF_STATUS ucfg_pmo_ns_offload_check(struct wlan_objmgr_psoc *psoc,
173 				     enum pmo_offload_trigger trigger,
174 				     uint8_t vdev_id)
175 {
176 	return pmo_core_ns_check_offload(psoc, trigger, vdev_id);
177 }
178 
ucfg_pmo_flush_ns_offload_req(struct wlan_objmgr_vdev * vdev)179 QDF_STATUS ucfg_pmo_flush_ns_offload_req(struct wlan_objmgr_vdev *vdev)
180 {
181 	return pmo_core_flush_ns_offload_req(vdev);
182 }
183 
184 QDF_STATUS
ucfg_pmo_enable_ns_offload_in_fwr(struct wlan_objmgr_vdev * vdev,enum pmo_offload_trigger trigger)185 ucfg_pmo_enable_ns_offload_in_fwr(struct wlan_objmgr_vdev *vdev,
186 				  enum pmo_offload_trigger trigger)
187 {
188 	return pmo_core_enable_ns_offload_in_fwr(vdev, trigger);
189 }
190 
191 QDF_STATUS
ucfg_pmo_disable_ns_offload_in_fwr(struct wlan_objmgr_vdev * vdev,enum pmo_offload_trigger trigger)192 ucfg_pmo_disable_ns_offload_in_fwr(struct wlan_objmgr_vdev *vdev,
193 				   enum pmo_offload_trigger trigger)
194 {
195 	return pmo_core_disable_ns_offload_in_fwr(vdev, trigger);
196 }
197 #endif /* WLAN_NS_OFFLOAD */
198 
199 #ifdef FEATURE_WLAN_DYNAMIC_ARP_NS_OFFLOAD
200 QDF_STATUS
ucfg_pmo_dynamic_arp_ns_offload_enable(struct wlan_objmgr_vdev * vdev)201 ucfg_pmo_dynamic_arp_ns_offload_enable(struct wlan_objmgr_vdev *vdev)
202 {
203 	return pmo_core_dynamic_arp_ns_offload_enable(vdev);
204 }
205 
206 QDF_STATUS
ucfg_pmo_dynamic_arp_ns_offload_disable(struct wlan_objmgr_vdev * vdev)207 ucfg_pmo_dynamic_arp_ns_offload_disable(struct wlan_objmgr_vdev *vdev)
208 {
209 	return pmo_core_dynamic_arp_ns_offload_disable(vdev);
210 }
211 
212 bool
ucfg_pmo_get_arp_ns_offload_dynamic_disable(struct wlan_objmgr_vdev * vdev)213 ucfg_pmo_get_arp_ns_offload_dynamic_disable(struct wlan_objmgr_vdev *vdev)
214 {
215 	return pmo_core_get_dynamic_arp_ns_offload_disable(vdev);
216 }
217 
218 void
ucfg_pmo_dynamic_arp_ns_offload_runtime_prevent(struct wlan_objmgr_vdev * vdev)219 ucfg_pmo_dynamic_arp_ns_offload_runtime_prevent(struct wlan_objmgr_vdev *vdev)
220 {
221 	return pmo_core_dynamic_arp_ns_offload_runtime_prevent(vdev);
222 }
223 
224 void
ucfg_pmo_dynamic_arp_ns_offload_runtime_allow(struct wlan_objmgr_vdev * vdev)225 ucfg_pmo_dynamic_arp_ns_offload_runtime_allow(struct wlan_objmgr_vdev *vdev)
226 {
227 	return pmo_core_dynamic_arp_ns_offload_runtime_allow(vdev);
228 }
229 #endif
230 
231 QDF_STATUS
ucfg_pmo_get_ns_offload_params(struct wlan_objmgr_vdev * vdev,struct pmo_ns_offload_params * params)232 ucfg_pmo_get_ns_offload_params(struct wlan_objmgr_vdev *vdev,
233 			       struct pmo_ns_offload_params *params)
234 {
235 	return pmo_core_get_ns_offload_params(vdev, params);
236 }
237 
238 enum pmo_ns_addr_scope
ucfg_pmo_ns_addr_scope(uint32_t ipv6_scope)239 ucfg_pmo_ns_addr_scope(uint32_t ipv6_scope)
240 {
241 	switch (ipv6_scope) {
242 	case IPV6_ADDR_SCOPE_NODELOCAL:
243 		return PMO_NS_ADDR_SCOPE_NODELOCAL;
244 	case IPV6_ADDR_SCOPE_LINKLOCAL:
245 		return PMO_NS_ADDR_SCOPE_LINKLOCAL;
246 	case IPV6_ADDR_SCOPE_SITELOCAL:
247 		return PMO_NS_ADDR_SCOPE_SITELOCAL;
248 	case IPV6_ADDR_SCOPE_ORGLOCAL:
249 		return PMO_NS_ADDR_SCOPE_ORGLOCAL;
250 	case IPV6_ADDR_SCOPE_GLOBAL:
251 		return PMO_NS_ADDR_SCOPE_GLOBAL;
252 	}
253 
254 	return PMO_NS_ADDR_SCOPE_INVALID;
255 }
256 
ucfg_pmo_cache_mc_addr_list(struct pmo_mc_addr_list_params * mc_list_config)257 QDF_STATUS ucfg_pmo_cache_mc_addr_list(
258 		struct pmo_mc_addr_list_params *mc_list_config)
259 {
260 	return pmo_core_cache_mc_addr_list(mc_list_config);
261 }
262 
ucfg_pmo_flush_mc_addr_list(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)263 QDF_STATUS ucfg_pmo_flush_mc_addr_list(struct wlan_objmgr_psoc *psoc,
264 				       uint8_t vdev_id)
265 {
266 	return pmo_core_flush_mc_addr_list(psoc, vdev_id);
267 }
268 
ucfg_pmo_enable_mc_addr_filtering_in_fwr(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,enum pmo_offload_trigger trigger)269 QDF_STATUS ucfg_pmo_enable_mc_addr_filtering_in_fwr(
270 		struct wlan_objmgr_psoc *psoc,
271 		uint8_t vdev_id,
272 		enum pmo_offload_trigger trigger)
273 {
274 	return pmo_core_enable_mc_addr_filtering_in_fwr(psoc,
275 			vdev_id, trigger);
276 }
277 
ucfg_pmo_disable_mc_addr_filtering_in_fwr(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,enum pmo_offload_trigger trigger)278 QDF_STATUS ucfg_pmo_disable_mc_addr_filtering_in_fwr(
279 		struct wlan_objmgr_psoc *psoc,
280 		uint8_t vdev_id,
281 		enum pmo_offload_trigger trigger)
282 {
283 	return pmo_core_disable_mc_addr_filtering_in_fwr(psoc,
284 			vdev_id, trigger);
285 }
286 
ucfg_pmo_max_mc_addr_supported(struct wlan_objmgr_psoc * psoc)287 uint8_t ucfg_pmo_max_mc_addr_supported(struct wlan_objmgr_psoc *psoc)
288 {
289 	return pmo_core_max_mc_addr_supported(psoc);
290 }
291 
292 QDF_STATUS
ucfg_pmo_get_mc_addr_list(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id,struct pmo_mc_addr_list * mc_list_req)293 ucfg_pmo_get_mc_addr_list(struct wlan_objmgr_psoc *psoc,
294 			  uint8_t vdev_id,
295 			  struct pmo_mc_addr_list *mc_list_req)
296 {
297 	return pmo_core_get_mc_addr_list(psoc, vdev_id, mc_list_req);
298 }
299 
300 QDF_STATUS
ucfg_pmo_cache_gtk_offload_req(struct wlan_objmgr_vdev * vdev,struct pmo_gtk_req * gtk_req)301 ucfg_pmo_cache_gtk_offload_req(struct wlan_objmgr_vdev *vdev,
302 			       struct pmo_gtk_req *gtk_req)
303 {
304 	return pmo_core_cache_gtk_offload_req(vdev, gtk_req);
305 }
306 
ucfg_pmo_flush_gtk_offload_req(struct wlan_objmgr_vdev * vdev)307 QDF_STATUS ucfg_pmo_flush_gtk_offload_req(struct wlan_objmgr_vdev *vdev)
308 {
309 	return pmo_core_flush_gtk_offload_req(vdev);
310 }
311 
ucfg_pmo_enable_gtk_offload_in_fwr(struct wlan_objmgr_vdev * vdev)312 QDF_STATUS ucfg_pmo_enable_gtk_offload_in_fwr(struct wlan_objmgr_vdev *vdev)
313 {
314 	return pmo_core_enable_gtk_offload_in_fwr(vdev);
315 }
316 
317 #ifdef WLAN_FEATURE_IGMP_OFFLOAD
ucfg_pmo_enable_igmp_offload(struct wlan_objmgr_vdev * vdev,struct pmo_igmp_offload_req * igmp_req)318 QDF_STATUS ucfg_pmo_enable_igmp_offload(struct wlan_objmgr_vdev *vdev,
319 					struct pmo_igmp_offload_req *igmp_req)
320 {
321 	return pmo_core_enable_igmp_offload(vdev, igmp_req);
322 }
323 #endif
324 
ucfg_pmo_disable_gtk_offload_in_fwr(struct wlan_objmgr_vdev * vdev)325 QDF_STATUS ucfg_pmo_disable_gtk_offload_in_fwr(struct wlan_objmgr_vdev *vdev)
326 {
327 	return pmo_core_disable_gtk_offload_in_fwr(vdev);
328 }
329 
330 #ifdef WLAN_FEATURE_PACKET_FILTERING
ucfg_pmo_get_pkt_filter_bitmap(struct wlan_objmgr_psoc * psoc)331 uint8_t ucfg_pmo_get_pkt_filter_bitmap(struct wlan_objmgr_psoc *psoc)
332 {
333 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
334 
335 	return pmo_psoc_ctx->psoc_cfg.packet_filters_bitmap;
336 }
337 
ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc * psoc)338 uint32_t ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc *psoc)
339 {
340 	QDF_BUG(psoc);
341 	if (!psoc)
342 		return 0;
343 
344 	return pmo_get_num_packet_filters(psoc);
345 }
346 
347 QDF_STATUS
ucfg_pmo_set_pkt_filter(struct wlan_objmgr_psoc * psoc,struct pmo_rcv_pkt_fltr_cfg * pmo_set_pkt_fltr_req,uint8_t vdev_id)348 ucfg_pmo_set_pkt_filter(struct wlan_objmgr_psoc *psoc,
349 			struct pmo_rcv_pkt_fltr_cfg *pmo_set_pkt_fltr_req,
350 			uint8_t vdev_id)
351 {
352 	return pmo_core_set_pkt_filter(psoc, pmo_set_pkt_fltr_req, vdev_id);
353 }
354 
ucfg_pmo_clear_pkt_filter(struct wlan_objmgr_psoc * psoc,struct pmo_rcv_pkt_fltr_clear_param * pmo_clr_pkt_fltr_param,uint8_t vdev_id)355 QDF_STATUS ucfg_pmo_clear_pkt_filter(
356 		struct wlan_objmgr_psoc *psoc,
357 		struct pmo_rcv_pkt_fltr_clear_param *pmo_clr_pkt_fltr_param,
358 		uint8_t vdev_id)
359 {
360 	return pmo_core_clear_pkt_filter(psoc,
361 				pmo_clr_pkt_fltr_param, vdev_id);
362 }
363 #endif
364 
ucfg_pmo_get_gtk_rsp(struct wlan_objmgr_vdev * vdev,struct pmo_gtk_rsp_req * gtk_rsp_req)365 QDF_STATUS ucfg_pmo_get_gtk_rsp(struct wlan_objmgr_vdev *vdev,
366 				struct pmo_gtk_rsp_req *gtk_rsp_req)
367 {
368 	return pmo_core_get_gtk_rsp(vdev, gtk_rsp_req);
369 }
370 
ucfg_pmo_update_extscan_in_progress(struct wlan_objmgr_vdev * vdev,bool value)371 void ucfg_pmo_update_extscan_in_progress(struct wlan_objmgr_vdev *vdev,
372 					 bool value)
373 {
374 	pmo_core_update_extscan_in_progress(vdev, value);
375 }
376 
ucfg_pmo_update_p2plo_in_progress(struct wlan_objmgr_vdev * vdev,bool value)377 void ucfg_pmo_update_p2plo_in_progress(struct wlan_objmgr_vdev *vdev,
378 				       bool value)
379 {
380 	pmo_core_update_p2plo_in_progress(vdev, value);
381 }
382 
ucfg_pmo_lphb_config_req(struct wlan_objmgr_psoc * psoc,struct pmo_lphb_req * lphb_req,void * lphb_cb_ctx,pmo_lphb_callback callback)383 QDF_STATUS ucfg_pmo_lphb_config_req(struct wlan_objmgr_psoc *psoc,
384 				    struct pmo_lphb_req *lphb_req,
385 				    void *lphb_cb_ctx,
386 				    pmo_lphb_callback callback)
387 {
388 	return pmo_core_lphb_config_req(psoc, lphb_req, lphb_cb_ctx, callback);
389 }
390 
ucfg_pmo_psoc_update_power_save_mode(struct wlan_objmgr_psoc * psoc,uint8_t value)391 void ucfg_pmo_psoc_update_power_save_mode(struct wlan_objmgr_psoc *psoc,
392 					  uint8_t value)
393 {
394 	pmo_core_psoc_update_power_save_mode(psoc, value);
395 }
396 
ucfg_pmo_psoc_update_dp_handle(struct wlan_objmgr_psoc * psoc,void * dp_handle)397 void ucfg_pmo_psoc_update_dp_handle(struct wlan_objmgr_psoc *psoc,
398 				    void *dp_handle)
399 {
400 	pmo_core_psoc_update_dp_handle(psoc, dp_handle);
401 }
402 
ucfg_pmo_psoc_update_htc_handle(struct wlan_objmgr_psoc * psoc,void * htc_handle)403 void ucfg_pmo_psoc_update_htc_handle(struct wlan_objmgr_psoc *psoc,
404 				     void *htc_handle)
405 {
406 	pmo_core_psoc_update_htc_handle(psoc, htc_handle);
407 }
408 
ucfg_pmo_psoc_set_hif_handle(struct wlan_objmgr_psoc * psoc,void * hif_handle)409 void ucfg_pmo_psoc_set_hif_handle(struct wlan_objmgr_psoc *psoc,
410 				  void *hif_handle)
411 {
412 	pmo_core_psoc_set_hif_handle(psoc, hif_handle);
413 }
414 
ucfg_pmo_psoc_set_txrx_pdev_id(struct wlan_objmgr_psoc * psoc,uint8_t txrx_pdev_id)415 void ucfg_pmo_psoc_set_txrx_pdev_id(struct wlan_objmgr_psoc *psoc,
416 				    uint8_t txrx_pdev_id)
417 {
418 	pmo_core_psoc_set_txrx_pdev_id(psoc, txrx_pdev_id);
419 }
420 
ucfg_pmo_psoc_handle_initial_wake_up(void * cb_ctx)421 void ucfg_pmo_psoc_handle_initial_wake_up(void *cb_ctx)
422 {
423 	return pmo_core_psoc_handle_initial_wake_up(cb_ctx);
424 }
425 
426 QDF_STATUS
ucfg_pmo_psoc_user_space_suspend_req(struct wlan_objmgr_psoc * psoc,enum qdf_suspend_type type)427 ucfg_pmo_psoc_user_space_suspend_req(struct wlan_objmgr_psoc *psoc,
428 				     enum qdf_suspend_type type)
429 {
430 	return pmo_core_psoc_user_space_suspend_req(psoc, type);
431 }
432 
433 QDF_STATUS
ucfg_pmo_psoc_user_space_resume_req(struct wlan_objmgr_psoc * psoc,enum qdf_suspend_type type)434 ucfg_pmo_psoc_user_space_resume_req(struct wlan_objmgr_psoc *psoc,
435 				    enum qdf_suspend_type type)
436 {
437 	return pmo_core_psoc_user_space_resume_req(psoc, type);
438 }
439 
ucfg_pmo_suspend_all_components(struct wlan_objmgr_psoc * psoc,enum qdf_suspend_type type)440 QDF_STATUS ucfg_pmo_suspend_all_components(struct wlan_objmgr_psoc *psoc,
441 					   enum qdf_suspend_type type)
442 {
443 	return pmo_suspend_all_components(psoc, type);
444 }
445 
ucfg_pmo_resume_all_components(struct wlan_objmgr_psoc * psoc,enum qdf_suspend_type type)446 QDF_STATUS ucfg_pmo_resume_all_components(struct wlan_objmgr_psoc *psoc,
447 					  enum qdf_suspend_type type)
448 {
449 	return pmo_resume_all_components(psoc, type);
450 }
451 
452 QDF_STATUS
ucfg_pmo_psoc_bus_suspend_req(struct wlan_objmgr_psoc * psoc,enum qdf_suspend_type type,struct pmo_wow_enable_params * wow_params)453 ucfg_pmo_psoc_bus_suspend_req(struct wlan_objmgr_psoc *psoc,
454 			      enum qdf_suspend_type type,
455 			      struct pmo_wow_enable_params *wow_params)
456 {
457 	return pmo_core_psoc_bus_suspend_req(psoc, type, wow_params);
458 }
459 
460 #ifdef FEATURE_RUNTIME_PM
ucfg_pmo_psoc_bus_runtime_suspend(struct wlan_objmgr_psoc * psoc,pmo_pld_auto_suspend_cb pld_cb)461 QDF_STATUS ucfg_pmo_psoc_bus_runtime_suspend(struct wlan_objmgr_psoc *psoc,
462 					     pmo_pld_auto_suspend_cb pld_cb)
463 {
464 	return pmo_core_psoc_bus_runtime_suspend(psoc, pld_cb);
465 }
466 
ucfg_pmo_psoc_bus_runtime_resume(struct wlan_objmgr_psoc * psoc,pmo_pld_auto_suspend_cb pld_cb)467 QDF_STATUS ucfg_pmo_psoc_bus_runtime_resume(struct wlan_objmgr_psoc *psoc,
468 					    pmo_pld_auto_suspend_cb pld_cb)
469 {
470 	return pmo_core_psoc_bus_runtime_resume(psoc, pld_cb);
471 }
472 #endif
473 
474 QDF_STATUS
ucfg_pmo_psoc_suspend_target(struct wlan_objmgr_psoc * psoc,int disable_target_intr)475 ucfg_pmo_psoc_suspend_target(struct wlan_objmgr_psoc *psoc,
476 			     int disable_target_intr)
477 {
478 	return pmo_core_psoc_suspend_target(psoc, disable_target_intr);
479 }
480 
481 QDF_STATUS
ucfg_pmo_add_wow_user_pattern(struct wlan_objmgr_vdev * vdev,struct pmo_wow_add_pattern * ptrn)482 ucfg_pmo_add_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
483 			      struct pmo_wow_add_pattern *ptrn)
484 {
485 	return pmo_core_add_wow_user_pattern(vdev, ptrn);
486 }
487 
ucfg_pmo_register_wow_default_patterns(struct wlan_objmgr_vdev * vdev)488 void ucfg_pmo_register_wow_default_patterns(struct wlan_objmgr_vdev *vdev)
489 {
490 	pmo_register_wow_default_patterns(vdev);
491 }
492 
493 QDF_STATUS
ucfg_pmo_del_wow_pattern(struct wlan_objmgr_vdev * vdev)494 ucfg_pmo_del_wow_pattern(struct wlan_objmgr_vdev *vdev)
495 {
496 	return  pmo_core_del_wow_pattern(vdev);
497 }
498 
499 QDF_STATUS
ucfg_pmo_del_wow_user_pattern(struct wlan_objmgr_vdev * vdev,uint8_t pattern_id)500 ucfg_pmo_del_wow_user_pattern(struct wlan_objmgr_vdev *vdev,
501 			      uint8_t pattern_id)
502 {
503 	return pmo_core_del_wow_user_pattern(vdev, pattern_id);
504 }
505 
506 QDF_STATUS
ucfg_pmo_psoc_bus_resume_req(struct wlan_objmgr_psoc * psoc,enum qdf_suspend_type type)507 ucfg_pmo_psoc_bus_resume_req(struct wlan_objmgr_psoc *psoc,
508 			     enum qdf_suspend_type type)
509 {
510 	return pmo_core_psoc_bus_resume_req(psoc, type);
511 }
512 
ucfg_pmo_get_wow_bus_suspend(struct wlan_objmgr_psoc * psoc)513 bool ucfg_pmo_get_wow_bus_suspend(struct wlan_objmgr_psoc *psoc)
514 {
515 	return pmo_core_get_wow_bus_suspend(psoc);
516 }
517 
ucfg_pmo_psoc_is_target_wake_up_received(struct wlan_objmgr_psoc * psoc)518 int ucfg_pmo_psoc_is_target_wake_up_received(struct wlan_objmgr_psoc *psoc)
519 {
520 	return pmo_core_psoc_is_target_wake_up_received(psoc);
521 }
522 
ucfg_pmo_psoc_clear_target_wake_up(struct wlan_objmgr_psoc * psoc)523 int ucfg_pmo_psoc_clear_target_wake_up(struct wlan_objmgr_psoc *psoc)
524 {
525 	return pmo_core_psoc_clear_target_wake_up(psoc);
526 }
527 
ucfg_pmo_psoc_target_suspend_acknowledge(void * context,bool wow_nack,uint16_t reason_code)528 void ucfg_pmo_psoc_target_suspend_acknowledge(void *context, bool wow_nack,
529 					      uint16_t reason_code)
530 {
531 	pmo_core_psoc_target_suspend_acknowledge(context, wow_nack,
532 						 reason_code);
533 }
534 
ucfg_pmo_psoc_wakeup_host_event_received(struct wlan_objmgr_psoc * psoc)535 void ucfg_pmo_psoc_wakeup_host_event_received(struct wlan_objmgr_psoc *psoc)
536 {
537 	pmo_core_psoc_wakeup_host_event_received(psoc);
538 }
539 
ucfg_pmo_enable_hw_filter_in_fwr(struct wlan_objmgr_vdev * vdev)540 QDF_STATUS ucfg_pmo_enable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
541 {
542 	return pmo_core_enable_hw_filter_in_fwr(vdev);
543 }
544 
545 QDF_STATUS
ucfg_pmo_enable_action_frame_patterns(struct wlan_objmgr_vdev * vdev,enum qdf_suspend_type suspend_type)546 ucfg_pmo_enable_action_frame_patterns(struct wlan_objmgr_vdev *vdev,
547 				      enum qdf_suspend_type suspend_type)
548 {
549 	return pmo_register_action_frame_patterns(vdev, suspend_type);
550 }
551 
ucfg_pmo_disable_action_frame_patterns(struct wlan_objmgr_vdev * vdev)552 QDF_STATUS ucfg_pmo_disable_action_frame_patterns(struct wlan_objmgr_vdev *vdev)
553 {
554 	return pmo_clear_action_frame_patterns(vdev);
555 }
556 
ucfg_pmo_disable_hw_filter_in_fwr(struct wlan_objmgr_vdev * vdev)557 QDF_STATUS ucfg_pmo_disable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
558 {
559 	return pmo_core_disable_hw_filter_in_fwr(vdev);
560 }
561 
ucfg_pmo_config_listen_interval(struct wlan_objmgr_vdev * vdev,uint32_t listen_interval)562 QDF_STATUS ucfg_pmo_config_listen_interval(struct wlan_objmgr_vdev *vdev,
563 					   uint32_t listen_interval)
564 {
565 	return pmo_core_config_listen_interval(vdev, listen_interval);
566 }
567 
ucfg_pmo_get_listen_interval(struct wlan_objmgr_vdev * vdev,uint32_t * listen_interval)568 QDF_STATUS ucfg_pmo_get_listen_interval(struct wlan_objmgr_vdev *vdev,
569 					uint32_t *listen_interval)
570 {
571 	return pmo_core_get_listen_interval(vdev, listen_interval);
572 }
573 
ucfg_pmo_config_modulated_dtim(struct wlan_objmgr_vdev * vdev,uint32_t mod_dtim)574 QDF_STATUS ucfg_pmo_config_modulated_dtim(struct wlan_objmgr_vdev *vdev,
575 					  uint32_t mod_dtim)
576 {
577 	return pmo_core_config_modulated_dtim(vdev, mod_dtim);
578 }
579 
580 enum pmo_wow_enable_type
ucfg_pmo_get_wow_enable(struct wlan_objmgr_psoc * psoc)581 ucfg_pmo_get_wow_enable(struct wlan_objmgr_psoc *psoc)
582 {
583 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
584 
585 	return pmo_psoc_ctx->psoc_cfg.wow_enable;
586 }
587 
588 void
ucfg_pmo_set_wow_enable(struct wlan_objmgr_psoc * psoc,enum pmo_wow_enable_type val)589 ucfg_pmo_set_wow_enable(struct wlan_objmgr_psoc *psoc,
590 			enum pmo_wow_enable_type val)
591 {
592 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
593 
594 	pmo_psoc_ctx->psoc_cfg.wow_enable = val;
595 }
596 
597 void
ucfg_pmo_set_ps_params(struct wlan_objmgr_vdev * vdev,struct pmo_ps_params * ps_params)598 ucfg_pmo_set_ps_params(struct wlan_objmgr_vdev *vdev,
599 		       struct pmo_ps_params *ps_params)
600 {
601 	pmo_core_vdev_set_ps_params(vdev, ps_params);
602 }
603 
ucfg_pmo_get_ps_params(struct wlan_objmgr_vdev * vdev,struct pmo_ps_params * ps_params)604 QDF_STATUS ucfg_pmo_get_ps_params(struct wlan_objmgr_vdev *vdev,
605 				  struct pmo_ps_params *ps_params)
606 {
607 	return pmo_core_vdev_get_ps_params(vdev, ps_params);
608 }
609 
ucfg_pmo_core_vdev_set_ps_opm_mode(struct wlan_objmgr_vdev * vdev,enum powersave_mode opm_mode)610 QDF_STATUS ucfg_pmo_core_vdev_set_ps_opm_mode(struct wlan_objmgr_vdev *vdev,
611 					      enum powersave_mode opm_mode)
612 {
613 	return pmo_vdev_set_ps_opm_mode(vdev, opm_mode);
614 }
615 
ucfg_pmo_core_vdev_get_ps_opm_mode(struct wlan_objmgr_vdev * vdev,enum powersave_mode * opm_mode)616 QDF_STATUS ucfg_pmo_core_vdev_get_ps_opm_mode(struct wlan_objmgr_vdev *vdev,
617 					      enum powersave_mode *opm_mode)
618 {
619 	return pmo_vdev_get_ps_opm_mode(vdev, opm_mode);
620 }
621 
622 bool
ucfg_pmo_is_arp_offload_enabled(struct wlan_objmgr_psoc * psoc)623 ucfg_pmo_is_arp_offload_enabled(struct wlan_objmgr_psoc *psoc)
624 {
625 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
626 
627 	return pmo_psoc_ctx->psoc_cfg.arp_offload_enable;
628 }
629 
630 #ifdef WLAN_FEATURE_IGMP_OFFLOAD
631 bool
ucfg_pmo_is_igmp_offload_enabled(struct wlan_objmgr_psoc * psoc)632 ucfg_pmo_is_igmp_offload_enabled(struct wlan_objmgr_psoc *psoc)
633 {
634 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
635 
636 	return pmo_psoc_ctx->psoc_cfg.igmp_offload_enable;
637 }
638 #endif
639 
640 void
ucfg_pmo_set_arp_offload_enabled(struct wlan_objmgr_psoc * psoc,bool val)641 ucfg_pmo_set_arp_offload_enabled(struct wlan_objmgr_psoc *psoc,
642 				 bool val)
643 {
644 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
645 
646 	pmo_psoc_ctx->psoc_cfg.arp_offload_enable = val;
647 }
648 
649 #ifdef WLAN_FEATURE_IGMP_OFFLOAD
650 void
ucfg_pmo_set_igmp_offload_enabled(struct wlan_objmgr_psoc * psoc,bool val)651 ucfg_pmo_set_igmp_offload_enabled(struct wlan_objmgr_psoc *psoc,
652 				  bool val)
653 {
654 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
655 
656 	pmo_psoc_ctx->psoc_cfg.igmp_offload_enable = val;
657 }
658 #endif
659 
660 enum pmo_auto_pwr_detect_failure_mode
ucfg_pmo_get_auto_power_fail_mode(struct wlan_objmgr_psoc * psoc)661 ucfg_pmo_get_auto_power_fail_mode(struct wlan_objmgr_psoc *psoc)
662 {
663 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
664 
665 	return pmo_psoc_ctx->psoc_cfg.auto_power_save_fail_mode;
666 }
667 
668 #ifdef WLAN_FEATURE_WOW_PULSE
ucfg_pmo_is_wow_pulse_enabled(struct wlan_objmgr_psoc * psoc)669 bool ucfg_pmo_is_wow_pulse_enabled(struct wlan_objmgr_psoc *psoc)
670 {
671 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
672 
673 	return pmo_psoc_ctx->psoc_cfg.is_wow_pulse_supported;
674 }
675 
ucfg_pmo_get_wow_pulse_pin(struct wlan_objmgr_psoc * psoc)676 uint8_t ucfg_pmo_get_wow_pulse_pin(struct wlan_objmgr_psoc *psoc)
677 {
678 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
679 
680 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_pin;
681 }
682 
ucfg_pmo_get_wow_pulse_interval_high(struct wlan_objmgr_psoc * psoc)683 uint16_t ucfg_pmo_get_wow_pulse_interval_high(struct wlan_objmgr_psoc *psoc)
684 {
685 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
686 
687 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_interval_high;
688 }
689 
ucfg_pmo_get_wow_pulse_interval_low(struct wlan_objmgr_psoc * psoc)690 uint16_t ucfg_pmo_get_wow_pulse_interval_low(struct wlan_objmgr_psoc *psoc)
691 {
692 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
693 
694 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_interval_low;
695 }
696 
ucfg_pmo_get_wow_pulse_repeat_count(struct wlan_objmgr_psoc * psoc)697 uint32_t ucfg_pmo_get_wow_pulse_repeat_count(struct wlan_objmgr_psoc *psoc)
698 {
699 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
700 
701 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_repeat_count;
702 }
703 
ucfg_pmo_get_wow_pulse_init_state(struct wlan_objmgr_psoc * psoc)704 uint32_t ucfg_pmo_get_wow_pulse_init_state(struct wlan_objmgr_psoc *psoc)
705 {
706 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
707 
708 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_init_state;
709 }
710 #endif
711 
ucfg_pmo_is_active_mode_offloaded(struct wlan_objmgr_psoc * psoc)712 bool ucfg_pmo_is_active_mode_offloaded(struct wlan_objmgr_psoc *psoc)
713 {
714 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
715 
716 	return pmo_psoc_ctx->psoc_cfg.active_mode_offload;
717 }
718 
719 #ifdef FEATURE_WLAN_APF
ucfg_pmo_is_apf_enabled(struct wlan_objmgr_psoc * psoc)720 bool ucfg_pmo_is_apf_enabled(struct wlan_objmgr_psoc *psoc)
721 {
722 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
723 
724 	return pmo_intersect_apf(pmo_psoc_ctx);
725 }
726 #endif
727 
728 bool
ucfg_pmo_is_ssdp_enabled(struct wlan_objmgr_psoc * psoc)729 ucfg_pmo_is_ssdp_enabled(struct wlan_objmgr_psoc *psoc)
730 {
731 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
732 
733 	return pmo_psoc_ctx->psoc_cfg.ssdp;
734 }
735 
736 #ifdef FEATURE_RUNTIME_PM
737 uint32_t
ucfg_pmo_get_runtime_pm_delay(struct wlan_objmgr_psoc * psoc)738 ucfg_pmo_get_runtime_pm_delay(struct wlan_objmgr_psoc *psoc)
739 {
740 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
741 
742 	if (!pmo_psoc_ctx)
743 		return 0;
744 
745 	return pmo_psoc_ctx->psoc_cfg.runtime_pm_delay;
746 }
747 #endif /* FEATURE_RUNTIME_PM */
748 
749 bool
ucfg_pmo_is_ns_offloaded(struct wlan_objmgr_psoc * psoc)750 ucfg_pmo_is_ns_offloaded(struct wlan_objmgr_psoc *psoc)
751 {
752 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
753 
754 	return pmo_psoc_ctx->psoc_cfg.ns_offload_enable_static;
755 }
756 
757 uint8_t
ucfg_pmo_get_sta_dynamic_dtim(struct wlan_objmgr_psoc * psoc)758 ucfg_pmo_get_sta_dynamic_dtim(struct wlan_objmgr_psoc *psoc)
759 {
760 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
761 
762 	return pmo_psoc_ctx->psoc_cfg.sta_dynamic_dtim;
763 }
764 
765 uint8_t
ucfg_pmo_get_sta_mod_dtim(struct wlan_objmgr_psoc * psoc)766 ucfg_pmo_get_sta_mod_dtim(struct wlan_objmgr_psoc *psoc)
767 {
768 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
769 
770 	return pmo_psoc_ctx->psoc_cfg.sta_mod_dtim;
771 }
772 
773 void
ucfg_pmo_set_sta_mod_dtim(struct wlan_objmgr_psoc * psoc,uint8_t val)774 ucfg_pmo_set_sta_mod_dtim(struct wlan_objmgr_psoc *psoc,
775 			  uint8_t val)
776 {
777 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
778 
779 	pmo_psoc_ctx->psoc_cfg.sta_mod_dtim = val;
780 }
781 
782 bool
ucfg_pmo_is_mc_addr_list_enabled(struct wlan_objmgr_psoc * psoc)783 ucfg_pmo_is_mc_addr_list_enabled(struct wlan_objmgr_psoc *psoc)
784 {
785 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
786 
787 	return pmo_psoc_ctx->psoc_cfg.enable_mc_list;
788 }
789 
790 enum powersave_mode
ucfg_pmo_get_power_save_mode(struct wlan_objmgr_psoc * psoc)791 ucfg_pmo_get_power_save_mode(struct wlan_objmgr_psoc *psoc)
792 {
793 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
794 
795 	return pmo_psoc_ctx->psoc_cfg.power_save_mode;
796 }
797 
798 enum powersave_mode
ucfg_pmo_get_default_power_save_mode(struct wlan_objmgr_psoc * psoc)799 ucfg_pmo_get_default_power_save_mode(struct wlan_objmgr_psoc *psoc)
800 {
801 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
802 
803 	return pmo_psoc_ctx->psoc_cfg.default_power_save_mode;
804 }
805 
806 void
ucfg_pmo_set_power_save_mode(struct wlan_objmgr_psoc * psoc,enum powersave_mode val)807 ucfg_pmo_set_power_save_mode(struct wlan_objmgr_psoc *psoc,
808 			     enum powersave_mode val)
809 {
810 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
811 
812 	pmo_psoc_ctx->psoc_cfg.power_save_mode = val;
813 }
814 
815 uint8_t
ucfg_pmo_get_max_ps_poll(struct wlan_objmgr_psoc * psoc)816 ucfg_pmo_get_max_ps_poll(struct wlan_objmgr_psoc *psoc)
817 {
818 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
819 
820 	return pmo_psoc_ctx->psoc_cfg.max_ps_poll;
821 }
822 
823 uint8_t
ucfg_pmo_power_save_offload_enabled(struct wlan_objmgr_psoc * psoc)824 ucfg_pmo_power_save_offload_enabled(struct wlan_objmgr_psoc *psoc)
825 {
826 	uint8_t powersave_offload_enabled = PMO_PS_ADVANCED_POWER_SAVE_ENABLE;
827 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
828 
829 	if (!pmo_psoc_ctx->psoc_cfg.max_ps_poll ||
830 	    !pmo_psoc_ctx->psoc_cfg.power_save_mode)
831 		powersave_offload_enabled =
832 			pmo_psoc_ctx->psoc_cfg.power_save_mode;
833 
834 	pmo_debug("powersave offload enabled type:%d",
835 		  powersave_offload_enabled);
836 
837 	return powersave_offload_enabled;
838 }
839 
840 QDF_STATUS
ucfg_pmo_tgt_psoc_send_idle_roam_suspend_mode(struct wlan_objmgr_psoc * psoc,uint8_t val)841 ucfg_pmo_tgt_psoc_send_idle_roam_suspend_mode(struct wlan_objmgr_psoc *psoc,
842 					      uint8_t val)
843 {
844 	return pmo_tgt_psoc_send_idle_roam_monitor(psoc, val);
845 }
846 
847 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
848 bool
ucfg_pmo_extwow_is_goto_suspend_enabled(struct wlan_objmgr_psoc * psoc)849 ucfg_pmo_extwow_is_goto_suspend_enabled(struct wlan_objmgr_psoc *psoc)
850 {
851 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
852 
853 	return pmo_psoc_ctx->psoc_cfg.extwow_goto_suspend;
854 }
855 
856 uint8_t
ucfg_pmo_extwow_app1_wakeup_pin_num(struct wlan_objmgr_psoc * psoc)857 ucfg_pmo_extwow_app1_wakeup_pin_num(struct wlan_objmgr_psoc *psoc)
858 {
859 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
860 
861 	return pmo_psoc_ctx->psoc_cfg.extwow_app1_wakeup_pin_num;
862 }
863 
864 uint8_t
ucfg_pmo_extwow_app2_wakeup_pin_num(struct wlan_objmgr_psoc * psoc)865 ucfg_pmo_extwow_app2_wakeup_pin_num(struct wlan_objmgr_psoc *psoc)
866 {
867 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
868 
869 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_wakeup_pin_num;
870 }
871 
872 uint32_t
ucfg_pmo_extwow_app2_init_ping_interval(struct wlan_objmgr_psoc * psoc)873 ucfg_pmo_extwow_app2_init_ping_interval(struct wlan_objmgr_psoc *psoc)
874 {
875 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
876 
877 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_init_ping_interval;
878 }
879 
880 uint32_t
ucfg_pmo_extwow_app2_min_ping_interval(struct wlan_objmgr_psoc * psoc)881 ucfg_pmo_extwow_app2_min_ping_interval(struct wlan_objmgr_psoc *psoc)
882 {
883 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
884 
885 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_min_ping_interval;
886 }
887 
888 uint32_t
ucfg_pmo_extwow_app2_max_ping_interval(struct wlan_objmgr_psoc * psoc)889 ucfg_pmo_extwow_app2_max_ping_interval(struct wlan_objmgr_psoc *psoc)
890 {
891 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
892 
893 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_max_ping_interval;
894 }
895 
896 uint32_t
ucfg_pmo_extwow_app2_inc_ping_interval(struct wlan_objmgr_psoc * psoc)897 ucfg_pmo_extwow_app2_inc_ping_interval(struct wlan_objmgr_psoc *psoc)
898 {
899 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
900 
901 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_inc_ping_interval;
902 }
903 
904 uint16_t
ucfg_pmo_extwow_app2_tcp_src_port(struct wlan_objmgr_psoc * psoc)905 ucfg_pmo_extwow_app2_tcp_src_port(struct wlan_objmgr_psoc *psoc)
906 {
907 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
908 
909 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_src_port;
910 }
911 
912 uint16_t
ucfg_pmo_extwow_app2_tcp_dst_port(struct wlan_objmgr_psoc * psoc)913 ucfg_pmo_extwow_app2_tcp_dst_port(struct wlan_objmgr_psoc *psoc)
914 {
915 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
916 
917 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_dst_port;
918 }
919 
920 uint32_t
ucfg_pmo_extwow_app2_tcp_tx_timeout(struct wlan_objmgr_psoc * psoc)921 ucfg_pmo_extwow_app2_tcp_tx_timeout(struct wlan_objmgr_psoc *psoc)
922 {
923 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
924 
925 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_tx_timeout;
926 }
927 
928 uint32_t
ucfg_pmo_extwow_app2_tcp_rx_timeout(struct wlan_objmgr_psoc * psoc)929 ucfg_pmo_extwow_app2_tcp_rx_timeout(struct wlan_objmgr_psoc *psoc)
930 {
931 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
932 
933 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_rx_timeout;
934 }
935 #endif
936 
937 bool
ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc * psoc)938 ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc *psoc)
939 {
940 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
941 
942 	return pmo_psoc_ctx->psoc_cfg.enable_sap_suspend;
943 }
944 
945 void
ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc * psoc,uint8_t val)946 ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
947 					 uint8_t val)
948 {
949 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
950 
951 	pmo_psoc_ctx->psoc_cfg.wow_data_inactivity_timeout = val;
952 }
953 
ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc * psoc)954 bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
955 {
956 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
957 
958 	return pmo_psoc_ctx->psoc_cfg.packet_filter_enabled;
959 }
960 
961 enum active_apf_mode
ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc * psoc)962 ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc)
963 {
964 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
965 
966 	return pmo_psoc_ctx->psoc_cfg.active_uc_apf_mode;
967 }
968 
969 enum active_apf_mode
ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc * psoc)970 ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
971 {
972 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
973 
974 	return pmo_psoc_ctx->psoc_cfg.active_mc_bc_apf_mode;
975 }
976 
977 #ifdef WLAN_ENABLE_GPIO_WAKEUP
ucfg_pmo_is_gpio_wakeup_enabled(struct wlan_objmgr_psoc * psoc)978 bool ucfg_pmo_is_gpio_wakeup_enabled(struct wlan_objmgr_psoc *psoc)
979 {
980 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
981 
982 	return pmo_psoc_ctx->psoc_cfg.enable_gpio_wakeup;
983 }
984 
ucfg_pmo_get_gpio_wakeup_pin(struct wlan_objmgr_psoc * psoc)985 uint32_t ucfg_pmo_get_gpio_wakeup_pin(struct wlan_objmgr_psoc *psoc)
986 {
987 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
988 
989 	return pmo_psoc_ctx->psoc_cfg.gpio_wakeup_pin;
990 }
991 
992 enum pmo_gpio_wakeup_mode
ucfg_pmo_get_gpio_wakeup_mode(struct wlan_objmgr_psoc * psoc)993 ucfg_pmo_get_gpio_wakeup_mode(struct wlan_objmgr_psoc *psoc)
994 {
995 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
996 
997 	return pmo_psoc_ctx->psoc_cfg.gpio_wakeup_mode;
998 }
999 #endif
1000 
1001 bool
ucfg_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc * psoc)1002 ucfg_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
1003 {
1004 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1005 
1006 	return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_sap_mode;
1007 }
1008 
1009 bool
ucfg_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc * psoc)1010 ucfg_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
1011 {
1012 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1013 
1014 	return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_go_mode;
1015 }
1016 
1017 enum pmo_suspend_mode
ucfg_pmo_get_suspend_mode(struct wlan_objmgr_psoc * psoc)1018 ucfg_pmo_get_suspend_mode(struct wlan_objmgr_psoc *psoc)
1019 {
1020 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1021 
1022 	return pmo_psoc_ctx->psoc_cfg.suspend_mode;
1023 }
1024 
ucfg_pmo_core_txrx_suspend(struct wlan_objmgr_psoc * psoc)1025 QDF_STATUS ucfg_pmo_core_txrx_suspend(struct wlan_objmgr_psoc *psoc)
1026 {
1027 	return pmo_core_txrx_suspend(psoc);
1028 }
1029 
ucfg_pmo_core_txrx_resume(struct wlan_objmgr_psoc * psoc)1030 QDF_STATUS ucfg_pmo_core_txrx_resume(struct wlan_objmgr_psoc *psoc)
1031 {
1032 	return pmo_core_txrx_resume(psoc);
1033 }
1034 
1035 #ifdef SYSTEM_PM_CHECK
ucfg_pmo_notify_system_resume(struct wlan_objmgr_psoc * psoc)1036 void ucfg_pmo_notify_system_resume(struct wlan_objmgr_psoc *psoc)
1037 {
1038 	pmo_core_system_resume(psoc);
1039 }
1040 #endif
1041 
ucfg_pmo_get_moddtim_user_enable(struct wlan_objmgr_vdev * vdev)1042 bool ucfg_pmo_get_moddtim_user_enable(struct wlan_objmgr_vdev *vdev)
1043 {
1044 	return pmo_core_vdev_get_moddtim_user_enabled(vdev);
1045 }
1046 
ucfg_pmo_set_moddtim_user_enable(struct wlan_objmgr_vdev * vdev,bool value)1047 void ucfg_pmo_set_moddtim_user_enable(struct wlan_objmgr_vdev *vdev,
1048 				      bool value)
1049 {
1050 	pmo_core_vdev_set_moddtim_user_enabled(vdev, value);
1051 }
1052 
ucfg_pmo_get_moddtim_user_active(struct wlan_objmgr_vdev * vdev)1053 bool ucfg_pmo_get_moddtim_user_active(struct wlan_objmgr_vdev *vdev)
1054 {
1055 	return pmo_core_vdev_get_moddtim_user_active(vdev);
1056 }
1057 
ucfg_pmo_get_moddtim_user(struct wlan_objmgr_vdev * vdev)1058 uint32_t ucfg_pmo_get_moddtim_user(struct wlan_objmgr_vdev *vdev)
1059 {
1060 	return pmo_core_vdev_get_moddtim_user(vdev);
1061 }
1062 
1063 uint32_t
ucfg_pmo_get_ssr_frequency_on_pagefault(struct wlan_objmgr_psoc * psoc)1064 ucfg_pmo_get_ssr_frequency_on_pagefault(struct wlan_objmgr_psoc *psoc)
1065 {
1066 	return pmo_get_ssr_frequency_on_pagefault(psoc);
1067 }
1068 
1069 bool
ucfg_pmo_get_disconnect_sap_tdls_in_wow(struct wlan_objmgr_psoc * psoc)1070 ucfg_pmo_get_disconnect_sap_tdls_in_wow(struct wlan_objmgr_psoc *psoc)
1071 {
1072 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1073 
1074 	return pmo_psoc_ctx->psoc_cfg.disconnect_sap_tdls_in_wow;
1075 }
1076 
1077 #ifdef WLAN_FEATURE_ICMP_OFFLOAD
ucfg_pmo_check_icmp_offload(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)1078 QDF_STATUS ucfg_pmo_check_icmp_offload(struct wlan_objmgr_psoc *psoc,
1079 				       uint8_t vdev_id)
1080 {
1081 	return pmo_core_icmp_check_offload(psoc, vdev_id);
1082 }
1083 
1084 bool
ucfg_pmo_is_icmp_offload_enabled(struct wlan_objmgr_psoc * psoc)1085 ucfg_pmo_is_icmp_offload_enabled(struct wlan_objmgr_psoc *psoc)
1086 {
1087 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1088 
1089 	return pmo_psoc_ctx->psoc_cfg.is_icmp_offload_enable;
1090 }
1091 
ucfg_pmo_config_icmp_offload(struct wlan_objmgr_psoc * psoc,struct pmo_icmp_offload * pmo_icmp_req)1092 QDF_STATUS ucfg_pmo_config_icmp_offload(struct wlan_objmgr_psoc *psoc,
1093 					struct pmo_icmp_offload *pmo_icmp_req)
1094 {
1095 	return pmo_tgt_config_icmp_offload_req(psoc, pmo_icmp_req);
1096 }
1097 #endif
1098 
ucfg_pmo_set_vdev_bridge_addr(struct wlan_objmgr_vdev * vdev,struct qdf_mac_addr * bridgeaddr)1099 QDF_STATUS ucfg_pmo_set_vdev_bridge_addr(struct wlan_objmgr_vdev *vdev,
1100 					 struct qdf_mac_addr *bridgeaddr)
1101 {
1102 	return pmo_set_vdev_bridge_addr(vdev, bridgeaddr);
1103 }
1104 
ucfg_pmo_get_vdev_bridge_addr(struct wlan_objmgr_vdev * vdev,struct qdf_mac_addr * bridgeaddr)1105 QDF_STATUS ucfg_pmo_get_vdev_bridge_addr(struct wlan_objmgr_vdev *vdev,
1106 					 struct qdf_mac_addr *bridgeaddr)
1107 {
1108 	return pmo_get_vdev_bridge_addr(vdev, bridgeaddr);
1109 }
1110