xref: /wlan-dirver/qcacld-3.0/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c (revision a24510696edc222f9e9b89d388912a346710831d)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 /**
20  * 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 
40 QDF_STATUS ucfg_pmo_psoc_open(struct wlan_objmgr_psoc *psoc)
41 {
42 	return pmo_psoc_open(psoc);
43 }
44 
45 QDF_STATUS ucfg_pmo_psoc_close(struct wlan_objmgr_psoc *psoc)
46 {
47 	return pmo_psoc_close(psoc);
48 }
49 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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
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
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
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 
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 
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
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
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
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
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
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
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
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
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
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 
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 
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 
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 
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 
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
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
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 
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 
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
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 
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
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 
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
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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
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
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 
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 
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
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
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 
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
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
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 
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
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
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
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 
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 
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 
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 
528 void ucfg_pmo_psoc_target_suspend_acknowledge(void *context, bool wow_nack)
529 {
530 	pmo_core_psoc_target_suspend_acknowledge(context, wow_nack);
531 }
532 
533 void ucfg_pmo_psoc_wakeup_host_event_received(struct wlan_objmgr_psoc *psoc)
534 {
535 	pmo_core_psoc_wakeup_host_event_received(psoc);
536 }
537 
538 QDF_STATUS ucfg_pmo_enable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
539 {
540 	return pmo_core_enable_hw_filter_in_fwr(vdev);
541 }
542 
543 QDF_STATUS
544 ucfg_pmo_enable_action_frame_patterns(struct wlan_objmgr_vdev *vdev,
545 				      enum qdf_suspend_type suspend_type)
546 {
547 	return pmo_register_action_frame_patterns(vdev, suspend_type);
548 }
549 
550 QDF_STATUS ucfg_pmo_disable_action_frame_patterns(struct wlan_objmgr_vdev *vdev)
551 {
552 	return pmo_clear_action_frame_patterns(vdev);
553 }
554 
555 QDF_STATUS ucfg_pmo_disable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev)
556 {
557 	return pmo_core_disable_hw_filter_in_fwr(vdev);
558 }
559 
560 QDF_STATUS ucfg_pmo_config_listen_interval(struct wlan_objmgr_vdev *vdev,
561 					   uint32_t listen_interval)
562 {
563 	return pmo_core_config_listen_interval(vdev, listen_interval);
564 }
565 
566 QDF_STATUS ucfg_pmo_config_modulated_dtim(struct wlan_objmgr_vdev *vdev,
567 					  uint32_t mod_dtim)
568 {
569 	return pmo_core_config_modulated_dtim(vdev, mod_dtim);
570 }
571 
572 enum pmo_wow_enable_type
573 ucfg_pmo_get_wow_enable(struct wlan_objmgr_psoc *psoc)
574 {
575 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
576 
577 	return pmo_psoc_ctx->psoc_cfg.wow_enable;
578 }
579 
580 void
581 ucfg_pmo_set_wow_enable(struct wlan_objmgr_psoc *psoc,
582 			enum pmo_wow_enable_type val)
583 {
584 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
585 
586 	pmo_psoc_ctx->psoc_cfg.wow_enable = val;
587 }
588 
589 bool
590 ucfg_pmo_is_arp_offload_enabled(struct wlan_objmgr_psoc *psoc)
591 {
592 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
593 
594 	return pmo_psoc_ctx->psoc_cfg.arp_offload_enable;
595 }
596 
597 #ifdef WLAN_FEATURE_IGMP_OFFLOAD
598 bool
599 ucfg_pmo_is_igmp_offload_enabled(struct wlan_objmgr_psoc *psoc)
600 {
601 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
602 
603 	return pmo_psoc_ctx->psoc_cfg.igmp_offload_enable;
604 }
605 #endif
606 
607 void
608 ucfg_pmo_set_arp_offload_enabled(struct wlan_objmgr_psoc *psoc,
609 				 bool val)
610 {
611 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
612 
613 	pmo_psoc_ctx->psoc_cfg.arp_offload_enable = val;
614 }
615 
616 #ifdef WLAN_FEATURE_IGMP_OFFLOAD
617 void
618 ucfg_pmo_set_igmp_offload_enabled(struct wlan_objmgr_psoc *psoc,
619 				  bool val)
620 {
621 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
622 
623 	pmo_psoc_ctx->psoc_cfg.igmp_offload_enable = val;
624 }
625 #endif
626 
627 enum pmo_auto_pwr_detect_failure_mode
628 ucfg_pmo_get_auto_power_fail_mode(struct wlan_objmgr_psoc *psoc)
629 {
630 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
631 
632 	return pmo_psoc_ctx->psoc_cfg.auto_power_save_fail_mode;
633 }
634 
635 #ifdef WLAN_FEATURE_WOW_PULSE
636 bool ucfg_pmo_is_wow_pulse_enabled(struct wlan_objmgr_psoc *psoc)
637 {
638 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
639 
640 	return pmo_psoc_ctx->psoc_cfg.is_wow_pulse_supported;
641 }
642 
643 uint8_t ucfg_pmo_get_wow_pulse_pin(struct wlan_objmgr_psoc *psoc)
644 {
645 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
646 
647 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_pin;
648 }
649 
650 uint16_t ucfg_pmo_get_wow_pulse_interval_high(struct wlan_objmgr_psoc *psoc)
651 {
652 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
653 
654 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_interval_high;
655 }
656 
657 uint16_t ucfg_pmo_get_wow_pulse_interval_low(struct wlan_objmgr_psoc *psoc)
658 {
659 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
660 
661 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_interval_low;
662 }
663 
664 uint32_t ucfg_pmo_get_wow_pulse_repeat_count(struct wlan_objmgr_psoc *psoc)
665 {
666 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
667 
668 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_repeat_count;
669 }
670 
671 uint32_t ucfg_pmo_get_wow_pulse_init_state(struct wlan_objmgr_psoc *psoc)
672 {
673 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
674 
675 	return pmo_psoc_ctx->psoc_cfg.wow_pulse_init_state;
676 }
677 #endif
678 
679 bool ucfg_pmo_is_active_mode_offloaded(struct wlan_objmgr_psoc *psoc)
680 {
681 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
682 
683 	return pmo_psoc_ctx->psoc_cfg.active_mode_offload;
684 }
685 
686 #ifdef FEATURE_WLAN_APF
687 bool ucfg_pmo_is_apf_enabled(struct wlan_objmgr_psoc *psoc)
688 {
689 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
690 
691 	return pmo_intersect_apf(pmo_psoc_ctx);
692 }
693 #endif
694 
695 bool
696 ucfg_pmo_is_ssdp_enabled(struct wlan_objmgr_psoc *psoc)
697 {
698 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
699 
700 	return pmo_psoc_ctx->psoc_cfg.ssdp;
701 }
702 
703 #ifdef FEATURE_RUNTIME_PM
704 uint32_t
705 ucfg_pmo_get_runtime_pm_delay(struct wlan_objmgr_psoc *psoc)
706 {
707 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
708 
709 	return pmo_psoc_ctx->psoc_cfg.runtime_pm_delay;
710 }
711 #endif /* FEATURE_RUNTIME_PM */
712 
713 bool
714 ucfg_pmo_is_ns_offloaded(struct wlan_objmgr_psoc *psoc)
715 {
716 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
717 
718 	return pmo_psoc_ctx->psoc_cfg.ns_offload_enable_static;
719 }
720 
721 uint8_t
722 ucfg_pmo_get_sta_dynamic_dtim(struct wlan_objmgr_psoc *psoc)
723 {
724 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
725 
726 	return pmo_psoc_ctx->psoc_cfg.sta_dynamic_dtim;
727 }
728 
729 uint8_t
730 ucfg_pmo_get_sta_mod_dtim(struct wlan_objmgr_psoc *psoc)
731 {
732 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
733 
734 	return pmo_psoc_ctx->psoc_cfg.sta_mod_dtim;
735 }
736 
737 void
738 ucfg_pmo_set_sta_mod_dtim(struct wlan_objmgr_psoc *psoc,
739 			  uint8_t val)
740 {
741 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
742 
743 	pmo_psoc_ctx->psoc_cfg.sta_mod_dtim = val;
744 }
745 
746 bool
747 ucfg_pmo_is_mc_addr_list_enabled(struct wlan_objmgr_psoc *psoc)
748 {
749 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
750 
751 	return pmo_psoc_ctx->psoc_cfg.enable_mc_list;
752 }
753 
754 enum powersave_mode
755 ucfg_pmo_get_power_save_mode(struct wlan_objmgr_psoc *psoc)
756 {
757 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
758 
759 	return pmo_psoc_ctx->psoc_cfg.power_save_mode;
760 }
761 
762 enum powersave_mode
763 ucfg_pmo_get_default_power_save_mode(struct wlan_objmgr_psoc *psoc)
764 {
765 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
766 
767 	return pmo_psoc_ctx->psoc_cfg.default_power_save_mode;
768 }
769 
770 void
771 ucfg_pmo_set_power_save_mode(struct wlan_objmgr_psoc *psoc,
772 			     enum powersave_mode val)
773 {
774 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
775 
776 	pmo_psoc_ctx->psoc_cfg.power_save_mode = val;
777 }
778 
779 uint8_t
780 ucfg_pmo_get_max_ps_poll(struct wlan_objmgr_psoc *psoc)
781 {
782 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
783 
784 	return pmo_psoc_ctx->psoc_cfg.max_ps_poll;
785 }
786 
787 uint8_t
788 ucfg_pmo_power_save_offload_enabled(struct wlan_objmgr_psoc *psoc)
789 {
790 	uint8_t powersave_offload_enabled = PMO_PS_ADVANCED_POWER_SAVE_ENABLE;
791 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
792 
793 	if (!pmo_psoc_ctx->psoc_cfg.max_ps_poll ||
794 	    !pmo_psoc_ctx->psoc_cfg.power_save_mode)
795 		powersave_offload_enabled =
796 			pmo_psoc_ctx->psoc_cfg.power_save_mode;
797 
798 	pmo_debug("powersave offload enabled type:%d",
799 		  powersave_offload_enabled);
800 
801 	return powersave_offload_enabled;
802 }
803 
804 QDF_STATUS
805 ucfg_pmo_tgt_psoc_send_idle_roam_suspend_mode(struct wlan_objmgr_psoc *psoc,
806 					      uint8_t val)
807 {
808 	return pmo_tgt_psoc_send_idle_roam_monitor(psoc, val);
809 }
810 
811 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
812 bool
813 ucfg_pmo_extwow_is_goto_suspend_enabled(struct wlan_objmgr_psoc *psoc)
814 {
815 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
816 
817 	return pmo_psoc_ctx->psoc_cfg.extwow_goto_suspend;
818 }
819 
820 uint8_t
821 ucfg_pmo_extwow_app1_wakeup_pin_num(struct wlan_objmgr_psoc *psoc)
822 {
823 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
824 
825 	return pmo_psoc_ctx->psoc_cfg.extwow_app1_wakeup_pin_num;
826 }
827 
828 uint8_t
829 ucfg_pmo_extwow_app2_wakeup_pin_num(struct wlan_objmgr_psoc *psoc)
830 {
831 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
832 
833 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_wakeup_pin_num;
834 }
835 
836 uint32_t
837 ucfg_pmo_extwow_app2_init_ping_interval(struct wlan_objmgr_psoc *psoc)
838 {
839 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
840 
841 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_init_ping_interval;
842 }
843 
844 uint32_t
845 ucfg_pmo_extwow_app2_min_ping_interval(struct wlan_objmgr_psoc *psoc)
846 {
847 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
848 
849 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_min_ping_interval;
850 }
851 
852 uint32_t
853 ucfg_pmo_extwow_app2_max_ping_interval(struct wlan_objmgr_psoc *psoc)
854 {
855 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
856 
857 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_max_ping_interval;
858 }
859 
860 uint32_t
861 ucfg_pmo_extwow_app2_inc_ping_interval(struct wlan_objmgr_psoc *psoc)
862 {
863 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
864 
865 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_inc_ping_interval;
866 }
867 
868 uint16_t
869 ucfg_pmo_extwow_app2_tcp_src_port(struct wlan_objmgr_psoc *psoc)
870 {
871 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
872 
873 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_src_port;
874 }
875 
876 uint16_t
877 ucfg_pmo_extwow_app2_tcp_dst_port(struct wlan_objmgr_psoc *psoc)
878 {
879 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
880 
881 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_dst_port;
882 }
883 
884 uint32_t
885 ucfg_pmo_extwow_app2_tcp_tx_timeout(struct wlan_objmgr_psoc *psoc)
886 {
887 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
888 
889 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_tx_timeout;
890 }
891 
892 uint32_t
893 ucfg_pmo_extwow_app2_tcp_rx_timeout(struct wlan_objmgr_psoc *psoc)
894 {
895 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
896 
897 	return pmo_psoc_ctx->psoc_cfg.extwow_app2_tcp_rx_timeout;
898 }
899 #endif
900 
901 bool
902 ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc *psoc)
903 {
904 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
905 
906 	return pmo_psoc_ctx->psoc_cfg.enable_sap_suspend;
907 }
908 
909 void
910 ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
911 					 uint8_t val)
912 {
913 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
914 
915 	pmo_psoc_ctx->psoc_cfg.wow_data_inactivity_timeout = val;
916 }
917 
918 bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
919 {
920 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
921 
922 	return pmo_psoc_ctx->psoc_cfg.packet_filter_enabled;
923 }
924 
925 enum active_apf_mode
926 ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc)
927 {
928 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
929 
930 	return pmo_psoc_ctx->psoc_cfg.active_uc_apf_mode;
931 }
932 
933 enum active_apf_mode
934 ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
935 {
936 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
937 
938 	return pmo_psoc_ctx->psoc_cfg.active_mc_bc_apf_mode;
939 }
940 
941 #ifdef WLAN_ENABLE_GPIO_WAKEUP
942 bool ucfg_pmo_is_gpio_wakeup_enabled(struct wlan_objmgr_psoc *psoc)
943 {
944 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
945 
946 	return pmo_psoc_ctx->psoc_cfg.enable_gpio_wakeup;
947 }
948 
949 uint32_t ucfg_pmo_get_gpio_wakeup_pin(struct wlan_objmgr_psoc *psoc)
950 {
951 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
952 
953 	return pmo_psoc_ctx->psoc_cfg.gpio_wakeup_pin;
954 }
955 
956 enum pmo_gpio_wakeup_mode
957 ucfg_pmo_get_gpio_wakeup_mode(struct wlan_objmgr_psoc *psoc)
958 {
959 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
960 
961 	return pmo_psoc_ctx->psoc_cfg.gpio_wakeup_mode;
962 }
963 #endif
964 
965 bool
966 ucfg_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
967 {
968 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
969 
970 	return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_sap_mode;
971 }
972 
973 bool
974 ucfg_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
975 {
976 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
977 
978 	return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_go_mode;
979 }
980 
981 enum pmo_suspend_mode
982 ucfg_pmo_get_suspend_mode(struct wlan_objmgr_psoc *psoc)
983 {
984 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
985 
986 	return pmo_psoc_ctx->psoc_cfg.suspend_mode;
987 }
988 
989 QDF_STATUS ucfg_pmo_core_txrx_suspend(struct wlan_objmgr_psoc *psoc)
990 {
991 	return pmo_core_txrx_suspend(psoc);
992 }
993 
994 QDF_STATUS ucfg_pmo_core_txrx_resume(struct wlan_objmgr_psoc *psoc)
995 {
996 	return pmo_core_txrx_resume(psoc);
997 }
998 
999 #ifdef SYSTEM_PM_CHECK
1000 void ucfg_pmo_notify_system_resume(struct wlan_objmgr_psoc *psoc)
1001 {
1002 	pmo_core_system_resume(psoc);
1003 }
1004 #endif
1005 
1006 bool ucfg_pmo_get_moddtim_user_enable(struct wlan_objmgr_vdev *vdev)
1007 {
1008 	return pmo_core_vdev_get_moddtim_user_enabled(vdev);
1009 }
1010 
1011 void ucfg_pmo_set_moddtim_user_enable(struct wlan_objmgr_vdev *vdev,
1012 				      bool value)
1013 {
1014 	pmo_core_vdev_set_moddtim_user_enabled(vdev, value);
1015 }
1016 
1017 bool ucfg_pmo_get_moddtim_user_active(struct wlan_objmgr_vdev *vdev)
1018 {
1019 	return pmo_core_vdev_get_moddtim_user_active(vdev);
1020 }
1021 
1022 uint32_t ucfg_pmo_get_moddtim_user(struct wlan_objmgr_vdev *vdev)
1023 {
1024 	return pmo_core_vdev_get_moddtim_user(vdev);
1025 }
1026 
1027 bool
1028 ucfg_pmo_get_disconnect_sap_tdls_in_wow(struct wlan_objmgr_psoc *psoc)
1029 {
1030 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1031 
1032 	return pmo_psoc_ctx->psoc_cfg.disconnect_sap_tdls_in_wow;
1033 }
1034 
1035 #ifdef WLAN_FEATURE_ICMP_OFFLOAD
1036 QDF_STATUS ucfg_pmo_check_icmp_offload(struct wlan_objmgr_psoc *psoc,
1037 				       uint8_t vdev_id)
1038 {
1039 	return pmo_core_icmp_check_offload(psoc, vdev_id);
1040 }
1041 
1042 bool
1043 ucfg_pmo_is_icmp_offload_enabled(struct wlan_objmgr_psoc *psoc)
1044 {
1045 	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
1046 
1047 	return pmo_psoc_ctx->psoc_cfg.is_icmp_offload_enable;
1048 }
1049 
1050 QDF_STATUS ucfg_pmo_config_icmp_offload(struct wlan_objmgr_psoc *psoc,
1051 					struct pmo_icmp_offload *pmo_icmp_req)
1052 {
1053 	return pmo_tgt_config_icmp_offload_req(psoc, pmo_icmp_req);
1054 }
1055 #endif
1056