xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_roam_sm.c (revision 97f44cd39e4ff816eaa1710279d28cf6b9e65ad9)
1 /*
2  * Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: Implements general SM framework for connection manager roaming sm
19  */
20 
21 #include "wlan_cm_main.h"
22 #include "wlan_cm_roam_sm.h"
23 #include "wlan_cm_sm.h"
24 
25 void cm_state_roaming_entry(void *ctx)
26 {
27 	struct cnx_mgr *cm_ctx = ctx;
28 
29 	cm_sm_state_update(cm_ctx, WLAN_CM_S_ROAMING, WLAN_CM_SS_IDLE);
30 }
31 
32 void cm_state_roaming_exit(void *ctx)
33 {
34 }
35 
36 bool cm_state_roaming_event(void *ctx, uint16_t event, uint16_t data_len,
37 			    void *data)
38 {
39 //	struct cnx_mgr *cm_ctx = ctx;
40 	bool status;
41 
42 	switch (event) {
43 	default:
44 		status = false;
45 		break;
46 	}
47 
48 	return status;
49 }
50 
51 #ifdef WLAN_FEATURE_HOST_ROAM
52 #ifdef WLAN_FEATURE_PREAUTH_ENABLE
53 void cm_subst_preauth_entry(void *ctx)
54 {
55 	struct cnx_mgr *cm_ctx = ctx;
56 
57 	if (cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING)
58 		QDF_BUG(0);
59 
60 	cm_set_substate(cm_ctx, WLAN_CM_SS_PREAUTH);
61 }
62 
63 void cm_subst_preauth_exit(void *ctx)
64 {
65 }
66 
67 bool cm_subst_preauth_event(void *ctx, uint16_t event, uint16_t data_len,
68 			    void *data)
69 {
70 //	struct cnx_mgr *cm_ctx = ctx;
71 	bool status;
72 
73 	switch (event) {
74 	default:
75 		status = false;
76 		break;
77 	}
78 
79 	return status;
80 }
81 
82 #endif /* WLAN_FEATURE_PREAUTH_ENABLE */
83 
84 void cm_subst_reassoc_entry(void *ctx)
85 {
86 	struct cnx_mgr *cm_ctx = ctx;
87 
88 	if (cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING)
89 		QDF_BUG(0);
90 
91 	cm_set_substate(cm_ctx, WLAN_CM_SS_REASSOC);
92 }
93 
94 void cm_subst_reassoc_exit(void *ctx)
95 {
96 }
97 
98 bool cm_subst_reassoc_event(void *ctx, uint16_t event, uint16_t data_len,
99 			    void *data)
100 {
101 //	struct cnx_mgr *cm_ctx = ctx;
102 	bool status;
103 
104 	switch (event) {
105 	default:
106 		status = false;
107 		break;
108 	}
109 
110 	return status;
111 }
112 
113 #endif /* WLAN_FEATURE_HOST_ROAM */
114 
115 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
116 void cm_subst_roam_start_entry(void *ctx)
117 {
118 	struct cnx_mgr *cm_ctx = ctx;
119 
120 	if (cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING)
121 		QDF_BUG(0);
122 
123 	cm_set_substate(cm_ctx, WLAN_CM_SS_ROAM_STARTED);
124 }
125 
126 void cm_subst_roam_start_exit(void *ctx)
127 {
128 }
129 
130 bool cm_subst_roam_start_event(void *ctx, uint16_t event, uint16_t data_len,
131 			       void *data)
132 {
133 //	struct cnx_mgr *cm_ctx = ctx;
134 	bool status;
135 
136 	switch (event) {
137 	default:
138 		status = false;
139 		break;
140 	}
141 
142 	return status;
143 }
144 
145 void cm_subst_roam_sync_entry(void *ctx)
146 {
147 	struct cnx_mgr *cm_ctx = ctx;
148 
149 	if (cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING)
150 		QDF_BUG(0);
151 
152 	cm_set_substate(cm_ctx, WLAN_CM_SS_ROAM_SYNC);
153 }
154 
155 void cm_subst_roam_sync_exit(void *ctx)
156 {
157 }
158 
159 bool cm_subst_roam_sync_event(void *ctx, uint16_t event, uint16_t data_len,
160 			      void *data)
161 {
162 //	struct cnx_mgr *cm_ctx = ctx;
163 	bool status;
164 
165 	switch (event) {
166 	default:
167 		status = false;
168 		break;
169 	}
170 
171 	return status;
172 }
173 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
174