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