xref: /wlan-driver/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_roam_sm.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 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: wlan_cm_roam_sm.h
20  *
21  * This header file maintain structures required for connection mgr roam sm
22  */
23 
24 #ifndef __WLAN_CM_ROAM_SM_H__
25 #define __WLAN_CM_ROAM_SM_H__
26 
27 #include "wlan_cm_roam.h"
28 
29 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
30 /**
31  * cm_state_roaming_entry() - Entry API for roaming state for
32  * connection mgr
33  * @ctx: connection manager ctx
34  *
35  * API to perform operations on moving to roaming state
36  *
37  * Return: void
38  */
39 void cm_state_roaming_entry(void *ctx);
40 
41 /**
42  * cm_state_roaming_exit() - Exit API for roaming state for connection mgr
43  * @ctx: connection manager ctx
44  *
45  * API to perform operations on exiting from roaming state
46  *
47  * Return: void
48  */
49 void cm_state_roaming_exit(void *ctx);
50 
51 /**
52  * cm_state_roaming_event() - Roaming State event handler for
53  * connection mgr
54  * @ctx: connection manager ctx
55  * @event: event to handle
56  * @data_len: event data len
57  * @data:event data
58  *
59  * API to handle events in roaming state
60  *
61  * Return: bool
62  */
63 bool cm_state_roaming_event(void *ctx, uint16_t event, uint16_t data_len,
64 			    void *data);
65 #else
cm_state_roaming_entry(void * ctx)66 static inline void cm_state_roaming_entry(void *ctx) {}
67 
cm_state_roaming_exit(void * ctx)68 static inline void cm_state_roaming_exit(void *ctx) {}
69 
cm_state_roaming_event(void * ctx,uint16_t event,uint16_t data_len,void * data)70 static inline bool cm_state_roaming_event(void *ctx, uint16_t event,
71 					  uint16_t data_len, void *data)
72 {
73 	return true;
74 }
75 #endif
76 
77 #if defined(WLAN_FEATURE_HOST_ROAM)
78 /**
79  * cm_subst_preauth_entry() - Entry API for preauth sub-state for
80  * connection mgr
81  * @ctx: connection manager ctx
82  *
83  * API to perform operations on moving to preauth sub-state
84  *
85  * Return: void
86  */
87 void cm_subst_preauth_entry(void *ctx);
88 
89 /**
90  * cm_subst_preauth_exit() - Exit API for preauth sub-state for
91  * connection mgr
92  * @ctx: connection manager ctx
93  *
94  * API to perform operations on exiting from preauth sub-state
95  *
96  * Return: void
97  */
98 void cm_subst_preauth_exit(void *ctx);
99 
100 /**
101  * cm_subst_preauth_event() - Preauth sub-state event handler for
102  * connection mgr
103  * @ctx: connection manager ctx
104  * @event: event to handle
105  * @data_len: event data len
106  * @data:event data
107  *
108  * API to handle events in preauth sub-state
109  *
110  * Return: bool
111  */
112 bool cm_subst_preauth_event(void *ctx, uint16_t event,
113 			    uint16_t data_len, void *data);
114 #else
115 
cm_subst_preauth_entry(void * ctx)116 static inline void cm_subst_preauth_entry(void *ctx) {}
117 
cm_subst_preauth_exit(void * ctx)118 static inline void cm_subst_preauth_exit(void *ctx) {}
119 
cm_subst_preauth_event(void * ctx,uint16_t event,uint16_t data_len,void * data)120 static inline bool cm_subst_preauth_event(void *ctx, uint16_t event,
121 					  uint16_t data_len, void *data)
122 {
123 	return true;
124 }
125 #endif /* WLAN_FEATURE_HOST_ROAM && WLAN_FEATURE_PREAUTH_ENABLE */
126 
127 #ifdef WLAN_FEATURE_HOST_ROAM
128 /**
129  * cm_subst_reassoc_entry() - Entry API for reassoc sub-state for
130  * connection mgr
131  * @ctx: connection manager ctx
132  *
133  * API to perform operations on moving to reassoc sub-state
134  *
135  * Return: void
136  */
137 void cm_subst_reassoc_entry(void *ctx);
138 
139 /**
140  * cm_subst_reassoc_exit() - Exit API for reassoc sub-state for
141  * connection mgr
142  * @ctx: connection manager ctx
143  *
144  * API to perform operations on exiting from reassoc sub-state
145  *
146  * Return: void
147  */
148 void cm_subst_reassoc_exit(void *ctx);
149 
150 /**
151  * cm_subst_reassoc_event() - Reassoc sub-state event handler for
152  * connection mgr
153  * @ctx: connection manager ctx
154  * @event: event to handle
155  * @data_len: event data len
156  * @data:event data
157  *
158  * API to handle events in preauth sub-state
159  *
160  * Return: bool
161  */
162 bool cm_subst_reassoc_event(void *ctx, uint16_t event, uint16_t data_len,
163 			    void *data);
164 #else
165 
cm_subst_reassoc_entry(void * ctx)166 static inline void cm_subst_reassoc_entry(void *ctx) {}
cm_subst_reassoc_exit(void * ctx)167 static inline void cm_subst_reassoc_exit(void *ctx) {}
168 
169 static inline
cm_subst_reassoc_event(void * ctx,uint16_t event,uint16_t data_len,void * data)170 bool cm_subst_reassoc_event(void *ctx, uint16_t event, uint16_t data_len,
171 			    void *data)
172 {
173 	return true;
174 }
175 
176 #endif /* WLAN_FEATURE_HOST_ROAM */
177 
178 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
179 
180 /**
181  * cm_subst_roam_start_entry() - Entry API for roam start sub-state for
182  * connection mgr
183  * @ctx: connection manager ctx
184  *
185  * API to perform operations on moving to roam start sub-state
186  *
187  * Return: void
188  */
189 void cm_subst_roam_start_entry(void *ctx);
190 
191 /**
192  * cm_subst_roam_start_exit() - Exit API for roam start sub-state for
193  * connection mgr
194  * @ctx: connection manager ctx
195  *
196  * API to perform operations on exiting from roam start sub-state
197  *
198  * Return: void
199  */
200 void cm_subst_roam_start_exit(void *ctx);
201 
202 /**
203  * cm_subst_roam_start_event() - Roam start sub-state event handler for
204  * connection mgr
205  * @ctx: connection manager ctx
206  * @event: event to handle
207  * @data_len: event data len
208  * @data:event data
209  *
210  * API to handle events in roam start sub-state
211  *
212  * Return: bool
213  */
214 bool cm_subst_roam_start_event(void *ctx, uint16_t event, uint16_t data_len,
215 			       void *data);
216 
217 /**
218  * cm_subst_roam_sync_entry() - Entry API for roam sync sub-state for
219  * connection mgr
220  * @ctx: connection manager ctx
221  *
222  * API to perform operations on moving to roam sync sub-state
223  *
224  * Return: void
225  */
226 void cm_subst_roam_sync_entry(void *ctx);
227 
228 /**
229  * cm_subst_roam_sync_exit() - Exit API for roam sync sub-state for
230  * connection mgr
231  * @ctx: connection manager ctx
232  *
233  * API to perform operations on exiting from roam sync sub-state
234  *
235  * Return: void
236  */
237 void cm_subst_roam_sync_exit(void *ctx);
238 
239 /**
240  * cm_subst_roam_sync_event() - Roam sync sub-state event handler for
241  * connection mgr
242  * @ctx: connection manager ctx
243  * @event: event to handle
244  * @data_len: event data len
245  * @data:event data
246  *
247  * API to handle events in roam sync sub-state
248  *
249  * Return: bool
250  */
251 bool cm_subst_roam_sync_event(void *ctx, uint16_t event, uint16_t data_len,
252 			      void *data);
253 #else
254 
cm_subst_roam_start_entry(void * ctx)255 static inline void cm_subst_roam_start_entry(void *ctx) {}
256 
cm_subst_roam_start_exit(void * ctx)257 static inline void cm_subst_roam_start_exit(void *ctx) {}
258 
259 static inline
cm_subst_roam_start_event(void * ctx,uint16_t event,uint16_t data_len,void * data)260 bool cm_subst_roam_start_event(void *ctx, uint16_t event, uint16_t data_len,
261 			       void *data)
262 {
263 	return true;
264 }
265 
cm_subst_roam_sync_entry(void * ctx)266 static inline void cm_subst_roam_sync_entry(void *ctx) {}
267 
cm_subst_roam_sync_exit(void * ctx)268 static inline void cm_subst_roam_sync_exit(void *ctx) {}
269 
270 static inline
cm_subst_roam_sync_event(void * ctx,uint16_t event,uint16_t data_len,void * data)271 bool cm_subst_roam_sync_event(void *ctx, uint16_t event, uint16_t data_len,
272 			      void *data)
273 {
274 	return true;
275 }
276 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
277 #endif /* __WLAN_CM_ROAM_SM_H__ */
278