1 /* 2 * Copyright (c) 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 mlme_cm_state_roaming_entry(void *ctx) 26 { 27 struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 28 29 mlme_cm_sm_state_update(cm_ctx, WLAN_CM_S_ROAMING, WLAN_CM_SS_IDLE); 30 } 31 32 void mlme_cm_state_roaming_exit(void *ctx) 33 { 34 } 35 36 bool mlme_cm_state_roaming_event(void *ctx, uint16_t event, 37 uint16_t event_data_len, 38 void *event_data) 39 { 40 // struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 41 bool status; 42 43 switch (event) { 44 default: 45 status = false; 46 break; 47 } 48 49 return status; 50 } 51 52 #ifdef WLAN_FEATURE_HOST_ROAM 53 #ifdef WLAN_FEATURE_PREAUTH_ENABLE 54 void mlme_cm_subst_preauth_entry(void *ctx) 55 { 56 struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 57 58 if (mlme_cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING) 59 QDF_BUG(0); 60 61 mlme_cm_set_substate(cm_ctx, WLAN_CM_SS_PREAUTH); 62 } 63 64 void mlme_cm_subst_preauth_exit(void *ctx) 65 { 66 } 67 68 bool mlme_cm_subst_preauth_event(void *ctx, uint16_t event, 69 uint16_t event_data_len, 70 void *event_data) 71 { 72 // struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 73 bool status; 74 75 switch (event) { 76 default: 77 status = false; 78 break; 79 } 80 81 return status; 82 } 83 84 #endif /* WLAN_FEATURE_PREAUTH_ENABLE */ 85 86 void mlme_cm_subst_reassoc_entry(void *ctx) 87 { 88 struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 89 90 if (mlme_cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING) 91 QDF_BUG(0); 92 93 mlme_cm_set_substate(cm_ctx, WLAN_CM_SS_REASSOC); 94 } 95 96 void mlme_cm_subst_reassoc_exit(void *ctx) 97 { 98 } 99 100 bool mlme_cm_subst_reassoc_event(void *ctx, uint16_t event, 101 uint16_t event_data_len, 102 void *event_data) 103 { 104 // struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 105 bool status; 106 107 switch (event) { 108 default: 109 status = false; 110 break; 111 } 112 113 return status; 114 } 115 116 #endif /* WLAN_FEATURE_HOST_ROAM */ 117 118 #ifdef WLAN_FEATURE_ROAM_OFFLOAD 119 void mlme_cm_subst_roam_start_entry(void *ctx) 120 { 121 struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 122 123 if (mlme_cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING) 124 QDF_BUG(0); 125 126 mlme_cm_set_substate(cm_ctx, WLAN_CM_SS_ROAM_STARTED); 127 } 128 129 void mlme_cm_subst_roam_start_exit(void *ctx) 130 { 131 } 132 133 bool mlme_cm_subst_roam_start_event(void *ctx, uint16_t event, 134 uint16_t event_data_len, 135 void *event_data) 136 { 137 // struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 138 bool status; 139 140 switch (event) { 141 default: 142 status = false; 143 break; 144 } 145 146 return status; 147 } 148 149 void mlme_cm_subst_roam_sync_entry(void *ctx) 150 { 151 struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 152 153 if (mlme_cm_get_state(cm_ctx) != WLAN_CM_S_ROAMING) 154 QDF_BUG(0); 155 156 mlme_cm_set_substate(cm_ctx, WLAN_CM_SS_ROAM_SYNC); 157 } 158 159 void mlme_cm_subst_roam_sync_exit(void *ctx) 160 { 161 } 162 163 bool mlme_cm_subst_roam_sync_event(void *ctx, uint16_t event, 164 uint16_t event_data_len, 165 void *event_data) 166 { 167 // struct cnx_mgr *cm_ctx = (struct cnx_mgr *)ctx; 168 bool status; 169 170 switch (event) { 171 default: 172 status = false; 173 break; 174 } 175 176 return status; 177 } 178 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ 179