xref: /wlan-driver/qcacld-3.0/components/target_if/connection_mgr/inc/target_if_cm_roam_event.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020-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 any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /**
19  * DOC: This file contains definitions for target_if
20  * roaming events.
21  */
22 
23 #ifndef TARGET_IF_CM_ROAM_EVENT_H__
24 #define TARGET_IF_CM_ROAM_EVENT_H__
25 
26 #include "qdf_types.h"
27 #include "wlan_objmgr_psoc_obj.h"
28 #include "wlan_objmgr_pdev_obj.h"
29 #include "wlan_objmgr_vdev_obj.h"
30 #include "wlan_cm_roam_public_struct.h"
31 #include <target_if.h>
32 
33 /**
34  * target_if_cm_get_roam_rx_ops() - Get CM roam rx ops registered
35  * @psoc: pointer to psoc object
36  *
37  * Return: roam rx ops of connection mgr
38  */
39 struct wlan_cm_roam_rx_ops *
40 target_if_cm_get_roam_rx_ops(struct wlan_objmgr_psoc *psoc);
41 
42 /**
43  * target_if_cm_roam_register_rx_ops  - Target IF API to register roam
44  * related rx op.
45  * @rx_ops: Pointer to rx ops fp struct
46  *
47  * Return: none
48  */
49 void
50 target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops);
51 
52 /**
53  * target_if_cm_roam_event() - Target IF handler for roam events
54  * @scn: target handle
55  * @event: event buffer
56  * @len: event buffer length
57  *
58  * Return: int for success or error code
59  */
60 int target_if_cm_roam_event(ol_scn_t scn, uint8_t *event, uint32_t len);
61 
62 /**
63  * target_if_roam_register_common_events() - register common roam events
64  * of LFR2/3
65  * @psoc: pointer to psoc object
66  *
67  * Return: QDF_STATUS
68  */
69 QDF_STATUS
70 target_if_roam_register_common_events(struct wlan_objmgr_psoc *psoc);
71 
72 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
73 /**
74  * target_if_cm_roam_sync_event() - Target IF handler for roam sync events
75  * @scn: target handle
76  * @event: event buffer
77  * @len: event buffer length
78  *
79  * Return: int for success or error code
80  */
81 int target_if_cm_roam_sync_event(ol_scn_t scn, uint8_t *event,
82 				 uint32_t len);
83 
84 /**
85  * target_if_cm_roam_sync_frame_event() - Target IF handler for
86  * roam sync frame events
87  * @scn: target handle
88  * @event: event buffer
89  * @len: event buffer length
90  *
91  * Return: int for success or error code
92  */
93 int
94 target_if_cm_roam_sync_frame_event(ol_scn_t scn,
95 				   uint8_t *event,
96 				   uint32_t len);
97 
98 /**
99  * target_if_cm_roam_stats_event() - Target IF handler for roam stats event
100  * @scn: target handle
101  * @event: event buffer
102  * @len: event buffer length
103  *
104  * Return: int for success or error code
105  */
106 int
107 target_if_cm_roam_stats_event(ol_scn_t scn, uint8_t *event, uint32_t len);
108 
109 /**
110  * target_if_cm_roam_auth_offload_event - auth roam offload event handler
111  * @scn: target handle
112  * @event: event buffer
113  * @len: event buffer length
114  *
115  * Return: int for success or error code
116  */
117 int
118 target_if_cm_roam_auth_offload_event(ol_scn_t scn, uint8_t *event,
119 				     uint32_t len);
120 
121 /**
122  * target_if_roam_offload_register_events() - register roam offload events
123  * @psoc: pointer to psoc object
124  *
125  * Return: QDF_STATUS
126  */
127 QDF_STATUS
128 target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc);
129 
130 /**
131  * target_if_cm_roam_vdev_disconnect_event_handler - vdev disconnect evt handler
132  * @scn: target handle
133  * @event: event buffer
134  * @len: event buffer length
135  *
136  * Return: int for success or error code
137  */
138 int
139 target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
140 						uint32_t len);
141 
142 /**
143  * target_if_cm_roam_scan_chan_list_event_handler - roam scan ch evt handler
144  * @scn: target handle
145  * @event: event buffer
146  * @len: event buffer length
147  *
148  * Return: int for success or error code
149  */
150 int
151 target_if_cm_roam_scan_chan_list_event_handler(ol_scn_t scn, uint8_t *event,
152 					       uint32_t len);
153 
154 /**
155  * target_if_pmkid_request_event_handler - pmkid request event handler
156  * @scn: target handle
157  * @event: event buffer
158  * @len: event buffer length
159  *
160  * Return: int for success or error code
161  */
162 int
163 target_if_pmkid_request_event_handler(ol_scn_t scn, uint8_t *event,
164 				      uint32_t len);
165 
166 /**
167  * target_if_roam_frame_event_handler - Target IF API to receive
168  * Beacon/probe for the roaming candidate.
169  * @scn: target handle
170  * @event: event buffer
171  * @len: event buffer length
172  *
173  * Return: int for success or error code
174  */
175 int
176 target_if_roam_frame_event_handler(ol_scn_t scn, uint8_t *event,
177 				   uint32_t len);
178 #else /* WLAN_FEATURE_ROAM_OFFLOAD */
179 static inline
180 QDF_STATUS
target_if_roam_offload_register_events(struct wlan_objmgr_psoc * psoc)181 target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc)
182 {
183 	return QDF_STATUS_E_NOSUPPORT;
184 }
185 
186 static inline int
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn,uint8_t * event,uint32_t len)187 target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
188 						uint32_t len)
189 {
190 	return 0;
191 }
192 
193 static inline int
target_if_cm_roam_scan_chan_list_event_handler(ol_scn_t scn,uint8_t * event,uint32_t len)194 target_if_cm_roam_scan_chan_list_event_handler(ol_scn_t scn, uint8_t *event,
195 					       uint32_t len)
196 {
197 	return 0;
198 }
199 
200 static inline int
target_if_pmkid_request_event_handler(ol_scn_t scn,uint8_t * event,uint32_t len)201 target_if_pmkid_request_event_handler(ol_scn_t scn, uint8_t *event,
202 				      uint32_t len)
203 {
204 	return 0;
205 }
206 
207 static inline int
target_if_roam_frame_event_handler(ol_scn_t scn,uint8_t * event,uint32_t len)208 target_if_roam_frame_event_handler(ol_scn_t scn, uint8_t *event,
209 				   uint32_t len)
210 {
211 	return 0;
212 }
213 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
214 
215 #ifdef WLAN_VENDOR_HANDOFF_CONTROL
216 /**
217  * target_if_get_roam_vendor_control_param_event_handler - event handler for
218  * vendor control params event
219  * @scn: target handle
220  * @event: event buffer
221  * @len: event buffer length
222  *
223  * Return: int for success or error code
224  */
225 int target_if_get_roam_vendor_control_param_event_handler(ol_scn_t scn,
226 							  uint8_t *event,
227 							  uint32_t len);
228 #else
229 static inline int
target_if_get_roam_vendor_control_param_event_handler(ol_scn_t scn,uint8_t * event,uint32_t len)230 target_if_get_roam_vendor_control_param_event_handler(ol_scn_t scn,
231 						      uint8_t *event,
232 						      uint32_t len)
233 {
234 	return 0;
235 }
236 #endif
237 #endif
238