xref: /wlan-driver/qcacld-3.0/components/target_if/pmo/src/target_if_pmo_main.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 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  * DOC: Target interface file for pmo component to
21*5113495bSYour Name  * Implement api's which shall be used by pmo component
22*5113495bSYour Name  * in target if internally.
23*5113495bSYour Name  */
24*5113495bSYour Name 
25*5113495bSYour Name #include "target_if_pmo.h"
26*5113495bSYour Name #include "wlan_pmo_common_public_struct.h"
27*5113495bSYour Name #include "wlan_pmo_icmp.h"
28*5113495bSYour Name 
29*5113495bSYour Name #ifdef WLAN_FEATURE_PACKET_FILTERING
30*5113495bSYour Name static inline
tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)31*5113495bSYour Name void tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
32*5113495bSYour Name {
33*5113495bSYour Name 	pmo_tx_ops->send_set_pkt_filter =
34*5113495bSYour Name 		target_if_pmo_send_pkt_filter_req;
35*5113495bSYour Name 	pmo_tx_ops->send_clear_pkt_filter =
36*5113495bSYour Name 		target_if_pmo_clear_pkt_filter_req;
37*5113495bSYour Name }
38*5113495bSYour Name #else
39*5113495bSYour Name static inline void
tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)40*5113495bSYour Name tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
41*5113495bSYour Name {
42*5113495bSYour Name }
43*5113495bSYour Name #endif
44*5113495bSYour Name #ifdef WLAN_FEATURE_IGMP_OFFLOAD
45*5113495bSYour Name static void
update_pmo_igmp_tx_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)46*5113495bSYour Name update_pmo_igmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
47*5113495bSYour Name {
48*5113495bSYour Name 	pmo_tx_ops->send_igmp_offload_req =
49*5113495bSYour Name 		target_if_pmo_send_igmp_offload_req;
50*5113495bSYour Name }
51*5113495bSYour Name #else
52*5113495bSYour Name static inline void
update_pmo_igmp_tx_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)53*5113495bSYour Name update_pmo_igmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
54*5113495bSYour Name {}
55*5113495bSYour Name #endif
56*5113495bSYour Name #ifdef WLAN_FEATURE_ICMP_OFFLOAD
tgt_if_pmo_icmp_tx_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)57*5113495bSYour Name static void tgt_if_pmo_icmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
58*5113495bSYour Name {
59*5113495bSYour Name 	pmo_tx_ops->send_icmp_offload_req =
60*5113495bSYour Name 		target_if_pmo_send_icmp_offload_req;
61*5113495bSYour Name }
62*5113495bSYour Name #else
63*5113495bSYour Name static inline void
tgt_if_pmo_icmp_tx_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)64*5113495bSYour Name tgt_if_pmo_icmp_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
65*5113495bSYour Name {}
66*5113495bSYour Name #endif
target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops * pmo_tx_ops)67*5113495bSYour Name void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
68*5113495bSYour Name {
69*5113495bSYour Name 	if (!pmo_tx_ops) {
70*5113495bSYour Name 		target_if_err("pmo_tx_ops is null");
71*5113495bSYour Name 		return;
72*5113495bSYour Name 	}
73*5113495bSYour Name 
74*5113495bSYour Name 	pmo_tx_ops->send_arp_offload_req =
75*5113495bSYour Name 		target_if_pmo_send_arp_offload_req;
76*5113495bSYour Name 	pmo_tx_ops->send_conf_hw_filter_req =
77*5113495bSYour Name 		target_if_pmo_conf_hw_filter;
78*5113495bSYour Name 	pmo_tx_ops->send_ns_offload_req =
79*5113495bSYour Name 		target_if_pmo_send_ns_offload_req;
80*5113495bSYour Name 	pmo_tx_ops->send_enable_wow_wakeup_event_req =
81*5113495bSYour Name 		target_if_pmo_enable_wow_wakeup_event;
82*5113495bSYour Name 	pmo_tx_ops->send_disable_wow_wakeup_event_req =
83*5113495bSYour Name 		target_if_pmo_disable_wow_wakeup_event;
84*5113495bSYour Name 	pmo_tx_ops->send_add_wow_pattern =
85*5113495bSYour Name 		target_if_pmo_send_wow_patterns_to_fw;
86*5113495bSYour Name 	pmo_tx_ops->del_wow_pattern =
87*5113495bSYour Name 		target_if_pmo_del_wow_patterns_to_fw;
88*5113495bSYour Name 	pmo_tx_ops->send_enhance_mc_offload_req =
89*5113495bSYour Name 		target_if_pmo_send_enhance_mc_offload_req;
90*5113495bSYour Name 	pmo_tx_ops->send_set_mc_filter_req =
91*5113495bSYour Name 		target_if_pmo_set_mc_filter_req;
92*5113495bSYour Name 	pmo_tx_ops->send_clear_mc_filter_req =
93*5113495bSYour Name 		target_if_pmo_clear_mc_filter_req;
94*5113495bSYour Name 	pmo_tx_ops->get_multiple_mc_filter_support =
95*5113495bSYour Name 		target_if_pmo_get_multiple_mc_filter_support;
96*5113495bSYour Name 	pmo_tx_ops->send_set_multiple_mc_filter_req =
97*5113495bSYour Name 		target_if_pmo_set_multiple_mc_filter_req;
98*5113495bSYour Name 	pmo_tx_ops->send_clear_multiple_mc_filter_req =
99*5113495bSYour Name 		target_if_pmo_clear_multiple_mc_filter_req;
100*5113495bSYour Name 	pmo_tx_ops->send_ra_filter_req =
101*5113495bSYour Name 		target_if_pmo_send_ra_filter_req;
102*5113495bSYour Name 	pmo_tx_ops->send_gtk_offload_req =
103*5113495bSYour Name 		target_if_pmo_send_gtk_offload_req;
104*5113495bSYour Name 	pmo_tx_ops->send_get_gtk_rsp_cmd =
105*5113495bSYour Name 		target_if_pmo_send_gtk_response_req;
106*5113495bSYour Name 	pmo_tx_ops->send_action_frame_pattern_req =
107*5113495bSYour Name 		target_if_pmo_send_action_frame_patterns;
108*5113495bSYour Name 	pmo_tx_ops->send_lphb_enable =
109*5113495bSYour Name 		target_if_pmo_send_lphb_enable;
110*5113495bSYour Name 	pmo_tx_ops->send_lphb_tcp_params =
111*5113495bSYour Name 		target_if_pmo_send_lphb_tcp_params;
112*5113495bSYour Name 	pmo_tx_ops->send_lphb_tcp_filter_req =
113*5113495bSYour Name 		target_if_pmo_send_lphb_tcp_pkt_filter;
114*5113495bSYour Name 	pmo_tx_ops->send_lphb_upd_params =
115*5113495bSYour Name 		target_if_pmo_send_lphb_udp_params;
116*5113495bSYour Name 	pmo_tx_ops->send_lphb_udp_filter_req =
117*5113495bSYour Name 		target_if_pmo_send_lphb_udp_pkt_filter;
118*5113495bSYour Name 	pmo_tx_ops->send_vdev_param_update_req =
119*5113495bSYour Name 		target_if_pmo_send_vdev_update_param_req;
120*5113495bSYour Name 	pmo_tx_ops->send_vdev_sta_ps_param_req =
121*5113495bSYour Name 		target_if_pmo_send_vdev_ps_param_req;
122*5113495bSYour Name 	pmo_tx_ops->psoc_update_wow_bus_suspend =
123*5113495bSYour Name 		target_if_pmo_psoc_update_bus_suspend;
124*5113495bSYour Name 	pmo_tx_ops->psoc_get_host_credits =
125*5113495bSYour Name 		target_if_pmo_psoc_get_host_credits;
126*5113495bSYour Name 	update_pmo_igmp_tx_ops(pmo_tx_ops);
127*5113495bSYour Name 	pmo_tx_ops->psoc_get_pending_cmnds =
128*5113495bSYour Name 		target_if_pmo_psoc_get_pending_cmnds;
129*5113495bSYour Name 	pmo_tx_ops->update_target_suspend_flag =
130*5113495bSYour Name 		target_if_pmo_update_target_suspend_flag;
131*5113495bSYour Name 	pmo_tx_ops->update_target_suspend_acked_flag =
132*5113495bSYour Name 		target_if_pmo_update_target_suspend_acked_flag;
133*5113495bSYour Name 	pmo_tx_ops->is_target_suspended =
134*5113495bSYour Name 		target_if_pmo_is_target_suspended;
135*5113495bSYour Name 	pmo_tx_ops->psoc_send_wow_enable_req =
136*5113495bSYour Name 		target_if_pmo_psoc_send_wow_enable_req;
137*5113495bSYour Name 	pmo_tx_ops->psoc_send_supend_req =
138*5113495bSYour Name 		target_if_pmo_psoc_send_suspend_req;
139*5113495bSYour Name 	pmo_tx_ops->psoc_set_runtime_pm_in_progress =
140*5113495bSYour Name 		target_if_pmo_set_runtime_pm_in_progress;
141*5113495bSYour Name 	pmo_tx_ops->psoc_get_runtime_pm_in_progress =
142*5113495bSYour Name 		target_if_pmo_get_runtime_pm_in_progress;
143*5113495bSYour Name 	pmo_tx_ops->psoc_send_host_wakeup_ind =
144*5113495bSYour Name 		target_if_pmo_psoc_send_host_wakeup_ind;
145*5113495bSYour Name 	pmo_tx_ops->psoc_send_target_resume_req =
146*5113495bSYour Name 		target_if_pmo_psoc_send_target_resume_req;
147*5113495bSYour Name 	pmo_tx_ops->psoc_send_d0wow_enable_req =
148*5113495bSYour Name 		target_if_pmo_psoc_send_d0wow_enable_req;
149*5113495bSYour Name 	pmo_tx_ops->psoc_send_d0wow_disable_req =
150*5113495bSYour Name 		target_if_pmo_psoc_send_d0wow_disable_req;
151*5113495bSYour Name 	pmo_tx_ops->psoc_send_idle_roam_suspend_mode =
152*5113495bSYour Name 		target_if_pmo_psoc_send_idle_monitor_cmd;
153*5113495bSYour Name 	tgt_if_pmo_reg_pkt_filter_ops(pmo_tx_ops);
154*5113495bSYour Name 	tgt_if_pmo_icmp_tx_ops(pmo_tx_ops);
155*5113495bSYour Name 	pmo_tx_ops->psoc_set_wow_enable_ack_failed =
156*5113495bSYour Name 		target_if_pmo_set_wow_enable_ack_failed;
157*5113495bSYour Name 
158*5113495bSYour Name }
159*5113495bSYour Name 
160