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