Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Deepthi Gowri | 4480a3f | 2016-05-18 19:30:17 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | /** ------------------------------------------------------------------------- * |
| 29 | ------------------------------------------------------------------------- * |
| 30 | |
| 31 | |
| 32 | \file csrNeighborRoam.c |
| 33 | |
| 34 | Implementation for the simple roaming algorithm for 802.11r Fast transitions and Legacy roaming for Android platform. |
| 35 | |
| 36 | Copyright (C) 2010 Qualcomm, Incorporated |
| 37 | |
| 38 | |
| 39 | ========================================================================== */ |
| 40 | |
| 41 | /*=========================================================================== |
| 42 | |
| 43 | EDIT HISTORY FOR FILE |
| 44 | |
| 45 | |
| 46 | This section contains comments describing changes made to the module. |
| 47 | Notice that changes are listed in reverse chronological order. |
| 48 | |
| 49 | |
| 50 | |
| 51 | when who what, where, why |
| 52 | ---------- --- -------------------------------------------------------- |
| 53 | 08/01/10 Murali Created |
| 54 | |
| 55 | ===========================================================================*/ |
| 56 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
| 57 | #include "wlan_qct_wda.h" |
| 58 | #include "palApi.h" |
| 59 | #include "csrInsideApi.h" |
| 60 | #include "smsDebug.h" |
| 61 | #include "logDump.h" |
| 62 | #include "smeQosInternal.h" |
| 63 | #include "wlan_qct_tl.h" |
| 64 | #include "smeInside.h" |
| 65 | #include "vos_diag_core_event.h" |
| 66 | #include "vos_diag_core_log.h" |
| 67 | #include "csrApi.h" |
| 68 | #include "wlan_qct_tl.h" |
| 69 | #include "sme_Api.h" |
| 70 | #include "csrNeighborRoam.h" |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 71 | #include "macTrace.h" |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 72 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
| 73 | #include "csrEse.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 74 | #endif |
| 75 | |
| 76 | #define WLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG 1 |
| 77 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG |
| 78 | #define NEIGHBOR_ROAM_DEBUG smsLog |
| 79 | #else |
| 80 | #define NEIGHBOR_ROAM_DEBUG(x...) |
| 81 | #endif |
| 82 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 83 | static void csrNeighborRoamResetChannelInfo(tpCsrNeighborRoamChannelInfo rChInfo); |
| 84 | static void csrNeighborRoamResetCfgListChanScanControlInfo(tpAniSirGlobal pMac); |
| 85 | static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac); |
| 86 | static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac); |
| 87 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 88 | VOS_STATUS csrNeighborRoamNeighborLookupUPCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 89 | v_PVOID_t pUserCtxt, |
| 90 | v_S7_t avgRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 91 | VOS_STATUS csrNeighborRoamNeighborLookupDOWNCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 92 | v_PVOID_t pUserCtxt, |
| 93 | v_S7_t avgRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 94 | void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus); |
| 95 | eHalStatus csrRoamCopyConnectedProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pDstProfile ); |
| 96 | |
| 97 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 98 | static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac); |
| 99 | VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac); |
| 100 | #endif |
| 101 | |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 102 | v_U8_t *csrNeighborRoamStateToString(v_U8_t state) |
| 103 | { |
| 104 | switch(state) |
| 105 | { |
Daram Sudha | 1f7e0e9 | 2013-12-17 07:52:31 +0530 | [diff] [blame] | 106 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_CLOSED ); |
| 107 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_INIT ); |
| 108 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_CONNECTED ); |
| 109 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN ); |
| 110 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING ); |
| 111 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY ); |
| 112 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN ); |
| 113 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING ); |
| 114 | CASE_RETURN_STRING( eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE ); |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 115 | default: |
| 116 | return "eCSR_NEIGHBOR_ROAM_STATE_UNKNOWN"; |
| 117 | } |
| 118 | |
| 119 | } |
| 120 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 121 | /* State Transition macro */ |
| 122 | #define CSR_NEIGHBOR_ROAM_STATE_TRANSITION(newState)\ |
| 123 | {\ |
| 124 | pMac->roam.neighborRoamInfo.prevNeighborRoamState = pMac->roam.neighborRoamInfo.neighborRoamState;\ |
| 125 | pMac->roam.neighborRoamInfo.neighborRoamState = newState;\ |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 126 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, \ |
| 127 | FL("Neighbor Roam Transition from state %s ==> %s"), \ |
| 128 | csrNeighborRoamStateToString (pMac->roam.neighborRoamInfo.prevNeighborRoamState), \ |
| 129 | csrNeighborRoamStateToString (newState));\ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | /* --------------------------------------------------------------------------- |
| 133 | |
| 134 | \fn csrNeighborRoamFreeNeighborRoamBSSNode |
| 135 | |
| 136 | \brief This function frees all the internal pointers CSR NeighborRoam BSS Info |
| 137 | and also frees the node itself |
| 138 | |
| 139 | \param pMac - The handle returned by macOpen. |
| 140 | neighborRoamBSSNode - Neighbor Roam BSS Node to be freed |
| 141 | |
| 142 | \return VOID |
| 143 | |
| 144 | ---------------------------------------------------------------------------*/ |
| 145 | void csrNeighborRoamFreeNeighborRoamBSSNode(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo neighborRoamBSSNode) |
| 146 | { |
| 147 | if (neighborRoamBSSNode) |
| 148 | { |
| 149 | if (neighborRoamBSSNode->pBssDescription) |
| 150 | { |
| 151 | vos_mem_free(neighborRoamBSSNode->pBssDescription); |
| 152 | neighborRoamBSSNode->pBssDescription = NULL; |
| 153 | } |
| 154 | vos_mem_free(neighborRoamBSSNode); |
| 155 | neighborRoamBSSNode = NULL; |
| 156 | } |
| 157 | |
| 158 | return; |
| 159 | } |
| 160 | |
| 161 | /* --------------------------------------------------------------------------- |
| 162 | |
| 163 | \fn csrNeighborRoamRemoveRoamableAPListEntry |
| 164 | |
| 165 | \brief This function removes a given entry from the given list |
| 166 | |
| 167 | \param pMac - The handle returned by macOpen. |
| 168 | pList - The list from which the entry should be removed |
| 169 | pNeighborEntry - Neighbor Roam BSS Node to be removed |
| 170 | |
| 171 | \return TRUE if successfully removed, else FALSE |
| 172 | |
| 173 | ---------------------------------------------------------------------------*/ |
| 174 | tANI_BOOLEAN csrNeighborRoamRemoveRoamableAPListEntry(tpAniSirGlobal pMac, |
| 175 | tDblLinkList *pList, tpCsrNeighborRoamBSSInfo pNeighborEntry) |
| 176 | { |
| 177 | if(pList) |
| 178 | { |
| 179 | return csrLLRemoveEntry(pList, &pNeighborEntry->List, LL_ACCESS_LOCK); |
| 180 | } |
| 181 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 182 | smsLog(pMac, LOGE, FL("Removing neighbor BSS node from list failed. Current count = %d"), csrLLCount(pList)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 183 | |
| 184 | return eANI_BOOLEAN_FALSE; |
| 185 | } |
| 186 | |
| 187 | /* --------------------------------------------------------------------------- |
| 188 | |
| 189 | \fn csrNeighborRoamGetRoamableAPListNextEntry |
| 190 | |
| 191 | \brief Gets the entry next to passed entry. If NULL is passed, return the entry in the head of the list |
| 192 | |
| 193 | \param pMac - The handle returned by macOpen. |
| 194 | pList - The list from which the entry should be returned |
| 195 | pNeighborEntry - Neighbor Roam BSS Node whose next entry should be returned |
| 196 | |
| 197 | \return Neighbor Roam BSS Node to be returned |
| 198 | |
| 199 | ---------------------------------------------------------------------------*/ |
| 200 | tpCsrNeighborRoamBSSInfo csrNeighborRoamGetRoamableAPListNextEntry(tpAniSirGlobal pMac, |
| 201 | tDblLinkList *pList, tpCsrNeighborRoamBSSInfo pNeighborEntry) |
| 202 | { |
| 203 | tListElem *pEntry = NULL; |
| 204 | tpCsrNeighborRoamBSSInfo pResult = NULL; |
| 205 | |
| 206 | if(pList) |
| 207 | { |
| 208 | if(NULL == pNeighborEntry) |
| 209 | { |
| 210 | pEntry = csrLLPeekHead(pList, LL_ACCESS_LOCK); |
| 211 | } |
| 212 | else |
| 213 | { |
| 214 | pEntry = csrLLNext(pList, &pNeighborEntry->List, LL_ACCESS_LOCK); |
| 215 | } |
| 216 | if(pEntry) |
| 217 | { |
| 218 | pResult = GET_BASE_ADDR(pEntry, tCsrNeighborRoamBSSInfo, List); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | return pResult; |
| 223 | } |
| 224 | |
| 225 | /* --------------------------------------------------------------------------- |
| 226 | |
| 227 | \fn csrNeighborRoamFreeRoamableBSSList |
| 228 | |
| 229 | \brief Empties and frees all the nodes in the roamable AP list |
| 230 | |
| 231 | \param pMac - The handle returned by macOpen. |
| 232 | pList - Neighbor Roam BSS List to be emptied |
| 233 | |
| 234 | \return VOID |
| 235 | |
| 236 | ---------------------------------------------------------------------------*/ |
| 237 | void csrNeighborRoamFreeRoamableBSSList(tpAniSirGlobal pMac, tDblLinkList *pList) |
| 238 | { |
| 239 | tpCsrNeighborRoamBSSInfo pResult = NULL; |
| 240 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 241 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Emptying the BSS list. Current count = %d"), csrLLCount(pList)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | |
| 243 | /* Pick up the head, remove and free the node till the list becomes empty */ |
| 244 | while ((pResult = csrNeighborRoamGetRoamableAPListNextEntry(pMac, pList, NULL)) != NULL) |
| 245 | { |
| 246 | csrNeighborRoamRemoveRoamableAPListEntry(pMac, pList, pResult); |
| 247 | csrNeighborRoamFreeNeighborRoamBSSNode(pMac, pResult); |
| 248 | } |
| 249 | return; |
| 250 | } |
| 251 | |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 252 | static eHalStatus csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 253 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo) |
| 254 | { |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 255 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 256 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 257 | if ((pNeighborRoamInfo->is11rAssoc) |
| 258 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 259 | && !csrRoamIsRoamOffloadScanEnabled(pMac) |
| 260 | #endif |
| 261 | ) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 262 | { |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 263 | if ((eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) || |
| 264 | (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 265 | { |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 266 | status = csrNeighborRoamIssuePreauthReq(pMac); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 267 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_NONE; |
| 268 | vos_mem_set(&pNeighborRoamInfo->cfgRoambssId[0], |
| 269 | sizeof(pNeighborRoamInfo->cfgRoambssId), |
| 270 | 0xFF); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 271 | } |
| 272 | else |
| 273 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 274 | smsLog(pMac, LOGE, FL("11R Reassoc indication received in" |
| 275 | "unexpected state %s"), |
| 276 | macTraceGetNeighbourRoamState( |
| 277 | pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 278 | VOS_ASSERT(0); |
| 279 | } |
| 280 | } |
| 281 | else |
| 282 | #endif |
| 283 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 284 | #ifdef FEATURE_WLAN_ESE |
| 285 | if ((pNeighborRoamInfo->isESEAssoc) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 286 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 287 | && !csrRoamIsRoamOffloadScanEnabled(pMac) |
| 288 | #endif |
| 289 | ) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 290 | { |
| 291 | if (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) |
| 292 | { |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 293 | status = csrNeighborRoamIssuePreauthReq(pMac); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 294 | } |
| 295 | else |
| 296 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 297 | smsLog(pMac, LOGE, FL("ESE Reassoc indication received in unexpected state %s"), |
| 298 | macTraceGetNeighbourRoamState(pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 299 | VOS_ASSERT(0); |
| 300 | } |
| 301 | } |
| 302 | else |
| 303 | #endif |
| 304 | #ifdef FEATURE_WLAN_LFR |
| 305 | if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) |
| 306 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 307 | if ((eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) |
| 308 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 309 | || csrRoamIsRoamOffloadScanEnabled(pMac) || |
| 310 | (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 311 | #endif |
| 312 | ) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 313 | { |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 314 | status = csrNeighborRoamIssuePreauthReq(pMac); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 315 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_NONE; |
| 316 | vos_mem_set(&pNeighborRoamInfo->cfgRoambssId[0], |
| 317 | sizeof(pNeighborRoamInfo->cfgRoambssId), |
| 318 | 0xFF); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 319 | } |
| 320 | else |
| 321 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 322 | smsLog(pMac, LOGE, FL("LFR Reassoc indication received in" |
| 323 | "unexpected state %s"), |
| 324 | macTraceGetNeighbourRoamState( |
| 325 | pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 326 | VOS_ASSERT(0); |
| 327 | } |
| 328 | } |
| 329 | else |
| 330 | #endif |
| 331 | { |
| 332 | if (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN == pNeighborRoamInfo->neighborRoamState) |
| 333 | { |
| 334 | csrNeighborRoamRequestHandoff(pMac); |
| 335 | } |
| 336 | else |
| 337 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 338 | smsLog(pMac, LOGE, FL("Non-11R Reassoc indication received in" |
| 339 | "unexpected state %s or Roaming is disabled"), |
| 340 | macTraceGetNeighbourRoamState( |
| 341 | pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 342 | } |
| 343 | } |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 344 | return status; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 345 | } |
| 346 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 347 | VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_BOOL_t fastRoamEnabled) |
| 348 | { |
| 349 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 350 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 351 | |
| 352 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) |
| 353 | { |
| 354 | if (VOS_TRUE == fastRoamEnabled) |
| 355 | { |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 356 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 357 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 358 | { |
| 359 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); |
| 360 | } else { |
| 361 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 362 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), |
| 363 | pNeighborRoamInfo->currentNeighborLookupThreshold); |
| 364 | /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ |
| 365 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 366 | WLANTL_HO_THRESHOLD_DOWN, |
| 367 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 368 | VOS_MODULE_ID_SME, pMac); |
| 369 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 370 | { |
| 371 | //err msg |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 372 | smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vosStatus); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 373 | vosStatus = VOS_STATUS_E_FAILURE; |
| 374 | } |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 375 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 376 | } |
| 377 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 378 | } |
| 379 | else if (VOS_FALSE == fastRoamEnabled) |
| 380 | { |
| 381 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all events")); |
| 382 | /* De-register existing lookup UP/DOWN, Rssi indications */ |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 383 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 384 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 385 | { |
| 386 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, REASON_DISCONNECTED); |
| 387 | } else { |
| 388 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 389 | csrNeighborRoamDeregAllRssiIndication(pMac); |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 390 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 391 | } |
| 392 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 393 | } |
| 394 | } |
| 395 | else if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) |
| 396 | { |
| 397 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, Nothing to do")); |
| 398 | } |
| 399 | else |
| 400 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 401 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, |
| 402 | FL("Unexpected state %s, returning failure"), |
| 403 | macTraceGetNeighbourRoamState( |
| 404 | pNeighborRoamInfo->neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 405 | vosStatus = VOS_STATUS_E_FAILURE; |
| 406 | } |
| 407 | return vosStatus; |
| 408 | } |
| 409 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 410 | #ifdef FEATURE_WLAN_ESE |
| 411 | VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, const v_BOOL_t eseMode) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 412 | { |
| 413 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 414 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 415 | |
| 416 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) |
| 417 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 418 | if (VOS_TRUE == eseMode) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 419 | { |
| 420 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), |
| 421 | pNeighborRoamInfo->currentNeighborLookupThreshold); |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 422 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 423 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 424 | { |
| 425 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); |
| 426 | } else { |
| 427 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 428 | /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ |
| 429 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 430 | WLANTL_HO_THRESHOLD_DOWN, |
| 431 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 432 | VOS_MODULE_ID_SME, pMac); |
| 433 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 434 | { |
| 435 | //err msg |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 436 | smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vosStatus); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 437 | vosStatus = VOS_STATUS_E_FAILURE; |
| 438 | } |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 439 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 440 | } |
| 441 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 442 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 443 | else if (VOS_FALSE == eseMode) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 444 | { |
| 445 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all events")); |
| 446 | /* De-register existing lookup UP/DOWN, Rssi indications */ |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 447 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 448 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 449 | { |
| 450 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, REASON_DISCONNECTED); |
| 451 | } else { |
| 452 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 453 | csrNeighborRoamDeregAllRssiIndication(pMac); |
Varun Reddy Yeturu | 6d99ac8 | 2013-05-08 14:15:35 -0700 | [diff] [blame] | 454 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 455 | } |
| 456 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 457 | } |
| 458 | } |
| 459 | else if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) |
| 460 | { |
| 461 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, Nothing to do")); |
| 462 | } |
| 463 | else |
| 464 | { |
| 465 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d, returning failure"), pNeighborRoamInfo->neighborRoamState); |
| 466 | vosStatus = VOS_STATUS_E_FAILURE; |
| 467 | } |
| 468 | return vosStatus; |
| 469 | } |
| 470 | |
| 471 | #endif |
| 472 | |
| 473 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 474 | VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, v_U8_t neighborLookupRssiThreshold) |
| 475 | { |
| 476 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 477 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 478 | |
| 479 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) |
| 480 | { |
| 481 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); |
Srinivas Girigowda | 577ed65 | 2013-08-14 11:38:29 -0700 | [diff] [blame] | 482 | |
| 483 | pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold = neighborLookupRssiThreshold; |
| 484 | pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; |
| 485 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 486 | /* De-register existing lookup UP/DOWN, Rssi indications */ |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 487 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 488 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 489 | { |
Srinivas Girigowda | 577ed65 | 2013-08-14 11:38:29 -0700 | [diff] [blame] | 490 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_LOOKUP_THRESH_CHANGED); |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 491 | } |
| 492 | else |
| 493 | { |
| 494 | #endif |
| 495 | csrNeighborRoamDeregAllRssiIndication(pMac); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 496 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 497 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, |
| 498 | FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), |
| 499 | pNeighborRoamInfo->currentNeighborLookupThreshold); |
| 500 | /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ |
| 501 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, |
| 502 | (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 503 | WLANTL_HO_THRESHOLD_DOWN, |
| 504 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 505 | VOS_MODULE_ID_SME, pMac); |
| 506 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 507 | { |
| 508 | //err msg |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 509 | smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vosStatus); |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 510 | vosStatus = VOS_STATUS_E_FAILURE; |
| 511 | } |
| 512 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 513 | } |
| 514 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 515 | } |
| 516 | else if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) |
| 517 | { |
| 518 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, safe to set lookupRssi threshold")); |
| 519 | pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold = neighborLookupRssiThreshold; |
| 520 | pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; |
| 521 | } |
| 522 | else |
| 523 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 524 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, |
| 525 | FL("Unexpected state %s, returning failure"), |
| 526 | macTraceGetNeighbourRoamState(pNeighborRoamInfo->neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 527 | vosStatus = VOS_STATUS_E_FAILURE; |
| 528 | } |
| 529 | return vosStatus; |
| 530 | } |
| 531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 532 | /* --------------------------------------------------------------------------- |
| 533 | |
| 534 | \fn csrNeighborRoamReassocIndCallback |
| 535 | |
| 536 | \brief Reassoc callback invoked by TL on crossing the registered re-assoc threshold. |
| 537 | Directly triggere HO in case of non-11r association |
| 538 | In case of 11R association, triggers a pre-auth eventually followed by actual HO |
| 539 | |
| 540 | \param pAdapter - VOS Context |
| 541 | trafficStatus - UP/DOWN indication from TL |
| 542 | pUserCtxt - Parameter for callback registered during callback registration. Should be pMac |
| 543 | |
| 544 | \return VOID |
| 545 | |
| 546 | ---------------------------------------------------------------------------*/ |
| 547 | VOS_STATUS csrNeighborRoamReassocIndCallback(v_PVOID_t pAdapter, |
| 548 | v_U8_t trafficStatus, |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 549 | v_PVOID_t pUserCtxt, |
| 550 | v_S7_t avgRssi) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 551 | { |
| 552 | tpAniSirGlobal pMac = PMAC_STRUCT( pUserCtxt ); |
| 553 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 554 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 555 | |
| 556 | if (eSME_ROAM_TRIGGER_FAST_ROAM != pNeighborRoamInfo->cfgRoamEn) |
| 557 | { |
| 558 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering DOWN event reassoc callback with TL. Threshold RSSI = %d Reported RSSI = %d"), |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 559 | pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), |
| 560 | avgRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 561 | |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 562 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 563 | WLANTL_HO_THRESHOLD_DOWN, |
| 564 | csrNeighborRoamReassocIndCallback, |
| 565 | VOS_MODULE_ID_SME); |
| 566 | |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 567 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 568 | { |
| 569 | //err msg |
| 570 | smsLog(pMac, LOGW, FL(" Couldn't deregister csrNeighborRoamReassocIndCallback with TL: Status = %d"), vosStatus); |
| 571 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 572 | |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 573 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Rcvd reassoc notification-deregister UP indication. Threshold RSSI = %d Reported RSSI = %d"), |
| 574 | NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), avgRssi); |
| 575 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, |
| 576 | (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), |
| 577 | WLANTL_HO_THRESHOLD_UP, |
| 578 | csrNeighborRoamNeighborLookupUPCallback, |
| 579 | VOS_MODULE_ID_SME); |
| 580 | |
| 581 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 582 | { |
| 583 | //err msg |
| 584 | smsLog(pMac, LOGW, FL(" Couldn't deregister csrNeighborRoamNeighborLookupUPCallback with TL: Status = %d"), vosStatus); |
| 585 | } |
| 586 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 587 | /* We dont need to run this timer any more. */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 588 | vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 589 | vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 590 | |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 591 | csrNeighborRoamTriggerHandoff(pMac, pNeighborRoamInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 593 | return VOS_STATUS_SUCCESS; |
| 594 | } |
| 595 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 596 | /*CleanUP Routines*/ |
| 597 | static void csrNeighborRoamResetChannelInfo(tpCsrNeighborRoamChannelInfo rChInfo) |
| 598 | { |
| 599 | if ((rChInfo->IAPPNeighborListReceived == FALSE) && |
| 600 | (rChInfo->currentChannelListInfo.numOfChannels)) |
| 601 | { |
| 602 | rChInfo->currentChanIndex = CSR_NEIGHBOR_ROAM_INVALID_CHANNEL_INDEX; |
| 603 | rChInfo->currentChannelListInfo.numOfChannels = 0; |
| 604 | |
| 605 | if (rChInfo->currentChannelListInfo.ChannelList) |
| 606 | vos_mem_free(rChInfo->currentChannelListInfo.ChannelList); |
| 607 | |
| 608 | rChInfo->currentChannelListInfo.ChannelList = NULL; |
| 609 | rChInfo->chanListScanInProgress = eANI_BOOLEAN_FALSE; |
| 610 | } |
| 611 | else |
| 612 | { |
| 613 | rChInfo->currentChanIndex = 0; |
| 614 | rChInfo->chanListScanInProgress = eANI_BOOLEAN_TRUE; |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | static void csrNeighborRoamResetCfgListChanScanControlInfo(tpAniSirGlobal pMac) |
| 619 | { |
| 620 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 621 | |
| 622 | /* Stop neighbor scan timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 623 | vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 624 | |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 625 | /* Stop neighbor scan results refresh timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 626 | vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 627 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 628 | /* Stop empty scan results refresh timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 629 | vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 630 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 631 | /* Abort any ongoing scan */ |
| 632 | if (eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending) |
| 633 | { |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 634 | csrScanAbortMacScan(pMac, pNeighborRoamInfo->csrSessionId, |
| 635 | eCSR_SCAN_ABORT_DEFAULT); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 636 | } |
| 637 | pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; |
| 638 | |
| 639 | /* Reset roam channel list information */ |
| 640 | csrNeighborRoamResetChannelInfo(&pNeighborRoamInfo->roamChannelInfo); |
| 641 | } |
| 642 | |
| 643 | static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac) |
| 644 | { |
| 645 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 646 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 647 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 648 | pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 649 | /* Purge pre-auth fail list */ |
| 650 | csrNeighborRoamPurgePreauthFailedList(pMac); |
| 651 | #endif |
| 652 | |
| 653 | pNeighborRoamInfo->FTRoamInfo.preauthRspPending = eANI_BOOLEAN_FALSE; |
| 654 | pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; |
| 655 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 656 | /* Do not free up the preauth done list here */ |
| 657 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; |
| 658 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_FALSE; |
| 659 | pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; |
| 660 | vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 661 | #endif |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 662 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 663 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
Mukul Sharma | 9da30f5 | 2014-12-05 21:02:56 +0530 | [diff] [blame] | 664 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 665 | vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, sizeof(tCsrHandoffRequest)); |
| 666 | #endif |
| 667 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 668 | } |
| 669 | |
| 670 | static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac) |
| 671 | { |
| 672 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 673 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 674 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 675 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 676 | FL("Deregister neighbor lookup UP callback with TL. RSSI = %d"), |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 677 | NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 678 | |
| 679 | /* Deregister reassoc callback. Ignore return status */ |
| 680 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 681 | (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 682 | WLANTL_HO_THRESHOLD_UP, |
| 683 | csrNeighborRoamNeighborLookupUPCallback, |
| 684 | VOS_MODULE_ID_SME); |
| 685 | |
| 686 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 687 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 688 | smsLog(pMac, LOGW, |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 689 | FL("Couldn't deregister csrNeighborRoamNeighborLookupUPCallback " |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 690 | "with TL: Status = %d"), vosStatus); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 691 | } |
| 692 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 693 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 694 | FL("Deregistering reassoc DOWN callback with TL. RSSI = %d"), |
| 695 | pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); |
| 696 | |
| 697 | /* Deregister reassoc callback. Ignore return status */ |
| 698 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, |
| 699 | (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), |
| 700 | WLANTL_HO_THRESHOLD_DOWN, |
| 701 | csrNeighborRoamReassocIndCallback, |
| 702 | VOS_MODULE_ID_SME); |
| 703 | |
| 704 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 705 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 706 | smsLog(pMac, LOGW, |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 707 | FL(" Couldn't deregister csrNeighborRoamReassocIndCallback with " |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 708 | "TL: Status = %d"), vosStatus); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 709 | } |
| 710 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 711 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 712 | FL("Deregistering neighborLookup DOWN callback with TL. RSSI = %d"), |
| 713 | pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); |
| 714 | |
| 715 | /* Deregister neighbor lookup callback. Ignore return status */ |
| 716 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, |
| 717 | (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 718 | WLANTL_HO_THRESHOLD_DOWN, |
| 719 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 720 | VOS_MODULE_ID_SME); |
| 721 | |
| 722 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 723 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 724 | smsLog(pMac, LOGW, |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 725 | FL(" Couldn't deregister csrNeighborRoamNeighborLookupDOWNCallback " |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 726 | "with TL: Status = %d"), vosStatus); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | /* Reset thresholds only after deregistering DOWN event from TL */ |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 730 | pNeighborRoamInfo->currentNeighborLookupThreshold = |
| 731 | pNeighborRoamInfo->cfgParams.neighborLookupThreshold; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 732 | #ifdef FEATURE_WLAN_LFR |
| 733 | pNeighborRoamInfo->uEmptyScanCount = 0; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 734 | pNeighborRoamInfo->lookupDOWNRssi = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 735 | pNeighborRoamInfo->uScanMode = DEFAULT_SCAN; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 736 | #endif |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 737 | } |
| 738 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 739 | /* --------------------------------------------------------------------------- |
| 740 | |
| 741 | \fn csrNeighborRoamResetConnectedStateControlInfo |
| 742 | |
| 743 | \brief This function will reset the neighbor roam control info data structures. |
| 744 | This function should be invoked whenever we move to CONNECTED state from |
| 745 | any state other than INIT state |
| 746 | |
| 747 | \param pMac - The handle returned by macOpen. |
| 748 | |
| 749 | \return VOID |
| 750 | |
| 751 | ---------------------------------------------------------------------------*/ |
| 752 | void csrNeighborRoamResetConnectedStateControlInfo(tpAniSirGlobal pMac) |
| 753 | { |
| 754 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 755 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 756 | csrNeighborRoamResetChannelInfo(&pNeighborRoamInfo->roamChannelInfo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 757 | csrNeighborRoamFreeRoamableBSSList(pMac, &pNeighborRoamInfo->roamableAPList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 758 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 759 | /* We dont need to run this timer any more. */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 760 | vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 761 | vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 762 | |
| 763 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 764 | /* Do not free up the preauth done list here */ |
| 765 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; |
| 766 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_FALSE; |
| 767 | pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; |
| 768 | pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; |
| 769 | pNeighborRoamInfo->FTRoamInfo.preauthRspPending = 0; |
| 770 | vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 771 | #endif |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 772 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 773 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
Mukul Sharma | 9da30f5 | 2014-12-05 21:02:56 +0530 | [diff] [blame] | 774 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 775 | vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, sizeof(tCsrHandoffRequest)); |
| 776 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | } |
| 778 | |
Madan Mohan Koyyalamudi | 4f292df | 2012-09-18 17:27:40 -0700 | [diff] [blame] | 779 | void csrNeighborRoamResetReportScanStateControlInfo(tpAniSirGlobal pMac) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 780 | { |
| 781 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 782 | pNeighborRoamInfo->csrSessionId = CSR_SESSION_ID_INVALID; |
| 783 | vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 784 | #ifdef FEATURE_WLAN_ESE |
| 785 | pNeighborRoamInfo->isESEAssoc = eANI_BOOLEAN_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 786 | pNeighborRoamInfo->isVOAdmitted = eANI_BOOLEAN_FALSE; |
| 787 | pNeighborRoamInfo->MinQBssLoadRequired = 0; |
| 788 | #endif |
Madan Mohan Koyyalamudi | 595208a | 2012-10-05 12:48:38 -0700 | [diff] [blame] | 789 | |
| 790 | /* Stop scan refresh timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 791 | vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 792 | /* Stop empty scan results refresh timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 793 | vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 794 | /* Purge roamable AP list */ |
| 795 | csrNeighborRoamFreeRoamableBSSList(pMac, &pNeighborRoamInfo->roamableAPList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 796 | return; |
| 797 | } |
| 798 | |
Madan Mohan Koyyalamudi | 4f292df | 2012-09-18 17:27:40 -0700 | [diff] [blame] | 799 | /* --------------------------------------------------------------------------- |
| 800 | |
| 801 | \fn csrNeighborRoamResetInitStateControlInfo |
| 802 | |
| 803 | \brief This function will reset the neighbor roam control info data structures. |
| 804 | This function should be invoked whenever we move to CONNECTED state from |
| 805 | INIT state |
| 806 | |
| 807 | \param pMac - The handle returned by macOpen. |
| 808 | |
| 809 | \return VOID |
| 810 | |
| 811 | ---------------------------------------------------------------------------*/ |
| 812 | void csrNeighborRoamResetInitStateControlInfo(tpAniSirGlobal pMac) |
| 813 | { |
| 814 | csrNeighborRoamResetConnectedStateControlInfo(pMac); |
| 815 | |
| 816 | /* In addition to the above resets, we should clear off the curAPBssId/Session ID in the timers */ |
| 817 | csrNeighborRoamResetReportScanStateControlInfo(pMac); |
| 818 | } |
| 819 | |
| 820 | |
| 821 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 822 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 823 | /* --------------------------------------------------------------------------- |
| 824 | |
| 825 | \fn csrNeighborRoamBssIdScanFilter |
| 826 | |
| 827 | \brief This API is used to prepare a filter to obtain scan results when |
| 828 | we complete the scan in the REPORT_SCAN state after receiving a |
| 829 | valid neighbor report from AP. This filter includes BSSIDs received from |
| 830 | the neighbor report from the AP in addition to the other filter parameters |
| 831 | created from connected profile |
| 832 | |
| 833 | \param pMac - The handle returned by macOpen. |
| 834 | pScanFilter - Scan filter to be filled and returned |
| 835 | |
| 836 | \return eHAL_STATUS_SUCCESS on succesful filter creation, corresponding error |
| 837 | code otherwise |
| 838 | |
| 839 | ---------------------------------------------------------------------------*/ |
| 840 | static eHalStatus csrNeighborRoamBssIdScanFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter) |
| 841 | { |
| 842 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 843 | tANI_U8 i = 0; |
| 844 | |
| 845 | VOS_ASSERT(pScanFilter != NULL); |
Gopichand Nakkala | d5a904e | 2013-03-29 01:07:54 +0530 | [diff] [blame] | 846 | if (pScanFilter == NULL) |
| 847 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 848 | vos_mem_zero(pScanFilter, sizeof(tCsrScanResultFilter)); |
| 849 | |
| 850 | pScanFilter->BSSIDs.numOfBSSIDs = pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport; |
| 851 | pScanFilter->BSSIDs.bssid = vos_mem_malloc(sizeof(tSirMacAddr) * pScanFilter->BSSIDs.numOfBSSIDs); |
| 852 | if (NULL == pScanFilter->BSSIDs.bssid) |
| 853 | { |
| 854 | smsLog(pMac, LOGE, FL("Scan Filter BSSID mem alloc failed")); |
| 855 | return eHAL_STATUS_FAILED_ALLOC; |
| 856 | } |
| 857 | |
| 858 | vos_mem_zero(pScanFilter->BSSIDs.bssid, sizeof(tSirMacAddr) * pScanFilter->BSSIDs.numOfBSSIDs); |
| 859 | |
| 860 | /* Populate the BSSID from Neighbor BSS info received from neighbor report */ |
| 861 | for (i = 0; i < pScanFilter->BSSIDs.numOfBSSIDs; i++) |
| 862 | { |
| 863 | vos_mem_copy(&pScanFilter->BSSIDs.bssid[i], |
| 864 | pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo[i].neighborBssId, sizeof(tSirMacAddr)); |
| 865 | } |
| 866 | |
| 867 | /* Fill other general scan filter params */ |
| 868 | return csrNeighborRoamPrepareScanProfileFilter(pMac, pScanFilter); |
| 869 | } |
| 870 | |
| 871 | /* --------------------------------------------------------------------------- |
| 872 | |
| 873 | \fn csrNeighborRoamPurgePreauthFailList |
| 874 | |
| 875 | \brief This function empties the preauth fail list |
| 876 | |
| 877 | \param pMac - The handle returned by macOpen. |
| 878 | |
| 879 | \return VOID |
| 880 | |
| 881 | ---------------------------------------------------------------------------*/ |
| 882 | void csrNeighborRoamPurgePreauthFailList(tpAniSirGlobal pMac) |
| 883 | { |
| 884 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 885 | |
| 886 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Purging the preauth fail list")); |
| 887 | while (pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress) |
| 888 | { |
| 889 | vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress-1], |
| 890 | sizeof(tSirMacAddr)); |
| 891 | pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress--; |
| 892 | } |
| 893 | return; |
| 894 | } |
| 895 | |
| 896 | /* --------------------------------------------------------------------------- |
| 897 | |
| 898 | \fn csrNeighborRoamAddBssIdToPreauthFailList |
| 899 | |
| 900 | \brief This function adds the given BSSID to the Preauth fail list |
| 901 | |
| 902 | \param pMac - The handle returned by macOpen. |
| 903 | bssId - BSSID to be added to the preauth fail list |
| 904 | |
| 905 | \return eHAL_STATUS_SUCCESS on success, eHAL_STATUS_FAILURE otherwise |
| 906 | |
| 907 | ---------------------------------------------------------------------------*/ |
| 908 | eHalStatus csrNeighborRoamAddBssIdToPreauthFailList(tpAniSirGlobal pMac, tSirMacAddr bssId) |
| 909 | { |
| 910 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 911 | |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 912 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL(" Added BSSID "MAC_ADDRESS_STR" to Preauth failed list"), |
| 913 | MAC_ADDR_ARRAY(bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 914 | |
| 915 | |
| 916 | if ((pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress + 1) > |
| 917 | MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS) |
| 918 | { |
| 919 | smsLog(pMac, LOGE, FL("Preauth fail list already full.. Cannot add new one")); |
| 920 | return eHAL_STATUS_FAILURE; |
| 921 | } |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 922 | vos_mem_copy(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[ |
| 923 | pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress], |
| 924 | bssId, |
| 925 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 926 | pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress++; |
| 927 | |
| 928 | return eHAL_STATUS_SUCCESS; |
| 929 | } |
| 930 | |
| 931 | /* --------------------------------------------------------------------------- |
| 932 | |
| 933 | \fn csrNeighborRoamIsPreauthCandidate |
| 934 | |
| 935 | \brief This function checks whether the given MAC address is already |
| 936 | present in the preauth fail list and returns TRUE/FALSE accordingly |
| 937 | |
| 938 | \param pMac - The handle returned by macOpen. |
| 939 | |
| 940 | \return eANI_BOOLEAN_TRUE if preauth candidate, eANI_BOOLEAN_FALSE otherwise |
| 941 | |
| 942 | ---------------------------------------------------------------------------*/ |
| 943 | tANI_BOOLEAN csrNeighborRoamIsPreauthCandidate(tpAniSirGlobal pMac, tSirMacAddr bssId) |
| 944 | { |
| 945 | tANI_U8 i = 0; |
| 946 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 947 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 948 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 949 | if (csrRoamIsRoamOffloadScanEnabled(pMac)) |
| 950 | { |
| 951 | return eANI_BOOLEAN_TRUE; |
| 952 | } |
| 953 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 954 | if (0 == pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress) |
| 955 | return eANI_BOOLEAN_TRUE; |
| 956 | |
| 957 | for (i = 0; i < pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress; i++) |
| 958 | { |
| 959 | if (VOS_TRUE == vos_mem_compare(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[i], |
| 960 | bssId, sizeof(tSirMacAddr))) |
| 961 | { |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 962 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("BSSID "MAC_ADDRESS_STR" already present in preauth fail list"), |
| 963 | MAC_ADDR_ARRAY(bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 964 | return eANI_BOOLEAN_FALSE; |
| 965 | } |
| 966 | } |
| 967 | |
| 968 | return eANI_BOOLEAN_TRUE; |
| 969 | } |
| 970 | |
| 971 | /* --------------------------------------------------------------------------- |
| 972 | |
| 973 | \fn csrNeighborRoamIssuePreauthReq |
| 974 | |
| 975 | \brief This function issues preauth request to PE with the 1st AP entry in the |
| 976 | roamable AP list |
| 977 | |
| 978 | \param pMac - The handle returned by macOpen. |
| 979 | |
| 980 | \return eHAL_STATUS_SUCCESS on success, eHAL_STATUS_FAILURE otherwise |
| 981 | |
| 982 | ---------------------------------------------------------------------------*/ |
| 983 | static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac) |
| 984 | { |
| 985 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 986 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 987 | tpCsrNeighborRoamBSSInfo pNeighborBssNode; |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 988 | |
| 989 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 990 | tCsrRoamInfo *roamInfo; |
| 991 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 992 | |
| 993 | /* This must not be true here */ |
| 994 | VOS_ASSERT(pNeighborRoamInfo->FTRoamInfo.preauthRspPending == eANI_BOOLEAN_FALSE); |
| 995 | |
| 996 | /* Issue Preauth request to PE here */ |
| 997 | /* Need to issue the preauth request with the BSSID that is there in the head of the roamable AP list */ |
| 998 | /* Parameters that should be passed are BSSID, Channel number and the neighborScanPeriod(probably) */ |
| 999 | /* If roamableAPList gets empty, should transition to REPORT_SCAN state */ |
| 1000 | pNeighborBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->roamableAPList, NULL); |
| 1001 | |
| 1002 | if (NULL == pNeighborBssNode) |
| 1003 | { |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 1004 | smsLog(pMac, LOGW, FL("Roamable AP list is empty.. ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | return eHAL_STATUS_FAILURE; |
| 1006 | } |
| 1007 | else |
| 1008 | { |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1009 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 1010 | /* LFR metrics - pre-auth initiation metric. |
| 1011 | Send the event to supplicant that pre-auth was initiated */ |
| 1012 | roamInfo = vos_mem_malloc(sizeof(tCsrRoamInfo)); |
| 1013 | if (NULL == roamInfo) |
| 1014 | { |
| 1015 | smsLog(pMac, LOG1, FL("Memory allocation failed!")); |
| 1016 | } |
| 1017 | else |
| 1018 | { |
| 1019 | vos_mem_copy((void *)roamInfo->bssid, |
| 1020 | (void *)pNeighborBssNode->pBssDescription->bssId, |
| 1021 | sizeof(tCsrBssid)); |
| 1022 | csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, |
| 1023 | roamInfo, 0, eCSR_ROAM_PREAUTH_INIT_NOTIFY, 0); |
Mukul Sharma | bff8d72 | 2014-07-22 18:39:05 +0530 | [diff] [blame] | 1024 | vos_mem_free(roamInfo); |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1025 | } |
| 1026 | #endif |
| 1027 | |
Madan Mohan Koyyalamudi | 286b60e | 2012-10-11 12:59:07 -0700 | [diff] [blame] | 1028 | status = csrRoamEnqueuePreauth(pMac, pNeighborRoamInfo->csrSessionId, pNeighborBssNode->pBssDescription, |
| 1029 | eCsrPerformPreauth, eANI_BOOLEAN_TRUE); |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 1030 | |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1031 | smsLog(pMac, LOG1, FL("Before Pre-Auth: BSSID "MAC_ADDRESS_STR", Ch:%d"), |
| 1032 | MAC_ADDR_ARRAY(pNeighborBssNode->pBssDescription->bssId), |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 1033 | (int)pNeighborBssNode->pBssDescription->channelId); |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 1034 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1035 | if (eHAL_STATUS_SUCCESS != status) |
| 1036 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1037 | smsLog(pMac, LOGE, FL("Send Preauth request to PE failed with status %d"), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1038 | return status; |
| 1039 | } |
| 1040 | } |
| 1041 | |
| 1042 | pNeighborRoamInfo->FTRoamInfo.preauthRspPending = eANI_BOOLEAN_TRUE; |
| 1043 | |
| 1044 | /* Increment the preauth retry count */ |
| 1045 | pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries++; |
| 1046 | |
| 1047 | /* Transition the state to preauthenticating */ |
| 1048 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1049 | |
| 1050 | return status; |
| 1051 | } |
| 1052 | |
| 1053 | /* --------------------------------------------------------------------------- |
| 1054 | |
| 1055 | \fn csrNeighborRoamPreauthRspHandler |
| 1056 | |
| 1057 | \brief This function handle the Preauth response from PE |
| 1058 | Every preauth is allowed max 3 tries if it fails. If a bssid failed |
| 1059 | for more than MAX_TRIES, we will remove it from the list and try |
| 1060 | with the next node in the roamable AP list and add the BSSID to pre-auth failed |
| 1061 | list. If no more entries present in |
| 1062 | roamable AP list, transition to REPORT_SCAN state |
| 1063 | |
| 1064 | \param pMac - The handle returned by macOpen. |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1065 | limStatus - eSIR_SUCCESS/eSIR_FAILURE/eSIR_LIM_MAX_STA_REACHED_ERROR/ |
| 1066 | eSIT_LIM_AUTH_RSP_TIMEOUT status from PE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1067 | |
Madan Mohan Koyyalamudi | 7a579cc | 2012-10-21 11:25:39 -0700 | [diff] [blame] | 1068 | \return eHAL_STATUS_SUCCESS on success (i.e. pre-auth processed), |
| 1069 | eHAL_STATUS_FAILURE otherwise |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1070 | |
| 1071 | ---------------------------------------------------------------------------*/ |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1072 | eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus limStatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1073 | { |
| 1074 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 1075 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1076 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
Madan Mohan Koyyalamudi | 7a579cc | 2012-10-21 11:25:39 -0700 | [diff] [blame] | 1077 | eHalStatus preauthProcessed = eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | tpCsrNeighborRoamBSSInfo pPreauthRspNode = NULL; |
Abhishek Singh | 07e4a89 | 2015-11-23 11:29:57 +0530 | [diff] [blame] | 1079 | tCsrRoamSession *pSession; |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1080 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 1081 | tCsrRoamInfo *roamInfo; |
| 1082 | #endif |
| 1083 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 1084 | if (eANI_BOOLEAN_FALSE == pNeighborRoamInfo->FTRoamInfo.preauthRspPending) |
| 1085 | { |
| 1086 | |
| 1087 | /* This can happen when we disconnect immediately |
| 1088 | * after sending a pre-auth request. During processing |
| 1089 | * of the disconnect command, we would have reset |
| 1090 | * preauthRspPending and transitioned to INIT state. |
| 1091 | */ |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1092 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, |
| 1093 | FL("Unexpected pre-auth response in state %d"), |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 1094 | pNeighborRoamInfo->neighborRoamState); |
Madan Mohan Koyyalamudi | 7a579cc | 2012-10-21 11:25:39 -0700 | [diff] [blame] | 1095 | preauthProcessed = eHAL_STATUS_FAILURE; |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 1096 | goto DEQ_PREAUTH; |
| 1097 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1098 | |
| 1099 | // We can receive it in these 2 states. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1100 | if ((pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING) && |
| 1101 | (pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN)) |
| 1102 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 1103 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, |
| 1104 | FL("Preauth response received in state %s"), |
| 1105 | macTraceGetNeighbourRoamState( |
| 1106 | pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | 7a579cc | 2012-10-21 11:25:39 -0700 | [diff] [blame] | 1107 | preauthProcessed = eHAL_STATUS_FAILURE; |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 1108 | goto DEQ_PREAUTH; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1109 | } |
| 1110 | |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1111 | pNeighborRoamInfo->FTRoamInfo.preauthRspPending = eANI_BOOLEAN_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1112 | |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1113 | if (eSIR_SUCCESS == limStatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1114 | { |
| 1115 | pPreauthRspNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->roamableAPList, NULL); |
| 1116 | } |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1117 | if ((eSIR_SUCCESS == limStatus) && (NULL != pPreauthRspNode)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1118 | { |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1119 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Preauth completed successfully after %d tries"), pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1120 | |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1121 | smsLog(pMac, LOG1, FL("After Pre-Auth: BSSID "MAC_ADDRESS_STR", Ch:%d"), |
| 1122 | MAC_ADDR_ARRAY(pPreauthRspNode->pBssDescription->bssId), |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 1123 | (int)pPreauthRspNode->pBssDescription->channelId); |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 1124 | |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1125 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 1126 | /* LFR metrics - pre-auth completion metric. |
| 1127 | Send the event to supplicant that pre-auth successfully completed */ |
| 1128 | roamInfo = vos_mem_malloc(sizeof(tCsrRoamInfo)); |
| 1129 | if (NULL == roamInfo) |
| 1130 | { |
| 1131 | smsLog(pMac, LOG1, FL("Memory allocation failed!")); |
| 1132 | } |
| 1133 | else |
| 1134 | { |
| 1135 | vos_mem_copy((void *)roamInfo->bssid, |
| 1136 | (void *)pPreauthRspNode->pBssDescription->bssId, |
| 1137 | sizeof(tCsrBssid)); |
| 1138 | csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, |
| 1139 | roamInfo, 0, eCSR_ROAM_PREAUTH_STATUS_SUCCESS, 0); |
Mukul Sharma | bff8d72 | 2014-07-22 18:39:05 +0530 | [diff] [blame] | 1140 | vos_mem_free(roamInfo); |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1141 | } |
| 1142 | #endif |
| 1143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1144 | /* Preauth competer successfully. Insert the preauthenticated node to tail of preAuthDoneList */ |
| 1145 | csrNeighborRoamRemoveRoamableAPListEntry(pMac, &pNeighborRoamInfo->roamableAPList, pPreauthRspNode); |
| 1146 | csrLLInsertTail(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, &pPreauthRspNode->List, LL_ACCESS_LOCK); |
| 1147 | |
| 1148 | /* Pre-auth completed successfully. Transition to PREAUTH Done state */ |
| 1149 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) |
| 1150 | pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; |
| 1151 | |
| 1152 | /* The caller of this function would start a timer and by the time it expires, supplicant should |
| 1153 | have provided the updated FTIEs to SME. So, when it expires, handoff will be triggered then */ |
| 1154 | } |
| 1155 | else |
| 1156 | { |
| 1157 | tpCsrNeighborRoamBSSInfo pNeighborBssNode = NULL; |
| 1158 | tListElem *pEntry; |
| 1159 | |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1160 | smsLog(pMac, LOGE, FL("Preauth failed retry number %d, status = 0x%x"), |
| 1161 | pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries, limStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1162 | |
| 1163 | /* Preauth failed. Add the bssId to the preAuth failed list MAC Address. Also remove the AP from roamable AP list */ |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 1164 | if ((pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries >= |
| 1165 | CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES) || |
| 1166 | (eSIR_LIM_MAX_STA_REACHED_ERROR == limStatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1167 | { |
| 1168 | /* We are going to remove the node as it fails for more than MAX tries. Reset this count to 0 */ |
| 1169 | pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; |
| 1170 | |
| 1171 | /* The one in the head of the list should be one with which we issued pre-auth and failed */ |
| 1172 | pEntry = csrLLRemoveHead(&pNeighborRoamInfo->roamableAPList, LL_ACCESS_LOCK); |
| 1173 | if(pEntry) |
| 1174 | { |
| 1175 | pNeighborBssNode = GET_BASE_ADDR(pEntry, tCsrNeighborRoamBSSInfo, List); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 1176 | /* Add the BSSID to pre-auth fail list if it is not requested by HDD */ |
| 1177 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1178 | if(!pNeighborRoamInfo->uOsRequestedHandoff) |
| 1179 | #endif |
| 1180 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1181 | status = csrNeighborRoamAddBssIdToPreauthFailList(pMac, pNeighborBssNode->pBssDescription->bssId); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 1182 | } |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1183 | |
| 1184 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 1185 | /* LFR metrics - pre-auth completion metric. Send the event |
| 1186 | to supplicant that pre-auth successfully completed */ |
| 1187 | roamInfo = vos_mem_malloc(sizeof(tCsrRoamInfo)); |
| 1188 | if (NULL == roamInfo) |
| 1189 | { |
| 1190 | smsLog(pMac, LOG1, FL("Memory allocation failed!")); |
| 1191 | } |
| 1192 | else |
| 1193 | { |
| 1194 | vos_mem_copy((void *)roamInfo->bssid, |
| 1195 | (void *)pNeighborBssNode->pBssDescription->bssId, |
| 1196 | sizeof(tCsrBssid)); |
| 1197 | csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, |
| 1198 | roamInfo, 0, eCSR_ROAM_PREAUTH_STATUS_FAILURE, 0); |
Mukul Sharma | bff8d72 | 2014-07-22 18:39:05 +0530 | [diff] [blame] | 1199 | vos_mem_free(roamInfo); |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 1200 | } |
| 1201 | #endif |
| 1202 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1203 | /* Now we can free this node */ |
| 1204 | csrNeighborRoamFreeNeighborRoamBSSNode(pMac, pNeighborBssNode); |
| 1205 | } |
| 1206 | } |
Abhishek Singh | 07e4a89 | 2015-11-23 11:29:57 +0530 | [diff] [blame] | 1207 | pSession = CSR_GET_SESSION(pMac, pNeighborRoamInfo->csrSessionId); |
| 1208 | if ((NULL != pSession) && pSession->abortConnection) |
| 1209 | { |
| 1210 | smsLog(pMac, LOGE, FL(" Deauth in progress Abort preauth")); |
| 1211 | goto abort_preauth; |
| 1212 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1213 | |
| 1214 | /* Issue preauth request for the same/next entry */ |
| 1215 | if (eHAL_STATUS_SUCCESS == csrNeighborRoamIssuePreauthReq(pMac)) |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 1216 | goto DEQ_PREAUTH; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1217 | |
Abhishek Singh | 07e4a89 | 2015-11-23 11:29:57 +0530 | [diff] [blame] | 1218 | abort_preauth: |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1219 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1220 | if (csrRoamIsRoamOffloadScanEnabled(pMac)) |
Madan Mohan Koyyalamudi | 4450acc | 2012-11-15 17:24:31 -0800 | [diff] [blame] | 1221 | { |
Varun Reddy Yeturu | e3af428 | 2013-06-07 00:56:52 -0700 | [diff] [blame] | 1222 | if(pNeighborRoamInfo->uOsRequestedHandoff) |
| 1223 | { |
| 1224 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
| 1225 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_PREAUTH_FAILED_FOR_ALL); |
| 1226 | } |
Mukul Sharma | 9da30f5 | 2014-12-05 21:02:56 +0530 | [diff] [blame] | 1227 | else if(pNeighborRoamInfo->isForcedInitialRoamTo5GH) |
| 1228 | { |
| 1229 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 1230 | smsLog(pMac, LOGE, FL("Forced 5G roaming preauth got failed" |
| 1231 | "send RSO START cmd to fwr.")); |
| 1232 | csrRoamOffloadScan(pMac,ROAM_SCAN_OFFLOAD_START,REASON_CONNECT); |
Mukul Sharma | 9da30f5 | 2014-12-05 21:02:56 +0530 | [diff] [blame] | 1233 | } |
Varun Reddy Yeturu | e3af428 | 2013-06-07 00:56:52 -0700 | [diff] [blame] | 1234 | else |
| 1235 | { |
| 1236 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_PREAUTH_FAILED_FOR_ALL); |
| 1237 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1238 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); |
| 1239 | } else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1240 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1241 | #endif |
| 1242 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN); |
| 1243 | |
| 1244 | /* Register Neighbor Lookup threshold callback with TL for UP event now */ |
| 1245 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("No more pre-auth candidates-" |
| 1246 | "register UP indication with TL. RSSI = %d,"), NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); |
| 1247 | |
| 1248 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, |
| 1249 | (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), |
| 1250 | WLANTL_HO_THRESHOLD_UP, |
| 1251 | csrNeighborRoamNeighborLookupUPCallback, |
| 1252 | VOS_MODULE_ID_SME, pMac); |
| 1253 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 1254 | { |
| 1255 | //err msg |
| 1256 | smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupCallback UP event with TL: Status = %d"), status); |
| 1257 | } |
| 1258 | |
| 1259 | /* Start the neighbor results refresh timer and transition to REPORT_SCAN state to perform scan again */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 1260 | status = vos_timer_start(&pNeighborRoamInfo->neighborResultsRefreshTimer, |
| 1261 | pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod); |
| 1262 | if ( status != eHAL_STATUS_SUCCESS ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1263 | { |
| 1264 | smsLog(pMac, LOGE, FL("Neighbor results refresh timer start failed with status %d"), status); |
| 1265 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1266 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1267 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1268 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1269 | #endif |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 1270 | |
| 1271 | DEQ_PREAUTH: |
| 1272 | csrRoamDequeuePreauth(pMac); |
Madan Mohan Koyyalamudi | 7a579cc | 2012-10-21 11:25:39 -0700 | [diff] [blame] | 1273 | return preauthProcessed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1274 | } |
| 1275 | #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ |
| 1276 | |
| 1277 | /* --------------------------------------------------------------------------- |
| 1278 | |
| 1279 | \fn csrNeighborRoamPrepareScanProfileFilter |
| 1280 | |
| 1281 | \brief This function creates a scan filter based on the currently connected profile. |
| 1282 | Based on this filter, scan results are obtained |
| 1283 | |
| 1284 | \param pMac - The handle returned by macOpen. |
| 1285 | pScanFilter - Populated scan filter based on the connected profile |
| 1286 | |
| 1287 | \return eHAL_STATUS_SUCCESS on success, eHAL_STATUS_FAILURE otherwise |
| 1288 | |
| 1289 | ---------------------------------------------------------------------------*/ |
| 1290 | eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter) |
| 1291 | { |
| 1292 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 1293 | tANI_U8 sessionId = (tANI_U8)pNeighborRoamInfo->csrSessionId; |
| 1294 | tCsrRoamConnectedProfile *pCurProfile = &pMac->roam.roamSession[sessionId].connectedProfile; |
| 1295 | tANI_U8 i = 0; |
| 1296 | |
| 1297 | VOS_ASSERT(pScanFilter != NULL); |
Gopichand Nakkala | d5a904e | 2013-03-29 01:07:54 +0530 | [diff] [blame] | 1298 | if (pScanFilter == NULL) |
| 1299 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | |
| 1301 | vos_mem_zero(pScanFilter, sizeof(tCsrScanResultFilter)); |
| 1302 | |
| 1303 | /* We dont want to set BSSID based Filter */ |
| 1304 | pScanFilter->BSSIDs.numOfBSSIDs = 0; |
| 1305 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 1306 | //only for HDD requested handoff fill in the BSSID in the filter |
| 1307 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1308 | if (pNeighborRoamInfo->uOsRequestedHandoff) |
| 1309 | { |
Selvaraj, Sridhar | 95e226f | 2016-06-18 12:27:25 +0530 | [diff] [blame] | 1310 | |
| 1311 | smsLog(pMac, LOG1, FL("OS Requested Handoff")); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 1312 | pScanFilter->BSSIDs.numOfBSSIDs = 1; |
| 1313 | pScanFilter->BSSIDs.bssid = vos_mem_malloc(sizeof(tSirMacAddr) * pScanFilter->BSSIDs.numOfBSSIDs); |
| 1314 | if (NULL == pScanFilter->BSSIDs.bssid) |
| 1315 | { |
| 1316 | smsLog(pMac, LOGE, FL("Scan Filter BSSID mem alloc failed")); |
| 1317 | return eHAL_STATUS_FAILED_ALLOC; |
| 1318 | } |
| 1319 | |
| 1320 | vos_mem_zero(pScanFilter->BSSIDs.bssid, sizeof(tSirMacAddr) * pScanFilter->BSSIDs.numOfBSSIDs); |
| 1321 | |
| 1322 | /* Populate the BSSID from handoff info received from HDD */ |
| 1323 | for (i = 0; i < pScanFilter->BSSIDs.numOfBSSIDs; i++) |
| 1324 | { |
| 1325 | vos_mem_copy(&pScanFilter->BSSIDs.bssid[i], |
| 1326 | pNeighborRoamInfo->handoffReqInfo.bssid, sizeof(tSirMacAddr)); |
| 1327 | } |
| 1328 | } |
| 1329 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1330 | /* Populate all the information from the connected profile */ |
| 1331 | pScanFilter->SSIDs.numOfSSIDs = 1; |
| 1332 | pScanFilter->SSIDs.SSIDList = vos_mem_malloc(sizeof(tCsrSSIDInfo)); |
| 1333 | if (NULL == pScanFilter->SSIDs.SSIDList) |
| 1334 | { |
| 1335 | smsLog(pMac, LOGE, FL("Scan Filter SSID mem alloc failed")); |
| 1336 | return eHAL_STATUS_FAILED_ALLOC; |
| 1337 | } |
| 1338 | pScanFilter->SSIDs.SSIDList->handoffPermitted = 1; |
| 1339 | pScanFilter->SSIDs.SSIDList->ssidHidden = 0; |
| 1340 | pScanFilter->SSIDs.SSIDList->SSID.length = pCurProfile->SSID.length; |
| 1341 | vos_mem_copy((void *)pScanFilter->SSIDs.SSIDList->SSID.ssId, (void *)pCurProfile->SSID.ssId, pCurProfile->SSID.length); |
| 1342 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1343 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Filtering for SSID %.*s from scan results," |
Sanjay Devnani | 0581452 | 2013-06-24 11:46:56 -0700 | [diff] [blame] | 1344 | "length of SSID = %u"), |
| 1345 | pScanFilter->SSIDs.SSIDList->SSID.length, |
| 1346 | pScanFilter->SSIDs.SSIDList->SSID.ssId, |
| 1347 | pScanFilter->SSIDs.SSIDList->SSID.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1348 | pScanFilter->authType.numEntries = 1; |
| 1349 | pScanFilter->authType.authType[0] = pCurProfile->AuthType; |
| 1350 | |
| 1351 | pScanFilter->EncryptionType.numEntries = 1; //This must be 1 |
| 1352 | pScanFilter->EncryptionType.encryptionType[0] = pCurProfile->EncryptionType; |
| 1353 | |
| 1354 | pScanFilter->mcEncryptionType.numEntries = 1; |
| 1355 | pScanFilter->mcEncryptionType.encryptionType[0] = pCurProfile->mcEncryptionType; |
| 1356 | |
| 1357 | pScanFilter->BSSType = pCurProfile->BSSType; |
| 1358 | |
Hema Aparna Medicharla | abde8a1 | 2015-04-22 17:26:50 +0530 | [diff] [blame] | 1359 | if (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1360 | { |
Hema Aparna Medicharla | abde8a1 | 2015-04-22 17:26:50 +0530 | [diff] [blame] | 1361 | /* We are intrested only in the scan results on channels that we scanned */ |
| 1362 | pScanFilter->ChannelInfo.numOfChannels = |
| 1363 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels; |
| 1364 | pScanFilter->ChannelInfo.ChannelList = |
| 1365 | vos_mem_malloc(pScanFilter->ChannelInfo.numOfChannels * sizeof(tANI_U8)); |
| 1366 | if (NULL == pScanFilter->ChannelInfo.ChannelList) |
| 1367 | { |
| 1368 | smsLog(pMac, LOGE, FL("Scan Filter Channel list mem alloc failed")); |
| 1369 | vos_mem_free(pScanFilter->SSIDs.SSIDList); |
| 1370 | pScanFilter->SSIDs.SSIDList = NULL; |
| 1371 | return eHAL_STATUS_FAILED_ALLOC; |
| 1372 | } |
| 1373 | for (i = 0; i < pScanFilter->ChannelInfo.numOfChannels; i++) |
| 1374 | { |
| 1375 | pScanFilter->ChannelInfo.ChannelList[i] = |
| 1376 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i]; |
| 1377 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1378 | } |
Hema Aparna Medicharla | abde8a1 | 2015-04-22 17:26:50 +0530 | [diff] [blame] | 1379 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1380 | { |
Hema Aparna Medicharla | abde8a1 | 2015-04-22 17:26:50 +0530 | [diff] [blame] | 1381 | pScanFilter->ChannelInfo.numOfChannels = 0; |
| 1382 | pScanFilter->ChannelInfo.ChannelList = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1383 | } |
Kapil Gupta | b3a981b | 2016-06-26 13:36:51 +0530 | [diff] [blame^] | 1384 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1385 | if (pMac->PERroamCandidatesCnt) |
| 1386 | pScanFilter->isPERRoamScan = true; |
| 1387 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1388 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1389 | if (pNeighborRoamInfo->is11rAssoc) |
| 1390 | { |
| 1391 | /* MDIE should be added as a part of profile. This should be added as a part of filter as well */ |
| 1392 | pScanFilter->MDID.mdiePresent = pCurProfile->MDID.mdiePresent; |
| 1393 | pScanFilter->MDID.mobilityDomain = pCurProfile->MDID.mobilityDomain; |
| 1394 | } |
| 1395 | #endif |
| 1396 | |
Abhishek Singh | 2fb3a6e | 2014-11-20 16:03:01 +0530 | [diff] [blame] | 1397 | #ifdef WLAN_FEATURE_11W |
| 1398 | pScanFilter->MFPEnabled = pCurProfile->MFPEnabled; |
| 1399 | pScanFilter->MFPRequired = pCurProfile->MFPRequired; |
| 1400 | pScanFilter->MFPCapable = pCurProfile->MFPCapable; |
| 1401 | #endif |
| 1402 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1403 | return eHAL_STATUS_SUCCESS; |
| 1404 | } |
| 1405 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1406 | tANI_U32 csrGetCurrentAPRssi(tpAniSirGlobal pMac, tScanResultHandle *pScanResultList) |
| 1407 | { |
| 1408 | tCsrScanResultInfo *pScanResult; |
| 1409 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 2efea0e | 2013-01-24 17:40:41 -0800 | [diff] [blame] | 1410 | #ifdef FEATURE_WLAN_LFR |
| 1411 | tANI_U32 CurrAPRssi = pNeighborRoamInfo->lookupDOWNRssi; |
| 1412 | #else |
| 1413 | /* We are setting this as default value to make sure we return this value, |
| 1414 | when we do not see this AP in the scan result for some reason.However,it is |
| 1415 | less likely that we are associated to an AP and do not see it in the scan list */ |
| 1416 | tANI_U32 CurrAPRssi = -125; |
| 1417 | #endif |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1418 | |
| 1419 | while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList))) |
| 1420 | { |
| 1421 | |
| 1422 | if (VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, |
| 1423 | pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr))) |
| 1424 | { |
| 1425 | /* We got a match with the currently associated AP. |
| 1426 | * Capture the RSSI value and complete the while loop. |
| 1427 | * The while loop is completed in order to make the current entry go back to NULL, |
| 1428 | * and in the next while loop, it properly starts searching from the head of the list. |
| 1429 | * TODO: Can also try setting the current entry directly to NULL as soon as we find the new AP*/ |
| 1430 | |
| 1431 | CurrAPRssi = (int)pScanResult->BssDescriptor.rssi * (-1) ; |
| 1432 | |
| 1433 | } else { |
| 1434 | continue; |
| 1435 | } |
| 1436 | } |
| 1437 | |
| 1438 | return CurrAPRssi; |
| 1439 | |
| 1440 | } |
| 1441 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1442 | /* --------------------------------------------------------------------------- |
| 1443 | |
| 1444 | \fn csrNeighborRoamProcessScanResults |
| 1445 | |
| 1446 | \brief This function extracts scan results, sorts on the basis of neighbor score(todo). |
| 1447 | Assumed that the results are already sorted by RSSI by csrScanGetResult |
| 1448 | |
| 1449 | \param pMac - The handle returned by macOpen. |
| 1450 | pScanResultList - Scan result result obtained from csrScanGetResult() |
| 1451 | |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1452 | \return tANI_BOOLEAN - return TRUE if we have a candidate we can immediately |
| 1453 | roam to. Otherwise, return FALSE. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | |
| 1455 | ---------------------------------------------------------------------------*/ |
| 1456 | |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1457 | static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, |
| 1458 | tScanResultHandle *pScanResultList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1459 | { |
| 1460 | tCsrScanResultInfo *pScanResult; |
| 1461 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 1462 | tpCsrNeighborRoamBSSInfo pBssInfo; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1463 | tANI_U32 CurrAPRssi; |
| 1464 | tANI_U8 RoamRssiDiff = pMac->roam.configParam.RoamRssiDiff; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1465 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1466 | tANI_U8 immediateRoamRssiDiff = pMac->roam.configParam.nImmediateRoamRssiDiff; |
| 1467 | #endif |
| 1468 | tANI_BOOLEAN roamNow = eANI_BOOLEAN_FALSE; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1469 | |
| 1470 | /*************************************************************** |
| 1471 | * Find out the Current AP RSSI and keep it handy to check if |
| 1472 | * it is better than the RSSI of the AP which we are |
| 1473 | * going to roam.If so, we are going to continue with the |
| 1474 | * current AP. |
| 1475 | ***************************************************************/ |
| 1476 | CurrAPRssi = csrGetCurrentAPRssi(pMac, pScanResultList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1477 | |
| 1478 | /* Expecting the scan result already to be in the sorted order based on the RSSI */ |
| 1479 | /* Based on the previous state we need to check whether the list should be sorted again taking neighbor score into consideration */ |
| 1480 | /* If previous state is CFG_CHAN_LIST_SCAN, there should not be any neighbor score associated with any of the BSS. |
| 1481 | If the previous state is REPORT_QUERY, then there will be neighbor score for each of the APs */ |
| 1482 | /* For now, let us take the top of the list provided as it is by the CSR Scan result API. This means it is assumed that neighbor score |
| 1483 | and rssi score are in the same order. This will be taken care later */ |
| 1484 | |
| 1485 | while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList))) |
| 1486 | { |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 1487 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1488 | FL("Scan result: BSSID "MAC_ADDRESS_STR" (Rssi %ld, Ch:%d)"), |
| 1489 | MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId), |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 1490 | abs(pScanResult->BssDescriptor.rssi), |
| 1491 | pScanResult->BssDescriptor.channelId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1492 | |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 1493 | if ((VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, |
| 1494 | pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr))) || |
| 1495 | ((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) && |
| 1496 | (VOS_TRUE != vos_mem_compare(pScanResult->BssDescriptor.bssId, |
| 1497 | pNeighborRoamInfo->cfgRoambssId, sizeof(tSirMacAddr))))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1498 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1499 | /* currently associated AP. Do not have this in the roamable AP list */ |
Madan Mohan Koyyalamudi | 4450acc | 2012-11-15 17:24:31 -0800 | [diff] [blame] | 1500 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1501 | "SKIP-currently associated AP"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1502 | continue; |
| 1503 | } |
| 1504 | |
Abhishek Singh | 93d8fa3 | 2016-03-21 17:40:10 +0530 | [diff] [blame] | 1505 | if (vos_concurrent_open_sessions_running() && |
| 1506 | !pMac->roam.configParam.fenableMCCMode && |
| 1507 | (pScanResult->BssDescriptor.channelId != |
| 1508 | csrGetConcurrentOperationChannel(pMac))) { |
| 1509 | smsLog(pMac, LOG1, FL("MCC not supported so Ignore AP on channel %d"), |
| 1510 | pScanResult->BssDescriptor.channelId); |
| 1511 | continue; |
| 1512 | } |
| 1513 | |
Tushnim Bhattacharyya | 5128d75 | 2013-06-26 23:23:18 -0700 | [diff] [blame] | 1514 | #ifdef FEATURE_WLAN_LFR |
| 1515 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1516 | /* In case of reassoc requested by upper layer, look for exact match of bssid & channel; |
| 1517 | csr cache might have duplicates*/ |
| 1518 | if ((pNeighborRoamInfo->uOsRequestedHandoff) && |
| 1519 | ((VOS_FALSE == vos_mem_compare(pScanResult->BssDescriptor.bssId, |
| 1520 | pNeighborRoamInfo->handoffReqInfo.bssid, |
| 1521 | sizeof(tSirMacAddr)))|| |
| 1522 | (pScanResult->BssDescriptor.channelId != pNeighborRoamInfo->handoffReqInfo.channel))) |
| 1523 | |
| 1524 | { |
| 1525 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 1526 | "SKIP-not a candidate AP for OS requested roam"); |
| 1527 | continue; |
| 1528 | } |
| 1529 | #endif |
| 1530 | #endif |
| 1531 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 1532 | #ifdef FEATURE_WLAN_LFR |
| 1533 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1534 | if (pNeighborRoamInfo->isForcedInitialRoamTo5GH) |
| 1535 | { |
| 1536 | //Below check is required because scanning for forced initial roaming we have not |
| 1537 | //flush all the 2.4 GHz Channel, so it may possbile we may roam again to |
| 1538 | //2.4 Ghz ap only. |
| 1539 | if(GetRFBand(pScanResult->BssDescriptor.channelId) != SIR_BAND_5_GHZ) |
| 1540 | { |
| 1541 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 1542 | "%s: Forced Roam to 5G Skip Non 5G Scan results ", __func__); |
| 1543 | continue; |
| 1544 | } |
| 1545 | |
Mukul Sharma | d49b3d6 | 2014-09-02 01:45:32 +0530 | [diff] [blame] | 1546 | //rssi's are -ve value, so if abs of rssi is greater |
| 1547 | //means new ap is poor then currently connected ap. |
| 1548 | //Check it is only poor within nSelect5GHzMargin value. |
| 1549 | if (abs(pScanResult->BssDescriptor.rssi) > abs(CurrAPRssi) && |
| 1550 | ((abs(pScanResult->BssDescriptor.rssi) - abs(CurrAPRssi)) |
| 1551 | > pMac->roam.configParam.nSelect5GHzMargin) |
| 1552 | ) |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 1553 | { |
| 1554 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Mukul Sharma | d49b3d6 | 2014-09-02 01:45:32 +0530 | [diff] [blame] | 1555 | "%s: Forced Roam to 5G Current AP rssi=%d new ap rssi=%d not good enough, nSelect5GHzMargin=%d", __func__, |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 1556 | CurrAPRssi, |
| 1557 | (int)pScanResult->BssDescriptor.rssi * (-1), |
Mukul Sharma | d49b3d6 | 2014-09-02 01:45:32 +0530 | [diff] [blame] | 1558 | pMac->roam.configParam.nSelect5GHzMargin); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 1559 | continue; |
| 1560 | } |
Mukul Sharma | d49b3d6 | 2014-09-02 01:45:32 +0530 | [diff] [blame] | 1561 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 1562 | } |
| 1563 | #endif |
| 1564 | #endif |
| 1565 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1566 | /* This condition is to ensure to roam to an AP with better RSSI. if the value of RoamRssiDiff is Zero, this feature |
| 1567 | * is disabled and we continue to roam without any check*/ |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1568 | if ((RoamRssiDiff > 0) |
| 1569 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1570 | && !csrRoamIsRoamOffloadScanEnabled(pMac) |
| 1571 | #endif |
Mukul Sharma | d88ee39 | 2014-12-19 16:52:53 +0530 | [diff] [blame] | 1572 | && ((eSME_ROAM_TRIGGER_SCAN != pNeighborRoamInfo->cfgRoamEn) && |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 1573 | (eSME_ROAM_TRIGGER_FAST_ROAM != pNeighborRoamInfo->cfgRoamEn))) |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1574 | { |
Madan Mohan Koyyalamudi | f553b74 | 2012-12-03 16:37:39 -0800 | [diff] [blame] | 1575 | /* |
| 1576 | * If RSSI is lower than the lookup threshold, then continue. |
| 1577 | */ |
| 1578 | if (abs(pScanResult->BssDescriptor.rssi) > |
| 1579 | pNeighborRoamInfo->currentNeighborLookupThreshold) |
| 1580 | { |
| 1581 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1582 | "%s: [INFOLOG] new ap rssi (%d) lower than lookup threshold (%d)", |
Madan Mohan Koyyalamudi | f553b74 | 2012-12-03 16:37:39 -0800 | [diff] [blame] | 1583 | __func__, (int)pScanResult->BssDescriptor.rssi * (-1), |
| 1584 | (int)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); |
| 1585 | continue; |
| 1586 | } |
| 1587 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1588 | if (abs(CurrAPRssi) < abs(pScanResult->BssDescriptor.rssi)) |
| 1589 | { |
| 1590 | /*Do not roam to an AP with worse RSSI than the current*/ |
| 1591 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1592 | "%s: [INFOLOG]Current AP rssi=%d new ap rssi worse=%d", __func__, |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1593 | CurrAPRssi, |
| 1594 | (int)pScanResult->BssDescriptor.rssi * (-1) ); |
| 1595 | continue; |
| 1596 | } else { |
| 1597 | /*Do not roam to an AP which is having better RSSI than the current AP, but still less than the |
| 1598 | * margin that is provided by user from the ini file (RoamRssiDiff)*/ |
| 1599 | if (abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) < RoamRssiDiff) |
| 1600 | { |
Madan Mohan Koyyalamudi | 4450acc | 2012-11-15 17:24:31 -0800 | [diff] [blame] | 1601 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1602 | "%s: [INFOLOG]Current AP rssi=%d new ap rssi=%d not good enough, roamRssiDiff=%d", __func__, |
Madan Mohan Koyyalamudi | 4450acc | 2012-11-15 17:24:31 -0800 | [diff] [blame] | 1603 | CurrAPRssi, |
| 1604 | (int)pScanResult->BssDescriptor.rssi * (-1), |
| 1605 | RoamRssiDiff); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1606 | continue; |
| 1607 | } |
| 1608 | else { |
| 1609 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1610 | "%s: [INFOLOG]Current AP rssi=%d new ap rssi better=%d", __func__, |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1611 | CurrAPRssi, |
| 1612 | (int)pScanResult->BssDescriptor.rssi * (-1) ); |
| 1613 | } |
| 1614 | } |
| 1615 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1616 | |
| 1617 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1618 | if (pNeighborRoamInfo->is11rAssoc) |
| 1619 | { |
| 1620 | if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId)) |
| 1621 | { |
| 1622 | smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); |
| 1623 | continue; |
| 1624 | } |
| 1625 | } |
| 1626 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 1627 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1628 | #ifdef FEATURE_WLAN_ESE |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1629 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1630 | if (!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1631 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1632 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1633 | if (pNeighborRoamInfo->isESEAssoc) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1634 | { |
| 1635 | if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId)) |
| 1636 | { |
| 1637 | smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); |
| 1638 | continue; |
| 1639 | } |
| 1640 | } |
| 1641 | if ((pScanResult->BssDescriptor.QBSSLoad_present) && |
| 1642 | (pScanResult->BssDescriptor.QBSSLoad_avail)) |
| 1643 | { |
| 1644 | if (pNeighborRoamInfo->isVOAdmitted) |
| 1645 | { |
| 1646 | smsLog(pMac, LOG1, FL("New AP has %x BW available"), (unsigned int)pScanResult->BssDescriptor.QBSSLoad_avail); |
| 1647 | smsLog(pMac, LOG1, FL("We need %x BW available"),(unsigned int)pNeighborRoamInfo->MinQBssLoadRequired); |
| 1648 | if (pScanResult->BssDescriptor.QBSSLoad_avail < pNeighborRoamInfo->MinQBssLoadRequired) |
| 1649 | { |
| 1650 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1651 | "[INFOLOG]BSSID : "MAC_ADDRESS_STR" has no bandwidth ignoring..not adding to roam list", |
| 1652 | MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId)); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1653 | continue; |
| 1654 | } |
| 1655 | } |
| 1656 | } |
| 1657 | else |
| 1658 | { |
| 1659 | smsLog(pMac, LOGE, FL("No QBss %x %x"), (unsigned int)pScanResult->BssDescriptor.QBSSLoad_avail, (unsigned int)pScanResult->BssDescriptor.QBSSLoad_present); |
| 1660 | if (pNeighborRoamInfo->isVOAdmitted) |
| 1661 | { |
| 1662 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1663 | "[INFOLOG]BSSID : "MAC_ADDRESS_STR" has no QBSSLoad IE, ignoring..not adding to roam list", |
| 1664 | MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId)); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1665 | continue; |
| 1666 | } |
| 1667 | } |
| 1668 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1669 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1670 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1671 | #endif /* FEATURE_WLAN_ESE */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1672 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 1673 | #ifdef FEATURE_WLAN_LFR |
| 1674 | // If we are supporting legacy roaming, and |
| 1675 | // if the candidate is on the "pre-auth failed" list, ignore it. |
Madan Mohan Koyyalamudi | 03aae5f | 2012-11-28 01:51:22 +0530 | [diff] [blame] | 1676 | if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 1677 | { |
| 1678 | if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId)) |
| 1679 | { |
| 1680 | smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); |
| 1681 | continue; |
| 1682 | } |
| 1683 | } |
| 1684 | #endif /* FEATURE_WLAN_LFR */ |
| 1685 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1686 | /* If the received timestamp in BSS description is earlier than the scan request timestamp, skip |
| 1687 | * this result */ |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1688 | if ((pNeighborRoamInfo->scanRequestTimeStamp >= pScanResult->BssDescriptor.nReceivedTime) |
| 1689 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1690 | && !csrRoamIsRoamOffloadScanEnabled(pMac) |
| 1691 | #endif |
| 1692 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1693 | { |
| 1694 | smsLog(pMac, LOGE, FL("Ignoring BSS as it is older than the scan request timestamp")); |
| 1695 | continue; |
| 1696 | } |
| 1697 | |
| 1698 | pBssInfo = vos_mem_malloc(sizeof(tCsrNeighborRoamBSSInfo)); |
| 1699 | if (NULL == pBssInfo) |
| 1700 | { |
| 1701 | smsLog(pMac, LOGE, FL("Memory allocation for Neighbor Roam BSS Info failed.. Just ignoring")); |
| 1702 | continue; |
| 1703 | } |
| 1704 | |
| 1705 | pBssInfo->pBssDescription = vos_mem_malloc(pScanResult->BssDescriptor.length + sizeof(pScanResult->BssDescriptor.length)); |
| 1706 | if (pBssInfo->pBssDescription != NULL) |
| 1707 | { |
| 1708 | vos_mem_copy(pBssInfo->pBssDescription, &pScanResult->BssDescriptor, |
| 1709 | pScanResult->BssDescriptor.length + sizeof(pScanResult->BssDescriptor.length)); |
| 1710 | } |
| 1711 | else |
| 1712 | { |
| 1713 | smsLog(pMac, LOGE, FL("Memory allocation for Neighbor Roam BSS Descriptor failed.. Just ignoring")); |
| 1714 | vos_mem_free(pBssInfo); |
| 1715 | continue; |
| 1716 | |
| 1717 | } |
| 1718 | pBssInfo->apPreferenceVal = 10; //some value for now. Need to calculate the actual score based on RSSI and neighbor AP score |
| 1719 | |
| 1720 | /* Just add to the end of the list as it is already sorted by RSSI */ |
| 1721 | csrLLInsertTail(&pNeighborRoamInfo->roamableAPList, &pBssInfo->List, LL_ACCESS_LOCK); |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1722 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1723 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 1724 | if ((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) || |
| 1725 | (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) |
| 1726 | { |
| 1727 | roamNow = eANI_BOOLEAN_FALSE; |
| 1728 | } |
| 1729 | else if ((abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) >= immediateRoamRssiDiff) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1730 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1731 | && !csrRoamIsRoamOffloadScanEnabled(pMac) |
| 1732 | #endif |
| 1733 | ) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1734 | { |
| 1735 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 1736 | "%s: [INFOLOG] potential candidate to roam immediately (diff=%ld, expected=%d)", |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1737 | __func__, abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)), |
| 1738 | immediateRoamRssiDiff); |
| 1739 | roamNow = eANI_BOOLEAN_TRUE; |
| 1740 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1741 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1742 | /* If we are here means, FW already found candidates to roam, so we are |
| 1743 | good to go with pre-auth */ |
| 1744 | if(csrRoamIsRoamOffloadScanEnabled(pMac)) |
| 1745 | { |
| 1746 | roamNow = eANI_BOOLEAN_TRUE; |
| 1747 | } |
| 1748 | #endif |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1749 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1750 | } |
| 1751 | |
| 1752 | /* Now we have all the scan results in our local list. Good time to free up the the list we got as a part of csrGetScanResult */ |
| 1753 | csrScanResultPurge(pMac, *pScanResultList); |
| 1754 | |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1755 | return roamNow; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1756 | } |
| 1757 | |
| 1758 | /* --------------------------------------------------------------------------- |
| 1759 | |
| 1760 | \fn csrNeighborRoamHandleEmptyScanResult |
| 1761 | |
| 1762 | \brief This function will be invoked in CFG_CHAN_LIST_SCAN state when |
| 1763 | there are no valid APs in the scan result for roaming. This means |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1764 | our AP is the best and no other AP is around. No point in scanning |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1765 | again and again. Performing the following here. |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1766 | 1. Stop the neighbor scan timer. |
| 1767 | 2a. If this is the first time we encountered empty scan, then |
| 1768 | re-register with TL with modified lookup threshold. |
| 1769 | 2b. Else if this is the second time we encountered empty scan, |
| 1770 | then start neighbor scan results refresh timer (20s). |
| 1771 | 2c. Else, nothing more to do. |
| 1772 | NOTE: In LFR, channels selected for scanning is dervied from |
| 1773 | the occuped channel list. Scan cycle following one which |
| 1774 | yielded empty results is split into two halves: (i) scan on |
| 1775 | channels in the occupied list, and (ii) scan on channels not |
| 1776 | in the occupied list. This helps converging faster (while |
| 1777 | looking for candidates in the occupied list first), and also, |
| 1778 | adds channels to the occupied channel list upon finding candidates |
| 1779 | matching SSID profile of interest. |
| 1780 | |
| 1781 | uEmptyScanCount Comments |
| 1782 | eFirstEmptyScan Previous scan was done on channels in the |
| 1783 | occupied list and yielded potential candidates. |
| 1784 | This scan cycle was likely triggered through |
| 1785 | receipt of lookup DOWN notification event. |
| 1786 | eSecondEmptyScan Previous scan was done on channels in the |
| 1787 | occupied list and yielded no candidates. This scan |
| 1788 | cycle was triggered through RSSI notification |
| 1789 | with modified lookup threshold. |
| 1790 | eThirdEmptyScan Previous scan was done on channels NOT in |
| 1791 | the occupied list and yielded no candidates. This |
| 1792 | scan cycle was triggered immediately after scanning |
| 1793 | channels in the occupied list and no candidates |
| 1794 | were found. |
| 1795 | eFourthEmptyScan Previous scan was done on channels in the |
| 1796 | occupied list and yielded no candidates. This scan |
| 1797 | cycle was triggered upon expiry of |
| 1798 | neighborScanResultsRefreshPeriod (=20s). |
| 1799 | eFifthEmptyScan Previous scan was done on channels NOT in |
| 1800 | the occupied list and yielded no candidates. This |
| 1801 | scan cycle was triggered immediately after scanning |
| 1802 | channels in the occupied list and no candidates |
| 1803 | were found. |
| 1804 | |
| 1805 | [1], [2,3] and [4,5] together form one discrete set of scan cycle. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1806 | |
| 1807 | \param pMac - The handle returned by macOpen. |
| 1808 | |
| 1809 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 1810 | |
| 1811 | ---------------------------------------------------------------------------*/ |
| 1812 | static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac) |
| 1813 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1814 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1815 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 1816 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1817 | #ifdef FEATURE_WLAN_LFR |
| 1818 | tANI_BOOLEAN performPeriodicScan = |
| 1819 | (pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod) ? TRUE : FALSE; |
| 1820 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1821 | |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 1822 | /* Stop neighbor scan timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 1823 | vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1824 | /* |
| 1825 | * Increase the neighbor lookup threshold by 3 dB |
| 1826 | * after every scan cycle. NOTE: uEmptyScanCount |
| 1827 | * would be either 1, 3 or 5 at the end of every |
| 1828 | * scan cycle. |
| 1829 | */ |
| 1830 | #ifdef FEATURE_WLAN_LFR |
| 1831 | if ((++pNeighborRoamInfo->uEmptyScanCount) > eFifthEmptyScan) |
| 1832 | { |
| 1833 | pNeighborRoamInfo->uEmptyScanCount = eFifthEmptyScan; |
| 1834 | } |
Srikant Kuppa | 327c52e | 2013-05-09 15:09:24 -0700 | [diff] [blame] | 1835 | if (((0 != pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels) || |
| 1836 | (abs(pNeighborRoamInfo->lookupDOWNRssi) > |
| 1837 | abs(pNeighborRoamInfo->cfgParams.neighborReassocThreshold))) && |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1838 | ((pNeighborRoamInfo->uEmptyScanCount == eSecondEmptyScan) || |
| 1839 | (pNeighborRoamInfo->uEmptyScanCount == eFourthEmptyScan))) |
| 1840 | { |
| 1841 | /* |
| 1842 | * If the scan was triggered due to lookupDOWNRssi > reassoc threshold, |
| 1843 | * then it would be a contiguous scan on all valid non-DFS channels. |
Srikant Kuppa | 327c52e | 2013-05-09 15:09:24 -0700 | [diff] [blame] | 1844 | * If channels are configured in INI, then only those channels need |
| 1845 | * to be scanned. |
| 1846 | * In either of these modes, there is no need to trigger an immediate |
| 1847 | * scan upon empty scan results for the second and fourth time (which |
| 1848 | * would be equivalent to scanning on channels in non-occupied list). |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1849 | * Incrementing uEmptyScanCount will correspond to skipping this step. |
| 1850 | * NOTE: double increment of uEmptyScanCount corresponds to completion |
| 1851 | * of scans on all valid channels. |
| 1852 | */ |
| 1853 | ++pNeighborRoamInfo->uEmptyScanCount; |
| 1854 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "Extra increment of empty scan count (=%d)" |
| 1855 | " in contiguous scan mode", pNeighborRoamInfo->uEmptyScanCount); |
| 1856 | } |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1857 | #endif |
| 1858 | if (((pNeighborRoamInfo->currentNeighborLookupThreshold+3) < |
| 1859 | pNeighborRoamInfo->cfgParams.neighborReassocThreshold) |
| 1860 | #ifdef FEATURE_WLAN_LFR |
| 1861 | && ((pNeighborRoamInfo->uEmptyScanCount % 2) == 1) |
| 1862 | #endif |
| 1863 | ) |
| 1864 | { |
| 1865 | pNeighborRoamInfo->currentNeighborLookupThreshold += 3; |
| 1866 | } |
| 1867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1869 | /* Clear off the old neighbor report details */ |
| 1870 | vos_mem_zero(&pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); |
| 1871 | #endif |
| 1872 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 1873 | /* Transition to CONNECTED state */ |
| 1874 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); |
| 1875 | |
| 1876 | /* Reset all the necessary variables before transitioning to the CONNECTED state */ |
| 1877 | csrNeighborRoamResetConnectedStateControlInfo(pMac); |
| 1878 | |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1879 | #ifdef FEATURE_WLAN_LFR |
| 1880 | if (pNeighborRoamInfo->uEmptyScanCount == eFirstEmptyScan) |
| 1881 | { |
| 1882 | #endif |
| 1883 | /* Empty scan results for the first time */ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1884 | /* Re-register neighbor lookup DOWN threshold callback with TL */ |
| 1885 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, |
| 1886 | FL("Registering DOWN event neighbor lookup callback with TL for RSSI = %d"), |
| 1887 | pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); |
| 1888 | |
| 1889 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, |
| 1890 | (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 1891 | WLANTL_HO_THRESHOLD_DOWN, |
| 1892 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 1893 | VOS_MODULE_ID_SME, pMac); |
| 1894 | |
| 1895 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 1896 | { |
| 1897 | smsLog(pMac, LOGW, |
| 1898 | FL("Couldn't re-register csrNeighborRoamNeighborLookupDOWNCallback" |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 1899 | " with TL: Status = %d"), status); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1900 | } |
| 1901 | #ifdef FEATURE_WLAN_LFR |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 1902 | pNeighborRoamInfo->lookupDOWNRssi = 0; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1903 | } |
| 1904 | else if ((pNeighborRoamInfo->uEmptyScanCount == eSecondEmptyScan) || |
| 1905 | (pNeighborRoamInfo->uEmptyScanCount == eFourthEmptyScan)) |
| 1906 | { |
| 1907 | /* Empty scan results for the second or fourth time */ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1908 | |
| 1909 | /* Immediately scan on channels in non-occupied list */ |
| 1910 | csrNeighborRoamTransitToCFGChanScan(pMac); |
| 1911 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1912 | else if (pNeighborRoamInfo->uEmptyScanCount >= eThirdEmptyScan) |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1913 | { |
| 1914 | /* Empty scan results for the third time */ |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1915 | if (performPeriodicScan) |
| 1916 | { |
| 1917 | smsLog(pMac, LOGE, FL("Performing periodic scan, uEmptyScanCount=%d"), |
| 1918 | pNeighborRoamInfo->uEmptyScanCount); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 1919 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1920 | /* |
| 1921 | * Set uEmptyScanCount to MAX so that we always enter this |
| 1922 | * condition on subsequent empty scan results |
| 1923 | */ |
| 1924 | pNeighborRoamInfo->uEmptyScanCount = eMaxEmptyScan; |
| 1925 | |
| 1926 | /* From here on, ONLY scan on channels in the occupied list */ |
| 1927 | pNeighborRoamInfo->uScanMode = SPLIT_SCAN_OCCUPIED_LIST; |
| 1928 | |
| 1929 | /* Start empty scan refresh timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 1930 | if (VOS_STATUS_SUCCESS != |
| 1931 | vos_timer_start(&pNeighborRoamInfo->emptyScanRefreshTimer, |
| 1932 | pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod)) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1933 | { |
| 1934 | smsLog(pMac, LOGE, FL("Empty scan refresh timer failed to start (%d)"), |
| 1935 | status); |
| 1936 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 1937 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 1938 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1939 | vosStatus = VOS_STATUS_E_FAILURE; |
| 1940 | } |
| 1941 | else |
| 1942 | { |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 1943 | smsLog(pMac, LOGE, FL("Empty scan refresh timer started (%d ms)"), |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1944 | (pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod)); |
| 1945 | } |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1946 | } |
Srikant Kuppa | 327c52e | 2013-05-09 15:09:24 -0700 | [diff] [blame] | 1947 | else if (eThirdEmptyScan == pNeighborRoamInfo->uEmptyScanCount) |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1948 | { |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1949 | /* Start neighbor scan results refresh timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 1950 | if (VOS_STATUS_SUCCESS != |
| 1951 | vos_timer_start(&pNeighborRoamInfo->neighborResultsRefreshTimer, |
| 1952 | pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod)) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1953 | { |
| 1954 | smsLog(pMac, LOGE, FL("Neighbor results refresh timer failed to start (%d)"), |
| 1955 | status); |
| 1956 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 1957 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 1958 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1959 | vosStatus = VOS_STATUS_E_FAILURE; |
| 1960 | } |
| 1961 | else |
| 1962 | { |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 1963 | smsLog(pMac, LOG2, FL("Neighbor results refresh timer started (%d ms)"), |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1964 | (pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod * PAL_TIMER_TO_MS_UNIT)); |
| 1965 | } |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1966 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1967 | } |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 1968 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1969 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "Neighbor roam empty scan count=%d scan mode=%d", |
| 1970 | pNeighborRoamInfo->uEmptyScanCount, pNeighborRoamInfo->uScanMode); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 1971 | #endif |
| 1972 | return vosStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1973 | } |
| 1974 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1975 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 1976 | static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1977 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1978 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1979 | tCsrScanResultFilter scanFilter; |
| 1980 | tScanResultHandle scanResult; |
| 1981 | tANI_U32 tempVal = 0; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 1982 | tANI_BOOLEAN roamNow = eANI_BOOLEAN_FALSE; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 1983 | eHalStatus hstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1984 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1985 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1986 | /* If the state is REPORT_SCAN, then this must be the scan after the REPORT_QUERY state. So, we |
| 1987 | should use the BSSID filter made out of neighbor reports */ |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1988 | if ((eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) |
| 1989 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1990 | && (!csrRoamIsRoamOffloadScanEnabled(pMac)) |
| 1991 | #endif |
| 1992 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1993 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1994 | hstatus = csrNeighborRoamBssIdScanFilter(pMac, &scanFilter); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1995 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R or ESE Association: Prepare scan filter status with neighbor AP = %d"), hstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1996 | tempVal = 1; |
| 1997 | } |
| 1998 | else |
| 1999 | #endif |
| 2000 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2001 | hstatus = csrNeighborRoamPrepareScanProfileFilter(pMac, &scanFilter); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2002 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R/ESE/Other Association: Prepare scan to find neighbor AP filter status = %d"), hstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2003 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2004 | if (eHAL_STATUS_SUCCESS != hstatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2005 | { |
| 2006 | smsLog(pMac, LOGE, FL("Scan Filter preparation failed for Assoc type %d.. Bailing out.."), tempVal); |
| 2007 | return eHAL_STATUS_FAILURE; |
| 2008 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2009 | hstatus = csrScanGetResult(pMac, &scanFilter, &scanResult); |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 2010 | if (hstatus != eHAL_STATUS_SUCCESS) |
| 2011 | { |
| 2012 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Get Scan Result status code %d"), hstatus); |
| 2013 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2014 | /* Process the scan results and update roamable AP list */ |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 2015 | roamNow = csrNeighborRoamProcessScanResults(pMac, &scanResult); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2016 | |
| 2017 | /* Free the scan filter */ |
| 2018 | csrFreeScanFilter(pMac, &scanFilter); |
| 2019 | |
| 2020 | tempVal = csrLLCount(&pNeighborRoamInfo->roamableAPList); |
| 2021 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2022 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2023 | if(!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2024 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2025 | #endif |
| 2026 | switch(pNeighborRoamInfo->neighborRoamState) |
| 2027 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | case eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN: |
| 2029 | if (tempVal) |
| 2030 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 2031 | #ifdef FEATURE_WLAN_LFR |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 2032 | /* |
| 2033 | * Since there are non-zero candidates found |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 2034 | * after the scan, reset empty scan count. |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 2035 | */ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 2036 | pNeighborRoamInfo->uEmptyScanCount = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2037 | pNeighborRoamInfo->uScanMode = DEFAULT_SCAN; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 2038 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2039 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2040 | /* If this is a non-11r association, then we can register the reassoc callback here as we have some |
| 2041 | APs in the roamable AP list */ |
| 2042 | if (pNeighborRoamInfo->is11rAssoc) |
| 2043 | { |
| 2044 | /* Valid APs are found after scan. Now we can initiate pre-authentication */ |
| 2045 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) |
| 2046 | } |
| 2047 | else |
| 2048 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2049 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2050 | /* If this is a non-11r association, then we can register the reassoc callback here as we have some |
| 2051 | APs in the roamable AP list */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2052 | if (pNeighborRoamInfo->isESEAssoc) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2053 | { |
| 2054 | /* Valid APs are found after scan. Now we can initiate pre-authentication */ |
| 2055 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) |
| 2056 | } |
| 2057 | else |
| 2058 | #endif |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2059 | #ifdef FEATURE_WLAN_LFR |
| 2060 | /* If LFR is enabled, then we can register the reassoc callback here as we have some |
| 2061 | APs in the roamable AP list */ |
Madan Mohan Koyyalamudi | 03aae5f | 2012-11-28 01:51:22 +0530 | [diff] [blame] | 2062 | if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2063 | { |
| 2064 | /* Valid APs are found after scan. Now we can initiate pre-authentication */ |
| 2065 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) |
| 2066 | } |
| 2067 | else |
| 2068 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2069 | { |
| 2070 | |
| 2071 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Completed scanning of CFG CHAN LIST in non-11r association. Registering reassoc callback")); |
| 2072 | /* Nothing much to do now. Will continue to remain in this state in case of non-11r association */ |
| 2073 | /* Stop the timer. But how long the roamable AP list will be valid in here. At some point of time, we |
| 2074 | need to restart the CFG CHAN list scan procedure if reassoc callback is not invoked from TL |
| 2075 | within certain duration */ |
| 2076 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 2077 | // vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2078 | } |
| 2079 | } |
| 2080 | else |
| 2081 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2082 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, |
| 2083 | FL("No candidate found after scanning in state %s .. "), |
| 2084 | macTraceGetNeighbourRoamState( |
| 2085 | pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | b40e558 | 2012-10-11 16:48:42 -0700 | [diff] [blame] | 2086 | /* Handle it appropriately */ |
| 2087 | csrNeighborRoamHandleEmptyScanResult(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2088 | } |
| 2089 | break; |
| 2090 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2091 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2092 | if (!tempVal) |
| 2093 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2094 | smsLog(pMac, LOGE, FL("No candidate found after scanning" |
| 2095 | "in state %s .. "), |
| 2096 | macTraceGetNeighbourRoamState( |
| 2097 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2098 | /* Stop the timer here as the same timer will be started again in CFG_CHAN_SCAN_STATE */ |
| 2099 | csrNeighborRoamTransitToCFGChanScan(pMac); |
| 2100 | } |
| 2101 | break; |
| 2102 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 2103 | default: |
| 2104 | // Can come only in INIT state. Where in we are associated, we sent scan and user |
| 2105 | // in the meantime decides to disassoc, we will be in init state and still received call |
| 2106 | // back issued. Should not come here in any other state, printing just in case |
| 2107 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2108 | FL("State %s"), |
| 2109 | macTraceGetNeighbourRoamState( |
| 2110 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2111 | |
| 2112 | // Lets just exit out silently. |
| 2113 | return eHAL_STATUS_SUCCESS; |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2114 | } |
| 2115 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2116 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2117 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2118 | |
| 2119 | if (tempVal) |
| 2120 | { |
| 2121 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 2122 | |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 2123 | if (roamNow) |
| 2124 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2125 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2126 | if(!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 2127 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2128 | #endif |
| 2129 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, |
| 2130 | FL("Immediate roam-deregister UP indication. RSSI = %d"), |
| 2131 | NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); |
| 2132 | |
| 2133 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, |
| 2134 | (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), |
| 2135 | WLANTL_HO_THRESHOLD_UP, |
| 2136 | csrNeighborRoamNeighborLookupUPCallback, |
| 2137 | VOS_MODULE_ID_SME); |
| 2138 | |
| 2139 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 2140 | { |
| 2141 | smsLog(pMac, LOGW, |
| 2142 | FL("Couldn't deregister lookup UP callback with TL: Status = %d"), vosStatus); |
| 2143 | } |
| 2144 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 2145 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2146 | #endif |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 2147 | |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2148 | hstatus = csrNeighborRoamTriggerHandoff(pMac,pNeighborRoamInfo); |
| 2149 | if(eHAL_STATUS_SUCCESS != hstatus) |
| 2150 | { |
| 2151 | smsLog(pMac, LOGE, |
| 2152 | FL("csrNeighborRoamTriggerHandoff fail status = %d"), |
| 2153 | hstatus); |
| 2154 | return eHAL_STATUS_FAILURE; |
| 2155 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 2156 | return eHAL_STATUS_SUCCESS; |
| 2157 | } |
| 2158 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 2159 | hstatus = vos_timer_start(&pNeighborRoamInfo->neighborResultsRefreshTimer, |
| 2160 | pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2162 | /* This timer should be started before registering the Reassoc callback with TL. This is because, it is very likely |
| 2163 | * that the callback getting called immediately and the timer would never be stopped when pre-auth is in progress */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 2164 | if( hstatus != eHAL_STATUS_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2165 | { |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2166 | smsLog(pMac, LOGE, FL("Neighbor results refresh timer failed to start, status = %d"), hstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2167 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 2168 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 2169 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2170 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2171 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2172 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2173 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event Reassoc callback with TL. RSSI = %d"), pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); |
| 2174 | /* Register a reassoc Indication callback */ |
| 2175 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), |
| 2176 | WLANTL_HO_THRESHOLD_DOWN, |
| 2177 | csrNeighborRoamReassocIndCallback, |
| 2178 | VOS_MODULE_ID_SME, pMac); |
| 2179 | |
| 2180 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 2181 | { |
| 2182 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2183 | smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamReassocIndCallback with TL: Status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2184 | } |
| 2185 | |
| 2186 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2187 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
mukul sharma | 3971836 | 2014-05-24 21:59:52 +0530 | [diff] [blame] | 2188 | if (csrRoamIsRoamOffloadScanEnabled(pMac)) |
| 2189 | { |
| 2190 | if (!tempVal || !roamNow) |
| 2191 | { |
| 2192 | if((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) || |
| 2193 | (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) |
| 2194 | { |
| 2195 | //This is ioctl based roaming if we did not find any roamable |
| 2196 | //candidate then just log it. |
| 2197 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2198 | "tempVal = %u, roamNow = %d uOsRequestedHandoff = %d", |
| 2199 | tempVal, roamNow, pNeighborRoamInfo->uOsRequestedHandoff); |
| 2200 | } |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2201 | else if (pNeighborRoamInfo->isForcedInitialRoamTo5GH) |
| 2202 | { |
| 2203 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2204 | "No 5G candidate found tempVal=%u, roamNow=%d", |
| 2205 | tempVal, roamNow); |
| 2206 | return eHAL_STATUS_FAILURE; |
| 2207 | } |
mukul sharma | 3971836 | 2014-05-24 21:59:52 +0530 | [diff] [blame] | 2208 | else |
| 2209 | { |
| 2210 | if (pNeighborRoamInfo->uOsRequestedHandoff) |
| 2211 | { |
| 2212 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, |
| 2213 | REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); |
| 2214 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
| 2215 | } |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2216 | |
mukul sharma | 3971836 | 2014-05-24 21:59:52 +0530 | [diff] [blame] | 2217 | else |
| 2218 | { |
Kapil Gupta | b3a981b | 2016-06-26 13:36:51 +0530 | [diff] [blame^] | 2219 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2220 | if (pMac->PERroamCandidatesCnt == 0) |
| 2221 | #endif |
| 2222 | { |
| 2223 | /* There is no candidate or We are not roaming Now. |
| 2224 | * Inform the FW to restart Roam Offload Scan */ |
| 2225 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, |
| 2226 | REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); |
| 2227 | } |
mukul sharma | 3971836 | 2014-05-24 21:59:52 +0530 | [diff] [blame] | 2228 | } |
| 2229 | } |
| 2230 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); |
| 2231 | } |
| 2232 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2233 | #endif |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2234 | return eHAL_STATUS_SUCCESS; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2235 | } |
| 2236 | |
| 2237 | |
| 2238 | /* --------------------------------------------------------------------------- |
| 2239 | |
| 2240 | \fn csrNeighborRoamScanRequestCallback |
| 2241 | |
| 2242 | \brief This function is the callback function registered in csrScanRequest() to |
| 2243 | indicate the completion of scan. If scan is completed for all the channels in |
| 2244 | the channel list, this function gets the scan result and starts the refresh results |
| 2245 | timer to avoid having stale results. If scan is not completed on all the channels, |
| 2246 | it restarts the neighbor scan timer which on expiry issues scan on the next |
| 2247 | channel |
| 2248 | |
| 2249 | \param halHandle - The handle returned by macOpen. |
| 2250 | pContext - not used |
| 2251 | scanId - not used |
| 2252 | status - not used |
| 2253 | |
| 2254 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 2255 | |
| 2256 | ---------------------------------------------------------------------------*/ |
| 2257 | static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, void *pContext, |
| 2258 | tANI_U32 scanId, eCsrScanStatus status) |
| 2259 | { |
| 2260 | tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; |
| 2261 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 2262 | tANI_U8 currentChanIndex; |
| 2263 | eHalStatus hstatus; |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2264 | #ifdef FEATURE_WLAN_LFR |
| 2265 | tANI_U32 sessionId = CSR_SESSION_ID_INVALID; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2266 | |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2267 | if (NULL != pContext) |
| 2268 | { |
| 2269 | sessionId = *((tANI_U32*)pContext); |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2270 | |
| 2271 | if (!csrRoamIsStaMode(pMac, sessionId)) |
| 2272 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2273 | smsLog(pMac, LOGE, FL("Ignoring scan request callback on non-infra" |
| 2274 | "session %d in state %s"), |
| 2275 | sessionId, macTraceGetNeighbourRoamState( |
| 2276 | pNeighborRoamInfo->neighborRoamState)); |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2277 | vos_mem_free(pContext); |
| 2278 | return eHAL_STATUS_SUCCESS; |
| 2279 | } |
| 2280 | |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2281 | if (!csrRoamIsFastRoamEnabled(pMac,sessionId)) |
| 2282 | { |
| 2283 | smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); |
| 2284 | vos_mem_free(pContext); |
| 2285 | return eHAL_STATUS_SUCCESS; |
| 2286 | } |
| 2287 | } |
| 2288 | #endif |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2289 | pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; |
| 2290 | |
| 2291 | /* This can happen when we receive a UP event from TL in any of the scan states. Silently ignore it */ |
| 2292 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) |
| 2293 | { |
| 2294 | smsLog(pMac, LOGE, FL("Received in CONNECTED state. Must be because a UP event from TL after issuing scan request. Ignore it")); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2295 | if (NULL != pContext) |
| 2296 | vos_mem_free(pContext); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2297 | return eHAL_STATUS_SUCCESS; |
| 2298 | } |
| 2299 | |
| 2300 | /* -1 is done because the chanIndex would have got incremented after issuing a successful scan request */ |
| 2301 | currentChanIndex = (pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex) ? (pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex - 1) : 0; |
| 2302 | |
| 2303 | /* Validate inputs */ |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2304 | if (pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList) { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2305 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("csrNeighborRoamScanRequestCallback received for Channel = %d, ChanIndex = %d"), |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2306 | pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList[currentChanIndex], currentChanIndex); |
| 2307 | } |
| 2308 | else |
| 2309 | { |
| 2310 | smsLog(pMac, LOG1, FL("Received during clean-up. Silently ignore scan completion event.")); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2311 | if (NULL != pContext) |
| 2312 | vos_mem_free(pContext); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2313 | return eHAL_STATUS_SUCCESS; |
| 2314 | } |
| 2315 | |
| 2316 | if (eANI_BOOLEAN_FALSE == pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress) |
| 2317 | { |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2318 | /* Scan is completed in the CFG_CHAN_SCAN state. We can transition to REPORT_SCAN state |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2319 | just to get the results and perform PREAUTH */ |
| 2320 | /* Now we have completed scanning the channel list. We have get the result by applying appropriate filter |
| 2321 | sort the results based on neighborScore and RSSI and select the best candidate out of the list */ |
| 2322 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Channel list scan completed. Current chan index = %d"), currentChanIndex); |
| 2323 | VOS_ASSERT(pNeighborRoamInfo->roamChannelInfo.currentChanIndex == 0); |
| 2324 | |
| 2325 | hstatus = csrNeighborRoamProcessScanComplete(pMac); |
| 2326 | |
| 2327 | if (eHAL_STATUS_SUCCESS != hstatus) |
| 2328 | { |
| 2329 | smsLog(pMac, LOGE, FL("Neighbor scan process complete failed with status %d"), hstatus); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2330 | if (NULL != pContext) |
| 2331 | vos_mem_free(pContext); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2332 | return eHAL_STATUS_FAILURE; |
| 2333 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2334 | } |
| 2335 | else |
| 2336 | { |
| 2337 | |
| 2338 | /* Restart the timer for the next scan sequence as scanning is not over */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 2339 | hstatus = vos_timer_start(&pNeighborRoamInfo->neighborScanTimer, |
| 2340 | pNeighborRoamInfo->cfgParams.neighborScanPeriod); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2341 | if (eHAL_STATUS_SUCCESS != hstatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2342 | { |
| 2343 | /* Timer start failed.. Should we ASSERT here??? */ |
| 2344 | smsLog(pMac, LOGE, FL("Neighbor scan PAL Timer start failed, status = %d, Ignoring state transition"), status); |
| 2345 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 2346 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 2347 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2348 | if (NULL != pContext) |
| 2349 | vos_mem_free(pContext); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2350 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2351 | } |
| 2352 | } |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2353 | |
| 2354 | if (NULL != pContext) |
| 2355 | vos_mem_free(pContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2356 | return eHAL_STATUS_SUCCESS; |
| 2357 | } |
| 2358 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2359 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2360 | /* --------------------------------------------------------------------------- |
| 2361 | |
| 2362 | \fn csrNeighborRoamScanResultRequestCallback |
| 2363 | |
| 2364 | \brief This function is the callback function registered in csrScanRequestLfrResult() to |
| 2365 | indicate the completion of scan. If scan is completed for all the channels in |
| 2366 | the channel list, this function gets the scan result and treats them as candidates |
| 2367 | |
| 2368 | \param halHandle - The handle returned by macOpen. |
| 2369 | pContext - not used |
| 2370 | scanId - not used |
| 2371 | status - not used |
| 2372 | |
| 2373 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 2374 | |
| 2375 | ---------------------------------------------------------------------------*/ |
| 2376 | static eHalStatus csrNeighborRoamScanResultRequestCallback(tHalHandle halHandle, void *pContext, |
| 2377 | tANI_U32 scanId, eCsrScanStatus status) |
| 2378 | { |
| 2379 | tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; |
| 2380 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 2381 | eHalStatus hstatus; |
| 2382 | |
| 2383 | smsLog(pMac, LOG2, FL("called ")); |
| 2384 | pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; |
| 2385 | |
| 2386 | /* we must be in connected state, if not ignore it */ |
| 2387 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) |
| 2388 | { |
| 2389 | smsLog(pMac, LOGW, FL("Received in not CONNECTED state. Ignore it")); |
| 2390 | return eHAL_STATUS_SUCCESS; |
| 2391 | } |
| 2392 | |
| 2393 | /* Now we have completed scanning the channel list. We have get the result by applying appropriate filter |
| 2394 | sort the results based on neighborScore and RSSI and select the best candidate out of the list */ |
| 2395 | |
| 2396 | hstatus = csrNeighborRoamProcessScanComplete(pMac); |
| 2397 | |
| 2398 | if (eHAL_STATUS_SUCCESS != hstatus) |
| 2399 | { |
| 2400 | smsLog(pMac, LOGE, FL("Neighbor scan process complete failed with status %d"), hstatus); |
| 2401 | return eHAL_STATUS_FAILURE; |
| 2402 | } |
| 2403 | return eHAL_STATUS_SUCCESS; |
| 2404 | } |
| 2405 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2406 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2407 | #ifdef FEATURE_WLAN_LFR |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2408 | static eHalStatus csrNeighborRoamForceRoamTo5GhScanCb(tHalHandle halHandle, |
| 2409 | void *pContext, tANI_U32 scanId, eCsrScanStatus status) |
| 2410 | { |
| 2411 | tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; |
| 2412 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 2413 | eHalStatus hstatus = eHAL_STATUS_SUCCESS; |
| 2414 | tANI_U32 sessionId = CSR_SESSION_ID_INVALID; |
| 2415 | |
| 2416 | if (NULL != pContext) |
| 2417 | { |
| 2418 | sessionId = *((tANI_U32*)pContext); |
| 2419 | if (!csrRoamIsFastRoamEnabled(pMac,sessionId)) |
| 2420 | { |
| 2421 | smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); |
| 2422 | hstatus = eHAL_STATUS_FAILURE; |
| 2423 | goto end; |
| 2424 | } |
| 2425 | } |
| 2426 | |
| 2427 | pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; |
| 2428 | |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2429 | if (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN != pNeighborRoamInfo->neighborRoamState) |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2430 | { |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2431 | smsLog(pMac, LOGE, FL("Received in neighborRoamState %d . Ignore it"), |
| 2432 | pNeighborRoamInfo->neighborRoamState); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2433 | hstatus = eHAL_STATUS_FAILURE; |
| 2434 | goto end; |
| 2435 | } |
| 2436 | |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2437 | //keep track of forced 5G scan & roam is due to Forced initial roam to 5GHz |
| 2438 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 1; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2439 | |
| 2440 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: process scan results", __func__); |
| 2441 | hstatus = csrNeighborRoamProcessScanComplete(pMac); |
Mukul Sharma | d49b3d6 | 2014-09-02 01:45:32 +0530 | [diff] [blame] | 2442 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2443 | if (eHAL_STATUS_SUCCESS != hstatus) |
| 2444 | { |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 2445 | smsLog(pMac, LOGE, FL("Force Roam To 5GhScanCb failed with status %d"), |
| 2446 | hstatus); |
| 2447 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; |
| 2448 | /* |
| 2449 | * Send RSO start because in case 5G roaming host have |
| 2450 | * not enabled at initial connection |
| 2451 | */ |
| 2452 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); |
| 2453 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2454 | } |
| 2455 | |
| 2456 | if (NULL != pContext) |
| 2457 | vos_mem_free(pContext); |
| 2458 | return hstatus; |
| 2459 | |
| 2460 | end: |
| 2461 | if (NULL != pContext) |
| 2462 | vos_mem_free(pContext); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2463 | return hstatus; |
| 2464 | } |
| 2465 | #endif |
| 2466 | |
| 2467 | #ifdef FEATURE_WLAN_LFR |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2468 | static eHalStatus csrNeighborRoamContiguousScanRequestCallback(tHalHandle halHandle, |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2469 | void *pContext, tANI_U32 scanId, eCsrScanStatus status) |
| 2470 | { |
| 2471 | tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; |
| 2472 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 2473 | eHalStatus hstatus = eHAL_STATUS_SUCCESS; |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2474 | tANI_U32 sessionId = CSR_SESSION_ID_INVALID; |
| 2475 | |
| 2476 | if (NULL != pContext) |
| 2477 | { |
| 2478 | sessionId = *((tANI_U32*)pContext); |
| 2479 | if (!csrRoamIsFastRoamEnabled(pMac,sessionId)) |
| 2480 | { |
| 2481 | smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); |
| 2482 | vos_mem_free(pContext); |
| 2483 | return eHAL_STATUS_SUCCESS; |
| 2484 | } |
| 2485 | } |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2486 | |
| 2487 | pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2488 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2489 | /* This can happen when we receive a UP event from TL in any of the scan states. Silently ignore it */ |
| 2490 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) |
| 2491 | { |
| 2492 | smsLog(pMac, LOGE, FL("Received in CONNECTED state. Must be because a UP event from TL after issuing scan request. Ignore it")); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2493 | if (NULL != pContext) |
| 2494 | vos_mem_free(pContext); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2495 | return eHAL_STATUS_SUCCESS; |
| 2496 | } |
| 2497 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2498 | if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) |
| 2499 | { |
| 2500 | smsLog(pMac, LOGE, FL("Received in INIT state. Must have disconnected. Ignore it")); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2501 | if (NULL != pContext) |
| 2502 | vos_mem_free(pContext); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2503 | return eHAL_STATUS_SUCCESS; |
| 2504 | } |
| 2505 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2506 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: process scan results", __func__); |
| 2507 | hstatus = csrNeighborRoamProcessScanComplete(pMac); |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2508 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2509 | if (eHAL_STATUS_SUCCESS != hstatus) |
| 2510 | { |
| 2511 | smsLog(pMac, LOGE, FL("Neighbor scan process complete failed with status %d"), hstatus); |
| 2512 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 2513 | |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2514 | if (NULL != pContext) |
| 2515 | vos_mem_free(pContext); |
| 2516 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2517 | return hstatus; |
| 2518 | } |
| 2519 | #endif |
| 2520 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2521 | /* --------------------------------------------------------------------------- |
| 2522 | |
| 2523 | \fn csrNeighborRoamIssueBgScanRequest |
| 2524 | |
| 2525 | \brief This function issues CSR scan request after populating all the BG scan params |
| 2526 | passed |
| 2527 | |
| 2528 | \param pMac - The handle returned by macOpen. |
| 2529 | pBgScanParams - Params that need to be populated into csr Scan request |
| 2530 | |
| 2531 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 2532 | |
| 2533 | ---------------------------------------------------------------------------*/ |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2534 | eHalStatus csrNeighborRoamIssueBgScanRequest(tpAniSirGlobal pMac, |
| 2535 | tCsrBGScanRequest *pBgScanParams, |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2536 | tANI_U32 sessionId, |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2537 | csrScanCompleteCallback callbackfn) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2538 | { |
| 2539 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2540 | tANI_U32 scanId; |
| 2541 | tCsrScanRequest scanReq; |
| 2542 | tANI_U8 channel; |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2543 | void * userData = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2544 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2545 | if (1 == pBgScanParams->ChannelInfo.numOfChannels) |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2546 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Channel = %d, ChanIndex = %d"), |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2547 | pBgScanParams->ChannelInfo.ChannelList[0], |
| 2548 | pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2549 | |
| 2550 | //send down the scan req for 1 channel on the associated SSID |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2551 | vos_mem_set(&scanReq, sizeof(tCsrScanRequest), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2552 | /* Fill in the SSID Info */ |
| 2553 | scanReq.SSIDs.numOfSSIDs = 1; |
| 2554 | scanReq.SSIDs.SSIDList = vos_mem_malloc(sizeof(tCsrSSIDInfo) * scanReq.SSIDs.numOfSSIDs); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2555 | if (NULL == scanReq.SSIDs.SSIDList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2556 | { |
| 2557 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2558 | smsLog(pMac, LOGE, FL("Couldn't allocate memory for the SSID..Freeing memory allocated for Channel List")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2559 | return eHAL_STATUS_FAILURE; |
| 2560 | } |
| 2561 | vos_mem_zero(scanReq.SSIDs.SSIDList, sizeof(tCsrSSIDInfo) * scanReq.SSIDs.numOfSSIDs); |
| 2562 | |
| 2563 | scanReq.SSIDs.SSIDList[0].handoffPermitted = eANI_BOOLEAN_TRUE; |
| 2564 | scanReq.SSIDs.SSIDList[0].ssidHidden = eANI_BOOLEAN_TRUE; |
| 2565 | vos_mem_copy((void *)&scanReq.SSIDs.SSIDList[0].SSID, (void *)&pBgScanParams->SSID, sizeof(pBgScanParams->SSID)); |
| 2566 | |
| 2567 | scanReq.ChannelInfo.numOfChannels = pBgScanParams->ChannelInfo.numOfChannels; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2568 | if (1 == pBgScanParams->ChannelInfo.numOfChannels) |
| 2569 | { |
| 2570 | channel = pBgScanParams->ChannelInfo.ChannelList[0]; |
| 2571 | scanReq.ChannelInfo.ChannelList = &channel; |
| 2572 | } |
| 2573 | else |
| 2574 | { |
| 2575 | scanReq.ChannelInfo.ChannelList = pBgScanParams->ChannelInfo.ChannelList; |
| 2576 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2577 | |
| 2578 | scanReq.BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE; |
| 2579 | scanReq.scanType = eSIR_ACTIVE_SCAN; |
| 2580 | scanReq.requestType = eCSR_SCAN_HO_BG_SCAN; |
| 2581 | scanReq.maxChnTime = pBgScanParams->maxChnTime; |
| 2582 | scanReq.minChnTime = pBgScanParams->minChnTime; |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2583 | |
| 2584 | userData = vos_mem_malloc(sizeof(tANI_U32)); |
| 2585 | if (NULL == userData) |
| 2586 | { |
| 2587 | smsLog(pMac, LOGE, FL("Failed to allocate memory for scan request")); |
| 2588 | vos_mem_free(scanReq.SSIDs.SSIDList); |
| 2589 | return eHAL_STATUS_FAILURE; |
| 2590 | } |
| 2591 | *((tANI_U32*)userData) = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2592 | status = csrScanRequest(pMac, CSR_SESSION_ID_INVALID, &scanReq, |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2593 | &scanId, callbackfn, (void *) userData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2594 | if (eHAL_STATUS_SUCCESS != status) |
| 2595 | { |
| 2596 | smsLog(pMac, LOGE, FL("CSR Scan Request failed with status %d"), status); |
| 2597 | vos_mem_free(scanReq.SSIDs.SSIDList); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2598 | vos_mem_free(userData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2599 | return status; |
| 2600 | } |
| 2601 | pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_TRUE; |
| 2602 | |
| 2603 | vos_mem_free(scanReq.SSIDs.SSIDList); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2604 | if (1 == pBgScanParams->ChannelInfo.numOfChannels) |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 2605 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %p, Actual index = %d"), |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2606 | &pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList[0], |
| 2607 | pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex); |
| 2608 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2609 | return status; |
| 2610 | } |
| 2611 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2612 | static void csrNeighborRoamFillNonChannelBgScanParams (tpAniSirGlobal pMac, |
| 2613 | tpCsrBGScanRequest bgScanParams) |
| 2614 | { |
| 2615 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 2616 | tANI_U8 broadcastBssid[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
| 2617 | |
| 2618 | vos_mem_copy(bgScanParams->bssid, broadcastBssid, sizeof(tCsrBssid)); |
| 2619 | bgScanParams->SSID.length = pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length; |
| 2620 | vos_mem_copy(bgScanParams->SSID.ssId, |
| 2621 | pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.ssId, |
| 2622 | pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length); |
| 2623 | |
| 2624 | bgScanParams->minChnTime = pNeighborRoamInfo->cfgParams.minChannelScanTime; |
| 2625 | bgScanParams->maxChnTime = pNeighborRoamInfo->cfgParams.maxChannelScanTime; |
| 2626 | } |
| 2627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2628 | /* --------------------------------------------------------------------------- |
| 2629 | |
| 2630 | \fn csrNeighborRoamPerformBgScan |
| 2631 | |
| 2632 | \brief This function is invoked on every expiry of neighborScanTimer till all |
| 2633 | the channels in the channel list are scanned. It populates necessary |
| 2634 | parameters for BG scan and calls appropriate AP to invoke the CSR scan |
| 2635 | request |
| 2636 | |
| 2637 | \param pMac - The handle returned by macOpen. |
| 2638 | |
| 2639 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 2640 | |
| 2641 | ---------------------------------------------------------------------------*/ |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2642 | eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2643 | { |
| 2644 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2645 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 2646 | tCsrBGScanRequest bgScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2647 | tANI_U8 channel = 0; |
| 2648 | |
Abhishek Singh | 5c30c82 | 2014-04-07 15:15:40 +0530 | [diff] [blame] | 2649 | if ( pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList && |
| 2650 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2651 | { |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 2652 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %p"), &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[0]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2653 | } |
| 2654 | else |
| 2655 | { |
| 2656 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Channel List Empty")); |
Jeff Johnson | 902c983 | 2012-12-10 14:28:09 -0800 | [diff] [blame] | 2657 | // Go back and restart. Mostly timer start failure has occurred. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2658 | // When timer start is declared a failure, then we delete the list. |
| 2659 | // Should not happen now as we stop and then only start the scan timer. |
| 2660 | // still handle the unlikely case. |
| 2661 | csrNeighborRoamHandleEmptyScanResult(pMac); |
| 2662 | return status; |
| 2663 | } |
James Zmuda | 9ea1edd | 2013-04-18 18:20:54 -0700 | [diff] [blame] | 2664 | |
| 2665 | /* Validate the currentChanIndex value before using it to index the ChannelList array */ |
| 2666 | if ( pNeighborRoamInfo->roamChannelInfo.currentChanIndex |
| 2667 | > pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels) |
| 2668 | { |
| 2669 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Invalid channel index: %d"), pNeighborRoamInfo->roamChannelInfo.currentChanIndex); |
| 2670 | // Go back and restart. |
| 2671 | csrNeighborRoamHandleEmptyScanResult(pMac); |
| 2672 | return status; |
| 2673 | } |
| 2674 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | /* Need to perform scan here before getting the list */ |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2676 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2677 | vos_mem_set(&bgScanParams, sizeof(tCsrBGScanRequest), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2678 | |
| 2679 | channel = pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[pNeighborRoamInfo->roamChannelInfo.currentChanIndex]; |
| 2680 | bgScanParams.ChannelInfo.numOfChannels = 1; |
| 2681 | bgScanParams.ChannelInfo.ChannelList = &channel; |
Sandeep Puligilla | c80f26e | 2014-03-11 18:36:10 +0530 | [diff] [blame] | 2682 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2683 | csrNeighborRoamFillNonChannelBgScanParams(pMac, &bgScanParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2684 | |
Sandeep Puligilla | c80f26e | 2014-03-11 18:36:10 +0530 | [diff] [blame] | 2685 | /* Update the passive scan time for DFS channel */ |
| 2686 | if ((TRUE == CSR_IS_CHANNEL_DFS(channel)) && |
| 2687 | (TRUE == pMac->roam.configParam.allowDFSChannelRoam)) |
| 2688 | { |
| 2689 | bgScanParams.minChnTime = pMac->roam.configParam.nPassiveMinChnTime; |
| 2690 | bgScanParams.maxChnTime = pMac->roam.configParam.nPassiveMaxChnTime; |
| 2691 | } |
| 2692 | |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2693 | status = csrNeighborRoamIssueBgScanRequest(pMac, &bgScanParams, |
| 2694 | sessionId, csrNeighborRoamScanRequestCallback); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2695 | if (eHAL_STATUS_SUCCESS != status) |
| 2696 | { |
| 2697 | smsLog(pMac, LOGE, FL("Issue of BG Scan request failed: Status = %d"), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2698 | } |
| 2699 | |
| 2700 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex++; |
| 2701 | if (pNeighborRoamInfo->roamChannelInfo.currentChanIndex >= |
| 2702 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels) |
| 2703 | { |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 2704 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Completed scanning channels in Channel List: CurrChanIndex = %d, Num Channels = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex, |
| 2706 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels); |
| 2707 | /* We have completed scanning all the channels */ |
| 2708 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex = 0; |
| 2709 | /* We are no longer scanning the channel list. Next timer firing should be used to get the scan results |
| 2710 | and select the best AP in the list */ |
| 2711 | if (eANI_BOOLEAN_TRUE == pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress) |
| 2712 | { |
| 2713 | pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress = eANI_BOOLEAN_FALSE; |
| 2714 | } |
| 2715 | } |
| 2716 | |
Gopichand Nakkala | c7b1d3e | 2012-12-31 14:07:19 -0800 | [diff] [blame] | 2717 | if (eHAL_STATUS_SUCCESS != status) |
| 2718 | { |
| 2719 | /* |
| 2720 | * If the status is not success, we need to call the callback |
| 2721 | * routine so that the state machine does not get stuck. |
| 2722 | */ |
| 2723 | csrNeighborRoamScanRequestCallback(pMac, NULL, 0, eCSR_SCAN_FAILURE); |
| 2724 | } |
| 2725 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2726 | return status; |
| 2727 | } |
| 2728 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2729 | #ifdef FEATURE_WLAN_LFR |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2730 | eHalStatus csrNeighborRoamScanForInitialForced5GRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId) |
| 2731 | { |
| 2732 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2733 | tCsrBGScanRequest bgScanParams; |
| 2734 | tANI_U8 numOfChannels = 0, i = 0; |
| 2735 | tANI_U8 tempChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 2736 | tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 2737 | tANI_U8 tempNumOfChannels = 0; |
| 2738 | |
| 2739 | vos_mem_set(&bgScanParams, sizeof(tCsrBGScanRequest), 0); |
| 2740 | /* Contiguously scan all channels from valid list */ |
| 2741 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "%s: get valid channel list", __func__); |
| 2742 | tempNumOfChannels = sizeof(pMac->roam.validChannelList); |
| 2743 | |
| 2744 | if(HAL_STATUS_SUCCESS(csrGetCfgValidChannels(pMac, |
| 2745 | (tANI_U8 *)pMac->roam.validChannelList, |
| 2746 | (tANI_U32 *) &tempNumOfChannels))) |
| 2747 | { |
| 2748 | //Make sure we are scanning only for 5Ghz AP only |
| 2749 | //Filetring out the 5GHZ based AP.from valid channel list |
| 2750 | csrNeighborRoamChannelsFilterByBand( |
| 2751 | pMac, |
| 2752 | pMac->roam.validChannelList, |
| 2753 | tempNumOfChannels, |
| 2754 | tempChannelList, |
| 2755 | &tempNumOfChannels, |
| 2756 | SIR_BAND_5_GHZ |
| 2757 | ); |
| 2758 | for (i = 0; (i < tempNumOfChannels &&(i < WNI_CFG_VALID_CHANNEL_LIST_LEN)); i++) |
| 2759 | { |
| 2760 | /* DFS channel will be added in the list only when the |
| 2761 | DFS Roaming scan flag is enabled*/ |
| 2762 | if (CSR_IS_CHANNEL_DFS(tempChannelList[i])) |
| 2763 | { |
| 2764 | if (pMac->roam.configParam.allowDFSChannelRoam == TRUE) |
| 2765 | { |
| 2766 | channelList[numOfChannels++] = tempChannelList[i]; |
| 2767 | } |
| 2768 | } |
| 2769 | else |
| 2770 | { |
| 2771 | channelList[numOfChannels++] = tempChannelList[i]; |
| 2772 | } |
| 2773 | } |
| 2774 | } |
| 2775 | else |
| 2776 | { |
| 2777 | smsLog(pMac, LOGW, FL("csrGetCfgValidChannels got failed ")); |
| 2778 | return eHAL_STATUS_FAILURE; |
| 2779 | } |
| 2780 | |
| 2781 | if(numOfChannels == 0) |
| 2782 | { |
| 2783 | smsLog(pMac, LOGE, |
| 2784 | FL(" No valid 5Ghz channel present so skipping Initial Forced 5Gh roaming")); |
| 2785 | return VOS_STATUS_E_EMPTY; |
| 2786 | } |
| 2787 | if (numOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 2788 | { |
| 2789 | numOfChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 2790 | } |
| 2791 | |
| 2792 | bgScanParams.ChannelInfo.numOfChannels = numOfChannels; |
| 2793 | bgScanParams.ChannelInfo.ChannelList = channelList; |
| 2794 | for (i = 0; i < numOfChannels; i++) |
| 2795 | { |
| 2796 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: valid channel list = %d", |
| 2797 | __func__, bgScanParams.ChannelInfo.ChannelList[i]); |
| 2798 | } |
| 2799 | csrNeighborRoamFillNonChannelBgScanParams(pMac, &bgScanParams); |
| 2800 | |
| 2801 | status = csrNeighborRoamIssueBgScanRequest(pMac, &bgScanParams, |
| 2802 | sessionId, csrNeighborRoamForceRoamTo5GhScanCb); |
| 2803 | |
| 2804 | if (eHAL_STATUS_SUCCESS != status) |
| 2805 | { |
| 2806 | smsLog(pMac, LOGE, FL("Forced intial roam to 5Gh request failed: Status = %d"), status); |
Mukul Sharma | 1fa759f | 2015-01-02 17:12:44 +0530 | [diff] [blame] | 2807 | } |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2808 | return status; |
| 2809 | } |
| 2810 | #endif |
| 2811 | |
| 2812 | #ifdef FEATURE_WLAN_LFR |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2813 | eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2814 | { |
| 2815 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2816 | tCsrBGScanRequest bgScanParams; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2817 | tANI_U8 numOfChannels = 0, i = 0; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2818 | tANI_U8 *channelList = NULL; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2819 | tANI_U8 *pInChannelList = NULL; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 2820 | tANI_U8 tmpChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2821 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2822 | vos_mem_set(&bgScanParams, sizeof(tCsrBGScanRequest), 0); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2823 | |
| 2824 | /* Contiguously scan all channels from valid list */ |
| 2825 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "%s: get valid channel list", __func__); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2826 | |
Srinivas Girigowda | 5607685 | 2013-08-20 14:00:50 -0700 | [diff] [blame] | 2827 | numOfChannels = sizeof(pMac->roam.validChannelList); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2828 | |
Srinivas Girigowda | 5607685 | 2013-08-20 14:00:50 -0700 | [diff] [blame] | 2829 | if(!HAL_STATUS_SUCCESS(csrGetCfgValidChannels(pMac, |
| 2830 | (tANI_U8 *)pMac->roam.validChannelList, |
| 2831 | (tANI_U32 *) &numOfChannels))) |
| 2832 | { |
| 2833 | smsLog(pMac, LOGE, FL("Could not get valid channel list")); |
| 2834 | return eHAL_STATUS_FAILURE; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2835 | } |
Srinivas Girigowda | 5607685 | 2013-08-20 14:00:50 -0700 | [diff] [blame] | 2836 | pInChannelList = pMac->roam.validChannelList; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 2837 | |
| 2838 | if (CSR_IS_ROAM_INTRA_BAND_ENABLED(pMac)) |
| 2839 | { |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2840 | csrNeighborRoamChannelsFilterByBand( |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 2841 | pMac, |
| 2842 | pInChannelList, |
| 2843 | numOfChannels, |
| 2844 | tmpChannelList, |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 2845 | &numOfChannels, |
| 2846 | GetRFBand(pMac->roam.neighborRoamInfo.currAPoperationChannel)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 2847 | pInChannelList = tmpChannelList; |
| 2848 | } |
| 2849 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2850 | channelList = vos_mem_malloc(numOfChannels); |
| 2851 | if ( NULL == channelList ) |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2852 | { |
| 2853 | smsLog(pMac, LOGE, FL("could not allocate memory for channelList")); |
| 2854 | return eHAL_STATUS_FAILURE; |
| 2855 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2856 | vos_mem_copy(channelList, (tANI_U8 *)pInChannelList, |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2857 | numOfChannels * sizeof(tANI_U8)); |
| 2858 | |
| 2859 | bgScanParams.ChannelInfo.numOfChannels = numOfChannels; |
| 2860 | bgScanParams.ChannelInfo.ChannelList = channelList; |
| 2861 | for (i = 0; i < numOfChannels; i++) |
| 2862 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2863 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: valid channel list = %d", |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2864 | __func__, bgScanParams.ChannelInfo.ChannelList[i]); |
| 2865 | } |
| 2866 | csrNeighborRoamFillNonChannelBgScanParams(pMac, &bgScanParams); |
| 2867 | |
| 2868 | status = csrNeighborRoamIssueBgScanRequest(pMac, &bgScanParams, |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 2869 | sessionId, csrNeighborRoamContiguousScanRequestCallback); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2870 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2871 | vos_mem_free(channelList); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 2872 | |
| 2873 | if (eHAL_STATUS_SUCCESS != status) |
| 2874 | { |
| 2875 | smsLog(pMac, LOGE, FL("Issue of BG Scan request failed: Status = %d"), status); |
| 2876 | } |
| 2877 | |
| 2878 | return status; |
| 2879 | } |
| 2880 | #endif |
| 2881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2882 | /* --------------------------------------------------------------------------- |
| 2883 | |
| 2884 | \fn csrNeighborRoamNeighborScanTimerCallback |
| 2885 | |
| 2886 | \brief This function is the neighbor scan timer callback function. It invokes |
| 2887 | the BG scan request based on the current and previous states |
| 2888 | |
| 2889 | \param pv - CSR timer context info which includes pMac and session ID |
| 2890 | |
| 2891 | \return VOID |
| 2892 | |
| 2893 | ---------------------------------------------------------------------------*/ |
| 2894 | void csrNeighborRoamNeighborScanTimerCallback(void *pv) |
| 2895 | { |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 2896 | tpAniSirGlobal pMac = PMAC_STRUCT( pv ); |
| 2897 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo; |
| 2898 | if(!pMac) |
| 2899 | { |
| 2900 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); |
| 2901 | return; |
| 2902 | } |
| 2903 | pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2904 | |
| 2905 | // check if bg scan is on going, no need to send down the new params if true |
| 2906 | if(eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending) |
| 2907 | { |
| 2908 | //msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2909 | smsLog(pMac, LOGW, FL("Already BgScanRsp is Pending")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | return; |
| 2911 | } |
| 2912 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2913 | switch (pNeighborRoamInfo->neighborRoamState) |
| 2914 | { |
| 2915 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2916 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2917 | switch(pNeighborRoamInfo->prevNeighborRoamState) |
| 2918 | { |
| 2919 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY: |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 2920 | csrNeighborRoamPerformBgScan(pMac, pNeighborRoamInfo->csrSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2921 | break; |
| 2922 | default: |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2923 | smsLog(pMac, LOGE, FL("Neighbor scan callback received in" |
| 2924 | "state %s, prev state = %s"), |
| 2925 | macTraceGetNeighbourRoamState( |
| 2926 | pNeighborRoamInfo->neighborRoamState), |
| 2927 | macTraceGetNeighbourRoamState( |
| 2928 | pNeighborRoamInfo->prevNeighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2929 | break; |
| 2930 | } |
| 2931 | break; |
| 2932 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 2933 | case eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN: |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 2934 | csrNeighborRoamPerformBgScan(pMac, pNeighborRoamInfo->csrSessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2935 | break; |
| 2936 | default: |
| 2937 | break; |
| 2938 | } |
| 2939 | return; |
| 2940 | } |
| 2941 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2942 | void csrNeighborRoamEmptyScanRefreshTimerCallback(void *context) |
| 2943 | { |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 2944 | tpAniSirGlobal pMac = PMAC_STRUCT( context ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2945 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 2946 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo; |
| 2947 | if(!pMac) |
| 2948 | { |
| 2949 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); |
| 2950 | return; |
| 2951 | } |
| 2952 | pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2953 | |
| 2954 | /* Reset all the variables just as no scan had happened before */ |
| 2955 | csrNeighborRoamResetConnectedStateControlInfo(pMac); |
| 2956 | |
| 2957 | #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI |
| 2958 | if ((pNeighborRoamInfo->is11rAssoc) && (pMac->rrm.rrmSmeContext.rrmConfig.rrmEnabled)) |
| 2959 | { |
| 2960 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("11R Association:Neighbor Lookup Down event received in CONNECTED state")); |
| 2961 | vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); |
| 2962 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 2963 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 2964 | smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2965 | return; |
| 2966 | } |
| 2967 | /* Increment the neighbor report retry count after sending the neighbor request successfully */ |
| 2968 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; |
| 2969 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; |
| 2970 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY) |
| 2971 | } |
| 2972 | else |
| 2973 | #endif |
| 2974 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2975 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Non 11R or ESE Association:empty scan refresh timer expired")); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2976 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 2977 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 2978 | { |
| 2979 | return; |
| 2980 | } |
| 2981 | } |
| 2982 | return; |
| 2983 | } |
| 2984 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2985 | /* --------------------------------------------------------------------------- |
| 2986 | |
| 2987 | \fn csrNeighborRoamResultsRefreshTimerCallback |
| 2988 | |
| 2989 | \brief This function is the timer callback function for results refresh timer. |
| 2990 | When this is invoked, it is as good as down event received from TL. So, |
| 2991 | clear off the roamable AP list and start the scan procedure based on 11R |
| 2992 | or non-11R association |
| 2993 | |
| 2994 | \param context - CSR timer context info which includes pMac and session ID |
| 2995 | |
| 2996 | \return VOID |
| 2997 | |
| 2998 | ---------------------------------------------------------------------------*/ |
| 2999 | void csrNeighborRoamResultsRefreshTimerCallback(void *context) |
| 3000 | { |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 3001 | tpAniSirGlobal pMac = PMAC_STRUCT( context ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3002 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 3003 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo; |
| 3004 | |
| 3005 | if(!pMac) |
| 3006 | { |
| 3007 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); |
| 3008 | return; |
| 3009 | } |
| 3010 | pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3011 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3012 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering DOWN event reassoc callback with TL. RSSI = %d"), pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); |
| 3013 | |
| 3014 | /* Deregister reassoc callback. Ignore return status */ |
| 3015 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), |
| 3016 | WLANTL_HO_THRESHOLD_DOWN, |
| 3017 | csrNeighborRoamReassocIndCallback, |
| 3018 | VOS_MODULE_ID_SME); |
| 3019 | |
| 3020 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 3021 | { |
| 3022 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3023 | smsLog(pMac, LOGW, FL(" Couldn't deregister csrNeighborRoamReassocIndCallback with TL: Status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3024 | } |
| 3025 | |
| 3026 | /* Reset all the variables just as no scan had happened before */ |
| 3027 | csrNeighborRoamResetConnectedStateControlInfo(pMac); |
| 3028 | |
| 3029 | #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI |
| 3030 | if ((pNeighborRoamInfo->is11rAssoc) && (pMac->rrm.rrmSmeContext.rrmConfig.rrmEnabled)) |
| 3031 | { |
| 3032 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("11R Association:Neighbor Lookup Down event received in CONNECTED state")); |
| 3033 | vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); |
| 3034 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 3035 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3036 | smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3037 | return; |
| 3038 | } |
| 3039 | /* Increment the neighbor report retry count after sending the neighbor request successfully */ |
| 3040 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; |
| 3041 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; |
| 3042 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY) |
| 3043 | } |
| 3044 | else |
| 3045 | #endif |
| 3046 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3047 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Non 11R or ESE Association:results refresh timer expired")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3048 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 3049 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 3050 | { |
| 3051 | return; |
| 3052 | } |
| 3053 | } |
| 3054 | return; |
| 3055 | } |
| 3056 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3057 | /* --------------------------------------------------------------------------- |
| 3058 | |
| 3059 | \fn csrForcedInitialRoamTo5GHTimerCallback |
| 3060 | |
| 3061 | \brief This function is the timer callback function for triggering |
| 3062 | roaming to 5GHz after the initial association. |
| 3063 | |
| 3064 | \param context - CSR timer context info which includes pMac and session ID |
| 3065 | |
| 3066 | \return VOID |
| 3067 | |
| 3068 | ---------------------------------------------------------------------------*/ |
| 3069 | |
| 3070 | void csrForcedInitialRoamTo5GHTimerCallback(void *context) |
| 3071 | { |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 3072 | tpAniSirGlobal pMac = PMAC_STRUCT( context ); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3073 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 3074 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo; |
| 3075 | if(!pMac) |
| 3076 | { |
| 3077 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is Null")); |
| 3078 | return; |
| 3079 | } |
| 3080 | pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3081 | |
| 3082 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("forcedInitialRoamTo5GHTimer timer expired")); |
| 3083 | |
| 3084 | //we don't need to run this timer any more |
| 3085 | vos_timer_stop(&pNeighborRoamInfo->forcedInitialRoamTo5GHTimer); |
| 3086 | |
| 3087 | //we must be in connected state, if not ignore it |
| 3088 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) |
| 3089 | { |
| 3090 | smsLog(pMac, LOGE, FL("Received in not CONNECTED state. Ignore it")); |
Mukul Sharma | 5b2ff50 | 2014-11-06 14:43:50 +0530 | [diff] [blame] | 3091 | return; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3092 | } |
| 3093 | |
| 3094 | //it may possible user reconnected / DUT roamed to other band ap btw |
| 3095 | //timer started and timer callback hit. |
| 3096 | if(GetRFBand(pMac->roam.neighborRoamInfo.currAPoperationChannel) == SIR_BAND_5_GHZ) |
| 3097 | { |
| 3098 | smsLog(pMac, LOGE, |
| 3099 | FL("DUT is already connected to 5GH ap, so no need to trigger forced roam.")); |
Mukul Sharma | 5b2ff50 | 2014-11-06 14:43:50 +0530 | [diff] [blame] | 3100 | return; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3101 | } |
| 3102 | |
Deepthi Gowri | 4480a3f | 2016-05-18 19:30:17 +0530 | [diff] [blame] | 3103 | pNeighborRoamInfo->scanRequestTimeStamp = vos_timer_get_system_time(); |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 3104 | /* |
| 3105 | * We are about to start a fresh scan cycle for all valid channles for 5Ghz |
| 3106 | * purge non-P2P results from the past for 5Ghz band |
| 3107 | */ |
| 3108 | csrScanFlushSelectiveResultForBand(pMac, VOS_FALSE, SIR_BAND_5_GHZ); |
| 3109 | status = csrNeighborRoamScanForInitialForced5GRoaming( |
| 3110 | pMac, pNeighborRoamInfo->csrSessionId); |
| 3111 | if(status != eHAL_STATUS_SUCCESS) |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3112 | { |
| 3113 | smsLog(pMac, LOGE, |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 3114 | FL("csrNeighborRoamScanForInitialForced5GRoaming failed status=%d"), status); |
| 3115 | //Send RSO start because in case 5G roaming host have not enabled at initial connection |
| 3116 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); |
| 3117 | return; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3118 | } |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 3119 | |
| 3120 | /* Transition to CFG_CHAN_LIST_SCAN */ |
| 3121 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3122 | } |
| 3123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3124 | #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI |
| 3125 | /* --------------------------------------------------------------------------- |
| 3126 | |
| 3127 | \fn csrNeighborRoamIssueNeighborRptRequest |
| 3128 | |
| 3129 | \brief This function is invoked when TL issues a down event and the current assoc |
| 3130 | is a 11R association. It invokes SME RRM API to issue the neighbor request to |
| 3131 | the currently associated AP with the current SSID |
| 3132 | |
| 3133 | \param pMac - The handle returned by macOpen. |
| 3134 | |
| 3135 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 3136 | |
| 3137 | ---------------------------------------------------------------------------*/ |
| 3138 | VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac) |
| 3139 | { |
| 3140 | tRrmNeighborRspCallbackInfo callbackInfo; |
| 3141 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3142 | tRrmNeighborReq neighborReq; |
| 3143 | |
| 3144 | |
| 3145 | neighborReq.no_ssid = 0; |
| 3146 | |
| 3147 | /* Fill in the SSID */ |
| 3148 | neighborReq.ssid.length = pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length; |
| 3149 | vos_mem_copy(neighborReq.ssid.ssId, pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.ssId, |
| 3150 | pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length); |
| 3151 | |
| 3152 | callbackInfo.neighborRspCallback = csrNeighborRoamRRMNeighborReportResult; |
| 3153 | callbackInfo.neighborRspCallbackContext = pMac; |
| 3154 | callbackInfo.timeout = pNeighborRoamInfo->FTRoamInfo.neighborReportTimeout; |
| 3155 | |
| 3156 | return sme_NeighborReportRequest(pMac,(tANI_U8) pNeighborRoamInfo->csrSessionId, &neighborReq, &callbackInfo); |
| 3157 | } |
| 3158 | |
| 3159 | /* --------------------------------------------------------------------------- |
| 3160 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3161 | \fn csrNeighborRoamChannelsFilterByBand |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3162 | |
| 3163 | \brief This function is used to filter out the channels |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3164 | based on the Band given as input |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3165 | |
| 3166 | \param pMac - The handle returned by macOpen. |
| 3167 | \param pInputChannelList - The input channel list |
| 3168 | \param inputNumOfChannels - The number of channels in input channel list |
| 3169 | \param pOutputChannelList - The output channel list |
| 3170 | \param outputNumOfChannels - The number of channels in output channel list |
| 3171 | \param pMergedOutputNumOfChannels - The final number of channels in the output channel list. |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3172 | \param band - The band which will be get compared with the input channel list band |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3173 | |
| 3174 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 3175 | |
| 3176 | ---------------------------------------------------------------------------*/ |
| 3177 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3178 | VOS_STATUS csrNeighborRoamChannelsFilterByBand( |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3179 | tpAniSirGlobal pMac, |
| 3180 | tANI_U8* pInputChannelList, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3181 | tANI_U8 inputNumOfChannels, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3182 | tANI_U8* pOutputChannelList, |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3183 | tANI_U8* pMergedOutputNumOfChannels, |
| 3184 | tSirRFBand band |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3185 | ) |
| 3186 | { |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3187 | tANI_U8 i = 0; |
| 3188 | tANI_U8 numChannels = 0; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3189 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3190 | // Check for NULL pointer |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3191 | if (!pInputChannelList) return VOS_STATUS_E_INVAL; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3192 | |
| 3193 | // Check for NULL pointer |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3194 | if (!pOutputChannelList) return VOS_STATUS_E_INVAL; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3195 | |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3196 | if (inputNumOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 3197 | { |
| 3198 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3199 | "%s: Wrong Number of Input Channels %d", |
| 3200 | __func__, inputNumOfChannels); |
| 3201 | return VOS_STATUS_E_INVAL; |
| 3202 | } |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3203 | for (i = 0; i < inputNumOfChannels; i++) |
| 3204 | { |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3205 | if (band == GetRFBand(pInputChannelList[i])) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3206 | { |
| 3207 | pOutputChannelList[numChannels] = pInputChannelList[i]; |
| 3208 | numChannels++; |
| 3209 | } |
| 3210 | } |
| 3211 | |
| 3212 | // Return final number of channels |
| 3213 | *pMergedOutputNumOfChannels = numChannels; |
| 3214 | |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3215 | return VOS_STATUS_SUCCESS; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3216 | } |
| 3217 | |
| 3218 | /* --------------------------------------------------------------------------- |
| 3219 | |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3220 | \fn csrNeighborRoamMergeChannelLists |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3221 | |
| 3222 | \brief This function is used to merge two channel list. |
| 3223 | NB: If called with outputNumOfChannels == 0, this routines |
| 3224 | simply copies the input channel list to the output channel list. |
| 3225 | |
| 3226 | \param pMac - The handle returned by macOpen. |
| 3227 | \param pInputChannelList - The addtional channels to merge in to the "merged" channels list. |
| 3228 | \param inputNumOfChannels - The number of additional channels. |
| 3229 | \param pOutputChannelList - The place to put the "merged" channel list. |
| 3230 | \param outputNumOfChannels - The original number of channels in the "merged" channels list. |
| 3231 | \param pMergedOutputNumOfChannels - The final number of channels in the "merged" channel list. |
| 3232 | |
| 3233 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 3234 | |
| 3235 | ---------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3236 | VOS_STATUS csrNeighborRoamMergeChannelLists( |
| 3237 | tpAniSirGlobal pMac, |
| 3238 | tANI_U8 *pInputChannelList, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3239 | tANI_U8 inputNumOfChannels, |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3240 | tANI_U8 *pOutputChannelList, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3241 | tANI_U8 outputNumOfChannels, |
| 3242 | tANI_U8 *pMergedOutputNumOfChannels |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3243 | ) |
| 3244 | { |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3245 | tANI_U8 i = 0; |
| 3246 | tANI_U8 j = 0; |
| 3247 | tANI_U8 numChannels = outputNumOfChannels; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3248 | |
| 3249 | // Check for NULL pointer |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3250 | if (!pInputChannelList) return VOS_STATUS_E_INVAL; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3251 | |
| 3252 | // Check for NULL pointer |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3253 | if (!pOutputChannelList) return VOS_STATUS_E_INVAL; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3254 | |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3255 | if (inputNumOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 3256 | { |
| 3257 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3258 | "%s: Wrong Number of Input Channels %d", |
| 3259 | __func__, inputNumOfChannels); |
| 3260 | return VOS_STATUS_E_INVAL; |
| 3261 | } |
Kaushik, Sushant | c31ea48 | 2014-05-03 13:37:26 +0530 | [diff] [blame] | 3262 | if (outputNumOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 3263 | { |
| 3264 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3265 | "%s: Wrong Number of Output Channels %d", |
| 3266 | __func__, inputNumOfChannels); |
| 3267 | return VOS_STATUS_E_INVAL; |
| 3268 | } |
| 3269 | |
| 3270 | /* Add the "new" channels in the input list to the end of the output list. |
| 3271 | Check added in for loop to make sure outputlist doesn't exceeds valid |
| 3272 | channel list length. */ |
| 3273 | for (i = 0; (i < inputNumOfChannels) && (numChannels < WNI_CFG_VALID_CHANNEL_LIST_LEN); i++) |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3274 | { |
| 3275 | for (j = 0; j < outputNumOfChannels; j++) |
| 3276 | { |
| 3277 | if (pInputChannelList[i] == pOutputChannelList[j]) |
| 3278 | break; |
| 3279 | } |
| 3280 | if (j == outputNumOfChannels) |
| 3281 | { |
| 3282 | if (pInputChannelList[i]) |
| 3283 | { |
Madan Mohan Koyyalamudi | f5c368b | 2012-12-06 13:10:13 -0800 | [diff] [blame] | 3284 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3285 | "%s: [INFOLOG] Adding extra %d to Neighbor channel list", __func__, |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3286 | pInputChannelList[i]); |
| 3287 | pOutputChannelList[numChannels] = pInputChannelList[i]; |
| 3288 | numChannels++; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3289 | } |
| 3290 | } |
| 3291 | } |
| 3292 | |
| 3293 | // Return final number of channels |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3294 | *pMergedOutputNumOfChannels = numChannels; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3295 | |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3296 | return VOS_STATUS_SUCCESS; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3297 | } |
| 3298 | |
| 3299 | /* --------------------------------------------------------------------------- |
| 3300 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3301 | \fn csrNeighborRoamCreateChanListFromNeighborReport |
| 3302 | |
| 3303 | \brief This function is invoked when neighbor report is received for the |
| 3304 | neighbor request. Based on the channels present in the neighbor report, |
| 3305 | it generates channel list which will be used in REPORT_SCAN state to |
| 3306 | scan for these neighbor APs |
| 3307 | |
| 3308 | \param pMac - The handle returned by macOpen. |
| 3309 | |
| 3310 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 3311 | |
| 3312 | ---------------------------------------------------------------------------*/ |
| 3313 | VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac) |
| 3314 | { |
Abhishek Singh | 8f1a5b3 | 2014-04-10 14:37:52 +0530 | [diff] [blame] | 3315 | tpRrmNeighborReportDesc pNeighborBssDesc; |
| 3316 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3317 | tANI_U8 numChannels = 0; |
| 3318 | tANI_U8 i = 0; |
| 3319 | tANI_U8 channelList[MAX_BSS_IN_NEIGHBOR_RPT]; |
| 3320 | tANI_U8 mergedOutputNumOfChannels = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3321 | |
| 3322 | /* This should always start from 0 whenever we create a channel list out of neighbor AP list */ |
| 3323 | pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; |
| 3324 | |
| 3325 | pNeighborBssDesc = smeRrmGetFirstBssEntryFromNeighborCache(pMac); |
| 3326 | |
| 3327 | while (pNeighborBssDesc) |
| 3328 | { |
| 3329 | if (pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport >= MAX_BSS_IN_NEIGHBOR_RPT) break; |
| 3330 | |
| 3331 | /* Update the neighbor BSS Info in the 11r FT Roam Info */ |
| 3332 | pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo[pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport].channelNum = |
| 3333 | pNeighborBssDesc->pNeighborBssDescription->channel; |
| 3334 | pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo[pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport].neighborScore = |
| 3335 | (tANI_U8)pNeighborBssDesc->roamScore; |
| 3336 | vos_mem_copy(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo[pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport].neighborBssId, |
| 3337 | pNeighborBssDesc->pNeighborBssDescription->bssId, sizeof(tSirMacAddr)); |
| 3338 | pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport++; |
| 3339 | |
| 3340 | /* Saving the channel list non-redundantly */ |
Abhishek Singh | 8f1a5b3 | 2014-04-10 14:37:52 +0530 | [diff] [blame] | 3341 | for (i = 0; (i < numChannels && i < MAX_BSS_IN_NEIGHBOR_RPT); i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3342 | { |
Abhishek Singh | 8f1a5b3 | 2014-04-10 14:37:52 +0530 | [diff] [blame] | 3343 | if (pNeighborBssDesc->pNeighborBssDescription->channel == channelList[i]) |
| 3344 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3345 | } |
Abhishek Singh | 8f1a5b3 | 2014-04-10 14:37:52 +0530 | [diff] [blame] | 3346 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3347 | if (i == numChannels) |
| 3348 | { |
| 3349 | if (pNeighborBssDesc->pNeighborBssDescription->channel) |
| 3350 | { |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3351 | if (CSR_IS_ROAM_INTRA_BAND_ENABLED(pMac)) |
| 3352 | { |
| 3353 | // Make sure to add only if its the same band |
| 3354 | if (GetRFBand(pNeighborRoamInfo->currAPoperationChannel) == |
| 3355 | GetRFBand(pNeighborBssDesc->pNeighborBssDescription->channel)) |
| 3356 | { |
| 3357 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 3358 | "%s: [INFOLOG] Adding %d to Neighbor channel list (Same band)\n", __func__, |
| 3359 | pNeighborBssDesc->pNeighborBssDescription->channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3360 | channelList[numChannels] = pNeighborBssDesc->pNeighborBssDescription->channel; |
| 3361 | numChannels++; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3362 | } |
| 3363 | } |
| 3364 | else |
| 3365 | { |
| 3366 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 3367 | "%s: [INFOLOG] Adding %d to Neighbor channel list\n", __func__, |
| 3368 | pNeighborBssDesc->pNeighborBssDescription->channel); |
| 3369 | channelList[numChannels] = pNeighborBssDesc->pNeighborBssDescription->channel; |
| 3370 | numChannels++; |
| 3371 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3372 | } |
| 3373 | } |
| 3374 | |
| 3375 | pNeighborBssDesc = smeRrmGetNextBssEntryFromNeighborCache(pMac, pNeighborBssDesc); |
| 3376 | } |
| 3377 | |
| 3378 | if (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList) |
| 3379 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3380 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 3381 | } |
| 3382 | |
| 3383 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 3384 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3385 | /* Store the obtained channel list to the Neighbor Control data structure */ |
| 3386 | if (numChannels) |
| 3387 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = vos_mem_malloc((numChannels) * sizeof(tANI_U8)); |
| 3388 | if (NULL == pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList) |
| 3389 | { |
| 3390 | smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed.. TL event ignored")); |
| 3391 | return VOS_STATUS_E_RESOURCES; |
| 3392 | } |
| 3393 | |
| 3394 | vos_mem_copy(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList, |
| 3395 | channelList, (numChannels) * sizeof(tANI_U8)); |
| 3396 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = numChannels; |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 3397 | /* |
| 3398 | * Create a Union of occupied channel list learnt by the DUT along with the Neighbor |
| 3399 | * report Channels. This increases the chances of the DUT to get a candidate AP while |
| 3400 | * roaming even if the Neighbor Report is not able to provide sufficient information. |
| 3401 | * */ |
| 3402 | if (pMac->scan.occupiedChannels.numChannels) |
| 3403 | { |
| 3404 | csrNeighborRoamMergeChannelLists(pMac, |
| 3405 | &pMac->scan.occupiedChannels.channelList[0], |
| 3406 | pMac->scan.occupiedChannels.numChannels, |
| 3407 | &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[0], |
| 3408 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels, |
| 3409 | &mergedOutputNumOfChannels); |
| 3410 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = |
| 3411 | mergedOutputNumOfChannels; |
| 3412 | |
| 3413 | } |
| 3414 | /*Indicate the firmware about the update only if any new channels are added. |
| 3415 | * Otherwise, the firmware would already be knowing the non-IAPPneighborlist |
| 3416 | * channels. There is no need to update.*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3417 | if (numChannels) |
| 3418 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 3419 | smsLog(pMac, LOG1, FL("IAPP Neighbor list callback received as expected" |
| 3420 | "in state %s."), |
| 3421 | macTraceGetNeighbourRoamState( |
| 3422 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3423 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_TRUE; |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 3424 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 3425 | if (csrRoamIsRoamOffloadScanEnabled(pMac)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 3426 | { |
| 3427 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 3428 | } |
| 3429 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3430 | } |
| 3431 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex = 0; |
| 3432 | pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress = eANI_BOOLEAN_TRUE; |
| 3433 | |
| 3434 | return VOS_STATUS_SUCCESS; |
| 3435 | } |
| 3436 | |
| 3437 | /* --------------------------------------------------------------------------- |
| 3438 | |
| 3439 | \fn csrNeighborRoamRRMNeighborReportResult |
| 3440 | |
| 3441 | \brief This function is the neighbor report callback that will be invoked by |
| 3442 | SME RRM on receiving a neighbor report or of neighbor report is not |
| 3443 | received after timeout. On receiving a valid report, it generates a |
| 3444 | channel list from the neighbor report and starts the |
| 3445 | neighbor scan timer |
| 3446 | |
| 3447 | \param context - The handle returned by macOpen. |
| 3448 | vosStatus - Status of the callback(SUCCESS/FAILURE) |
| 3449 | |
| 3450 | \return VOID |
| 3451 | |
| 3452 | ---------------------------------------------------------------------------*/ |
| 3453 | void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) |
| 3454 | { |
| 3455 | tpAniSirGlobal pMac = PMAC_STRUCT(context); |
| 3456 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3457 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 3458 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3459 | smsLog(pMac, LOG1, FL("Neighbor report result callback with status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3460 | switch (pNeighborRoamInfo->neighborRoamState) |
| 3461 | { |
| 3462 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY: |
| 3463 | /* Reset the report pending variable */ |
| 3464 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_FALSE; |
| 3465 | if (VOS_STATUS_SUCCESS == vosStatus) |
| 3466 | { |
| 3467 | /* Need to create channel list based on the neighbor AP list and transition to REPORT_SCAN state */ |
| 3468 | vosStatus = csrNeighborRoamCreateChanListFromNeighborReport(pMac); |
| 3469 | if (VOS_STATUS_SUCCESS == vosStatus) |
| 3470 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3471 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Channel List created from Neighbor report, Transitioning to NEIGHBOR_SCAN state")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3472 | } |
| 3473 | |
| 3474 | /* We are gonna scan now. Remember the time stamp to filter out results only after this timestamp */ |
Deepthi Gowri | 4480a3f | 2016-05-18 19:30:17 +0530 | [diff] [blame] | 3475 | pNeighborRoamInfo->scanRequestTimeStamp = |
| 3476 | vos_timer_get_system_time(); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3477 | |
| 3478 | /* Now ready for neighbor scan based on the channel list created */ |
| 3479 | /* Start Neighbor scan timer now. Multiplication by PAL_TIMER_TO_MS_UNIT is to convert ms to us which is |
| 3480 | what palTimerStart expects */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 3481 | status = vos_timer_start(&pNeighborRoamInfo->neighborScanTimer, |
| 3482 | pNeighborRoamInfo->cfgParams.neighborScanPeriod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3483 | if (eHAL_STATUS_SUCCESS != status) |
| 3484 | { |
| 3485 | /* Timer start failed.. Should we ASSERT here??? */ |
| 3486 | smsLog(pMac, LOGE, FL("PAL Timer start for neighbor scan timer failed, status = %d, Ignoring state transition"), status); |
| 3487 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 3488 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 3489 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3490 | return; |
| 3491 | } |
| 3492 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; |
| 3493 | /* Neighbor scan timer started. Transition to REPORT_SCAN state */ |
| 3494 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) |
| 3495 | } |
| 3496 | else |
| 3497 | { |
| 3498 | /* Neighbor report timeout happened in SME RRM. We can try sending more neighbor requests until we |
| 3499 | reach the maxNeighborRetries or receiving a successful neighbor response */ |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3500 | smsLog(pMac, LOGE, FL("Neighbor report result failed after %d retries, MAX RETRIES = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3501 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum, pNeighborRoamInfo->cfgParams.maxNeighborRetries); |
| 3502 | if (pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum >= |
| 3503 | pNeighborRoamInfo->cfgParams.maxNeighborRetries) |
| 3504 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3505 | smsLog(pMac, LOGE, FL("Bailing out to CFG Channel list scan.. ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3506 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 3507 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 3508 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3509 | smsLog(pMac, LOGE, FL("Transit to CFG Channel list scan state failed with status %d "), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3510 | return; |
| 3511 | } |
| 3512 | /* We transitioned to different state now. Reset the Neighbor report retry count */ |
| 3513 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; |
| 3514 | } |
| 3515 | else |
| 3516 | { |
| 3517 | vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); |
| 3518 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 3519 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 3520 | smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3521 | return; |
| 3522 | } |
| 3523 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; |
| 3524 | /* Increment the neighbor report retry count after sending the neighbor request successfully */ |
| 3525 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; |
| 3526 | } |
| 3527 | } |
| 3528 | break; |
| 3529 | default: |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 3530 | smsLog(pMac, LOGE, FL("Neighbor result callback not expected in" |
| 3531 | "state %s, Ignoring.."), |
| 3532 | macTraceGetNeighbourRoamState( |
| 3533 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3534 | break; |
| 3535 | } |
| 3536 | return; |
| 3537 | } |
| 3538 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 3539 | |
| 3540 | |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3541 | #ifdef FEATURE_WLAN_LFR |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3542 | tANI_BOOLEAN csrNeighborRoamIsSsidAndSecurityMatch( |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3543 | tpAniSirGlobal pMac, |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3544 | tCsrRoamConnectedProfile *pCurProfile, |
| 3545 | tSirBssDescription *pBssDesc, |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3546 | tDot11fBeaconIEs *pIes) |
| 3547 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3548 | tCsrAuthList authType; |
| 3549 | tCsrEncryptionList uCEncryptionType; |
| 3550 | tCsrEncryptionList mCEncryptionType; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3551 | tANI_BOOLEAN fMatch = FALSE; |
| 3552 | |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3553 | authType.numEntries = 1; |
| 3554 | authType.authType[0] = pCurProfile->AuthType; |
| 3555 | uCEncryptionType.numEntries = 1; |
| 3556 | uCEncryptionType.encryptionType[0] = pCurProfile->EncryptionType; |
| 3557 | mCEncryptionType.numEntries = 1; |
| 3558 | mCEncryptionType.encryptionType[0] = pCurProfile->mcEncryptionType; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3559 | |
| 3560 | if( pIes ) |
| 3561 | { |
| 3562 | if(pIes->SSID.present) |
| 3563 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3564 | fMatch = csrIsSsidMatch( pMac, |
| 3565 | (void *)pCurProfile->SSID.ssId, pCurProfile->SSID.length, |
| 3566 | pIes->SSID.ssid, pIes->SSID.num_ssid, |
| 3567 | eANI_BOOLEAN_TRUE ); |
| 3568 | if(TRUE == fMatch) |
| 3569 | { |
Abhishek Singh | 3b56d3a | 2014-06-25 12:37:39 +0530 | [diff] [blame] | 3570 | /* |
| 3571 | * for now we are sending NULL for all PMF related filter |
| 3572 | * parameters during roam to the neighbor AP because |
| 3573 | * so far 80211W spec doesn't specify anything about |
| 3574 | * roaming scenario. |
| 3575 | * |
| 3576 | * Once roaming scenario is defined, we should re-visit |
| 3577 | * this section and remove this comment. |
| 3578 | */ |
| 3579 | fMatch = csrIsSecurityMatch(pMac, &authType, &uCEncryptionType, |
| 3580 | &mCEncryptionType, |
| 3581 | NULL, NULL, NULL, |
| 3582 | pBssDesc, pIes, NULL, NULL, NULL); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3583 | return (fMatch); |
| 3584 | } |
| 3585 | else |
| 3586 | { |
| 3587 | return (fMatch); |
| 3588 | } |
| 3589 | |
| 3590 | } |
| 3591 | else |
| 3592 | { |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3593 | return FALSE; // Treat a missing SSID as a non-match. |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3594 | } |
| 3595 | } |
| 3596 | else |
| 3597 | { |
| 3598 | return FALSE; // Again, treat missing pIes as a non-match. |
| 3599 | } |
| 3600 | } |
| 3601 | |
| 3602 | tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile( |
| 3603 | tpAniSirGlobal pMac) |
| 3604 | { |
| 3605 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3606 | tANI_U8 sessionId = (tANI_U8)pNeighborRoamInfo->csrSessionId; |
| 3607 | tCsrRoamConnectedProfile *pCurrProfile = NULL; |
| 3608 | tCsrRoamConnectedProfile *pPrevProfile = NULL; |
| 3609 | tDot11fBeaconIEs *pIes = NULL; |
| 3610 | tSirBssDescription *pBssDesc = NULL; |
| 3611 | tANI_BOOLEAN fNew = TRUE; |
| 3612 | |
| 3613 | if(!(pMac->roam.roamSession && CSR_IS_SESSION_VALID(pMac, sessionId))) |
| 3614 | { |
| 3615 | return (fNew); |
| 3616 | } |
| 3617 | |
| 3618 | pCurrProfile = &pMac->roam.roamSession[sessionId].connectedProfile; |
| 3619 | if( !pCurrProfile ) |
| 3620 | { |
| 3621 | return (fNew); |
| 3622 | } |
| 3623 | |
| 3624 | pPrevProfile = &pNeighborRoamInfo->prevConnProfile; |
| 3625 | if( !pPrevProfile ) |
| 3626 | { |
| 3627 | return (fNew); |
| 3628 | } |
| 3629 | |
| 3630 | pBssDesc = pPrevProfile->pBssDesc; |
| 3631 | if (pBssDesc) |
| 3632 | { |
| 3633 | if (HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, |
| 3634 | pBssDesc, &pIes)) && |
| 3635 | csrNeighborRoamIsSsidAndSecurityMatch(pMac, pCurrProfile, pBssDesc, pIes)) |
| 3636 | { |
| 3637 | fNew = FALSE; |
| 3638 | } |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 3639 | if (pIes) |
| 3640 | { |
| 3641 | vos_mem_free(pIes); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3642 | } |
| 3643 | } |
| 3644 | |
| 3645 | if (fNew) |
| 3646 | { |
| 3647 | smsLog(pMac, LOG1, FL("Prev roam profile did not match current")); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3648 | } |
| 3649 | else |
| 3650 | { |
| 3651 | smsLog(pMac, LOG1, FL("Prev roam profile matches current")); |
| 3652 | } |
| 3653 | |
| 3654 | return (fNew); |
| 3655 | } |
| 3656 | |
| 3657 | tANI_BOOLEAN csrNeighborRoamConnectedProfileMatch( |
| 3658 | tpAniSirGlobal pMac, |
| 3659 | tCsrScanResult *pResult, |
| 3660 | tDot11fBeaconIEs *pIes) |
| 3661 | { |
| 3662 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3663 | tANI_U8 sessionId = (tANI_U8)pNeighborRoamInfo->csrSessionId; |
| 3664 | tCsrRoamConnectedProfile *pCurProfile = NULL; |
| 3665 | tSirBssDescription *pBssDesc = &pResult->Result.BssDescriptor; |
| 3666 | |
| 3667 | if( !(pMac->roam.roamSession |
| 3668 | && CSR_IS_SESSION_VALID(pMac, sessionId))) |
| 3669 | { |
| 3670 | return FALSE; |
| 3671 | } |
| 3672 | |
| 3673 | pCurProfile = &pMac->roam.roamSession[sessionId].connectedProfile; |
| 3674 | |
| 3675 | if( !pCurProfile) |
| 3676 | { |
| 3677 | return FALSE; |
| 3678 | } |
| 3679 | |
| 3680 | return csrNeighborRoamIsSsidAndSecurityMatch(pMac, pCurProfile, pBssDesc, pIes); |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3681 | } |
| 3682 | |
| 3683 | /* --------------------------------------------------------------------------- |
| 3684 | |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3685 | \fn csrNeighborRoamPrepareNonOccupiedChannelList |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3686 | |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3687 | \brief This function is used to prepare a channel list that is derived from |
| 3688 | the list of valid channels and does not include those in the occupied |
| 3689 | list. |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3690 | |
| 3691 | \param pMac - The handle returned by macOpen. |
| 3692 | \param pInputChannelList - The default channels list. |
| 3693 | \param numOfChannels - The number of channels in the default channels list. |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3694 | \param pOutputChannelList - The place to put the non-occupied channel list. |
| 3695 | \param pOutputNumOfChannels - The number of channels in the non-occupied channel list. |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3696 | |
| 3697 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 3698 | |
| 3699 | ---------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3700 | VOS_STATUS csrNeighborRoamPrepareNonOccupiedChannelList( |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3701 | tpAniSirGlobal pMac, |
| 3702 | tANI_U8 *pInputChannelList, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3703 | tANI_U8 numOfChannels, |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3704 | tANI_U8 *pOutputChannelList, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3705 | tANI_U8 *pOutputNumOfChannels |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3706 | ) |
| 3707 | { |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3708 | tANI_U8 i = 0; |
| 3709 | tANI_U8 outputNumOfChannels = 0; // Clear the output number of channels |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3710 | tANI_U8 numOccupiedChannels = pMac->scan.occupiedChannels.numChannels; |
| 3711 | tANI_U8 *pOccupiedChannelList = pMac->scan.occupiedChannels.channelList; |
| 3712 | |
Kaushik, Sushant | 925e27d | 2014-04-08 13:38:04 +0530 | [diff] [blame] | 3713 | for (i = 0; (i < numOfChannels &&(i < WNI_CFG_VALID_CHANNEL_LIST_LEN)); i++) |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3714 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3715 | if (!csrIsChannelPresentInList(pOccupiedChannelList, numOccupiedChannels, |
| 3716 | pInputChannelList[i])) |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3717 | { |
Sandeep Puligilla | c80f26e | 2014-03-11 18:36:10 +0530 | [diff] [blame] | 3718 | /* DFS channel will be added in the list only when the |
| 3719 | DFS Roaming scan flag is enabled*/ |
| 3720 | if (CSR_IS_CHANNEL_DFS(pInputChannelList[i])) |
| 3721 | { |
| 3722 | if (pMac->roam.configParam.allowDFSChannelRoam == TRUE) |
| 3723 | { |
| 3724 | pOutputChannelList[outputNumOfChannels++] = pInputChannelList[i]; |
| 3725 | } |
| 3726 | } |
| 3727 | else |
| 3728 | { |
| 3729 | pOutputChannelList[outputNumOfChannels++] = pInputChannelList[i]; |
| 3730 | } |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3731 | } |
| 3732 | } |
| 3733 | |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3734 | smsLog(pMac, LOG2, FL("Number of channels in the valid channel list=%d; " |
| 3735 | "Number of channels in the non-occupied list list=%d"), |
| 3736 | numOfChannels, outputNumOfChannels); |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3737 | |
| 3738 | // Return the number of channels |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3739 | *pOutputNumOfChannels = outputNumOfChannels; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3740 | |
| 3741 | return eHAL_STATUS_SUCCESS; |
| 3742 | } |
| 3743 | #endif /* FEATURE_WLAN_LFR */ |
| 3744 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3745 | /* --------------------------------------------------------------------------- |
| 3746 | |
| 3747 | \fn csrNeighborRoamTransitToCFGChanScan |
| 3748 | |
| 3749 | \brief This function is called whenever there is a transition to CFG chan scan |
| 3750 | state from any state. It frees up the current channel list and allocates |
| 3751 | a new memory for the channels received from CFG item. It then starts the |
| 3752 | neighbor scan timer to perform the scan on each channel one by one |
| 3753 | |
| 3754 | \param pMac - The handle returned by macOpen. |
| 3755 | |
| 3756 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 3757 | |
| 3758 | ---------------------------------------------------------------------------*/ |
| 3759 | VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) |
| 3760 | { |
| 3761 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 3762 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 3763 | int i = 0; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 3764 | tANI_U8 numOfChannels = 0; |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3765 | tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3766 | tpCsrChannelInfo currChannelListInfo; |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3767 | tANI_U8 scanChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 3768 | int outputNumOfChannels = 0; |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 3769 | #ifdef FEATURE_WLAN_LFR |
| 3770 | tANI_U32 sessionId = pNeighborRoamInfo->csrSessionId; |
| 3771 | #endif |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3772 | currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3773 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 3774 | if ( |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3775 | #ifdef FEATURE_WLAN_ESE |
| 3776 | ((pNeighborRoamInfo->isESEAssoc) && |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 3777 | (pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived == eANI_BOOLEAN_FALSE)) || |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3778 | (pNeighborRoamInfo->isESEAssoc == eANI_BOOLEAN_FALSE) || |
| 3779 | #endif // ESE |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3780 | currChannelListInfo->numOfChannels == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3781 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3782 | smsLog(pMac, LOGW, FL("Building channel list to scan")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3783 | |
| 3784 | |
| 3785 | /* Free up the channel list and allocate a new memory. This is because we dont know how much |
| 3786 | was allocated last time. If we directly copy more number of bytes than allocated earlier, this might |
| 3787 | result in memory corruption */ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3788 | if (NULL != currChannelListInfo->ChannelList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3789 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3790 | vos_mem_free(currChannelListInfo->ChannelList); |
| 3791 | currChannelListInfo->ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 3792 | currChannelListInfo->numOfChannels = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3793 | } |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3794 | |
| 3795 | // Now obtain the contents for "channelList" (the "default valid channel list") from EITHER |
| 3796 | // the gNeighborScanChannelList in "cfg.ini", OR the actual "valid channel list" information formed by CSR. |
| 3797 | if (0 != pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3798 | { |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3799 | // Copy the "default valid channel list" (channelList) from the gNeighborScanChannelList in "cfg.ini". |
| 3800 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, "Using the channel list from cfg.ini"); |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3801 | status = csrNeighborRoamMergeChannelLists( |
| 3802 | pMac, |
| 3803 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList, |
| 3804 | pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels, |
| 3805 | channelList, |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3806 | 0, //NB: If 0, simply copy the input channel list to the output list. |
| 3807 | &numOfChannels ); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3808 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3809 | if (CSR_IS_ROAM_INTRA_BAND_ENABLED(pMac)) |
| 3810 | { |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3811 | csrNeighborRoamChannelsFilterByBand( |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3812 | pMac, |
| 3813 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList, |
| 3814 | pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels, |
| 3815 | channelList, |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3816 | &numOfChannels, |
| 3817 | GetRFBand(pMac->roam.neighborRoamInfo.currAPoperationChannel)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3818 | } |
Gopichand Nakkala | 9cd573c | 2013-04-19 21:52:58 +0530 | [diff] [blame] | 3819 | if(numOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 3820 | { |
| 3821 | smsLog(pMac, LOGE, FL("Received wrong number of Channel list")); |
| 3822 | return VOS_STATUS_E_INVAL; |
| 3823 | } |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3824 | /* Remove the DFS channels from CFG channel list when ' |
| 3825 | gAllowRoamToDFS is disabled */ |
| 3826 | if ( pMac->roam.configParam.allowDFSChannelRoam == FALSE) |
| 3827 | { |
| 3828 | for (i=0; i<numOfChannels; i++) |
| 3829 | { |
| 3830 | if ( !(CSR_IS_CHANNEL_DFS(channelList[i]))) |
| 3831 | { |
| 3832 | scanChannelList[outputNumOfChannels++] = channelList[i]; |
| 3833 | } |
| 3834 | } |
| 3835 | } |
| 3836 | else |
| 3837 | { /* Move all the channels to roam scan channel list */ |
| 3838 | vos_mem_copy(scanChannelList, |
| 3839 | channelList, |
| 3840 | numOfChannels * sizeof(tANI_U8)); |
| 3841 | outputNumOfChannels = numOfChannels; |
| 3842 | } |
Kanchanapally, Vidyullatha | 406ef0e | 2015-03-25 12:23:19 +0530 | [diff] [blame] | 3843 | |
| 3844 | if (outputNumOfChannels == 0) |
| 3845 | { |
| 3846 | smsLog(pMac, LOGE, FL("No channels to scan")); |
| 3847 | return VOS_STATUS_E_FAILURE; |
| 3848 | } |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3849 | currChannelListInfo->ChannelList = |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3850 | vos_mem_malloc(outputNumOfChannels*sizeof(tANI_U8)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3851 | if (NULL == currChannelListInfo->ChannelList) |
| 3852 | { |
| 3853 | smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed")); |
| 3854 | return VOS_STATUS_E_RESOURCES; |
| 3855 | } |
Kanchanapally, Vidyullatha | 406ef0e | 2015-03-25 12:23:19 +0530 | [diff] [blame] | 3856 | currChannelListInfo->numOfChannels = outputNumOfChannels; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3857 | vos_mem_copy(currChannelListInfo->ChannelList, |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3858 | scanChannelList, outputNumOfChannels * sizeof(tANI_U8)); |
Madan Mohan Koyyalamudi | 596e4fb | 2012-10-05 11:39:52 -0700 | [diff] [blame] | 3859 | } |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3860 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3861 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 3862 | #ifdef FEATURE_WLAN_LFR |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3863 | else if ((pNeighborRoamInfo->uScanMode == DEFAULT_SCAN) && |
| 3864 | (abs(pNeighborRoamInfo->lookupDOWNRssi) > |
| 3865 | abs(pNeighborRoamInfo->cfgParams.neighborReassocThreshold))) |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 3866 | { |
| 3867 | /* |
| 3868 | * Trigger a contiguous scan on all channels when the |
| 3869 | * RSSI in the lookup DOWN notification is below reassoc |
| 3870 | * threshold. This will help us find the best available |
| 3871 | * candidate and also update the channel cache. |
| 3872 | */ |
| 3873 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "Triggering contiguous scan " |
| 3874 | "(lookupDOWNRssi=%d,reassocThreshold=%d)", |
| 3875 | pNeighborRoamInfo->lookupDOWNRssi, |
| 3876 | pNeighborRoamInfo->cfgParams.neighborReassocThreshold*(-1)); |
| 3877 | |
Deepthi Gowri | 4480a3f | 2016-05-18 19:30:17 +0530 | [diff] [blame] | 3878 | pNeighborRoamInfo->scanRequestTimeStamp = |
| 3879 | vos_timer_get_system_time(); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 3880 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 3881 | vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 3882 | |
| 3883 | /* We are about to start a fresh scan cycle, |
| 3884 | * purge non-P2P results from the past */ |
| 3885 | csrScanFlushSelectiveResult(pMac, VOS_FALSE); |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 3886 | |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 3887 | csrNeighborRoamPerformContiguousBgScan(pMac, sessionId); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 3888 | |
| 3889 | /* Transition to CFG_CHAN_LIST_SCAN */ |
| 3890 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN); |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 3891 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 3892 | return VOS_STATUS_SUCCESS; |
| 3893 | } |
| 3894 | #endif |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3895 | else |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3896 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3897 | numOfChannels = pMac->scan.occupiedChannels.numChannels; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 3898 | if (numOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 3899 | { |
| 3900 | numOfChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 3901 | } |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3902 | if (numOfChannels |
| 3903 | #ifdef FEATURE_WLAN_LFR |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3904 | && ((pNeighborRoamInfo->uScanMode == SPLIT_SCAN_OCCUPIED_LIST) || |
| 3905 | (pNeighborRoamInfo->uEmptyScanCount == 0) || |
| 3906 | ((pNeighborRoamInfo->uEmptyScanCount % 2) == 1)) |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3907 | #endif |
| 3908 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3909 | { |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3910 | /* |
| 3911 | * Always scan channels in the occupied channel list |
| 3912 | * before scanning on the non-occupied list. |
| 3913 | */ |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3914 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "Switching to occupied channel list" |
| 3915 | #ifdef FEATURE_WLAN_LFR |
| 3916 | "-uScanMode=%d, uEmptyScanCount=%d", |
| 3917 | pNeighborRoamInfo->uScanMode, |
| 3918 | pNeighborRoamInfo->uEmptyScanCount |
| 3919 | #endif |
| 3920 | ); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3921 | if (CSR_IS_ROAM_INTRA_BAND_ENABLED(pMac)) |
| 3922 | { |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3923 | csrNeighborRoamChannelsFilterByBand( |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3924 | pMac, |
| 3925 | pMac->scan.occupiedChannels.channelList, |
| 3926 | numOfChannels, |
| 3927 | channelList, |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 3928 | &numOfChannels, |
| 3929 | GetRFBand(pMac->roam.neighborRoamInfo.currAPoperationChannel)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3930 | } |
| 3931 | else |
| 3932 | { |
| 3933 | vos_mem_copy(channelList, |
| 3934 | pMac->scan.occupiedChannels.channelList, |
| 3935 | numOfChannels * sizeof(tANI_U8)); |
| 3936 | } |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3937 | /* Remove the DFS channels from CFG channel list when ' |
| 3938 | gAllowRoamToDFS is disabled */ |
| 3939 | if ( pMac->roam.configParam.allowDFSChannelRoam == FALSE) |
| 3940 | { |
| 3941 | for (i=0; i<numOfChannels; i++) |
| 3942 | { |
| 3943 | if ( !(CSR_IS_CHANNEL_DFS(channelList[i]))) |
| 3944 | { |
| 3945 | scanChannelList[outputNumOfChannels++] = channelList[i]; |
| 3946 | } |
| 3947 | } |
| 3948 | } |
| 3949 | else |
| 3950 | { |
| 3951 | vos_mem_copy(scanChannelList, |
| 3952 | channelList, |
| 3953 | numOfChannels * sizeof(tANI_U8)); |
| 3954 | outputNumOfChannels = numOfChannels; |
| 3955 | } |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 3956 | |
Kanchanapally, Vidyullatha | 406ef0e | 2015-03-25 12:23:19 +0530 | [diff] [blame] | 3957 | if (outputNumOfChannels == 0) |
| 3958 | { |
| 3959 | smsLog(pMac, LOGE, FL("No channels to scan")); |
| 3960 | return VOS_STATUS_E_FAILURE; |
| 3961 | } |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3962 | currChannelListInfo->ChannelList = vos_mem_malloc(outputNumOfChannels * sizeof(tANI_U8)); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3963 | if (NULL == currChannelListInfo->ChannelList) |
| 3964 | { |
| 3965 | smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed")); |
| 3966 | return VOS_STATUS_E_RESOURCES; |
| 3967 | } |
Kanchanapally, Vidyullatha | 406ef0e | 2015-03-25 12:23:19 +0530 | [diff] [blame] | 3968 | currChannelListInfo->numOfChannels = outputNumOfChannels; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3969 | vos_mem_copy(currChannelListInfo->ChannelList, |
Sandeep Puligilla | 1627d02 | 2014-06-03 02:56:25 +0530 | [diff] [blame] | 3970 | scanChannelList, |
| 3971 | outputNumOfChannels * sizeof(tANI_U8)); |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 3972 | } |
| 3973 | else |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3974 | { |
| 3975 | /* Scan all channels from non-occupied list */ |
| 3976 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "Get valid channel list"); |
| 3977 | numOfChannels = sizeof(pMac->roam.validChannelList); |
| 3978 | |
| 3979 | if(HAL_STATUS_SUCCESS(csrGetCfgValidChannels(pMac, |
| 3980 | (tANI_U8 *)pMac->roam.validChannelList, |
| 3981 | (tANI_U32 *) &numOfChannels))) |
| 3982 | { |
| 3983 | #ifdef FEATURE_WLAN_LFR |
| 3984 | /* |
| 3985 | * Prepare non-occupied channel list (channelList) |
| 3986 | * from the actual "valid channel list" information |
| 3987 | * formed by CSR. |
| 3988 | */ |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 3989 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, "Switching to non-occupied channel list"); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3990 | status = csrNeighborRoamPrepareNonOccupiedChannelList(pMac, |
| 3991 | (tANI_U8 *)pMac->roam.validChannelList, |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 3992 | numOfChannels, |
| 3993 | channelList, |
| 3994 | &numOfChannels); |
| 3995 | #else |
| 3996 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "Merging channel list"); |
| 3997 | status = csrNeighborRoamMergeChannelLists( |
| 3998 | pMac, |
| 3999 | (tANI_U8 *)pMac->roam.validChannelList, |
| 4000 | numOfChannels, // The number of channels in the validChannelList |
| 4001 | channelList, |
| 4002 | 0, //NB: If 0, simply copy the input channel list to the output list. |
| 4003 | &numOfChannels ); // The final number of channels in the output list. Will be numOfChannels |
| 4004 | #endif |
| 4005 | } |
| 4006 | else |
| 4007 | { |
| 4008 | smsLog(pMac, LOGE, FL("Could not get valid channel list")); |
Madan Mohan Koyyalamudi | 470d2cf | 2012-09-28 14:43:44 -0700 | [diff] [blame] | 4009 | return VOS_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4010 | } |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 4011 | |
| 4012 | if (CSR_IS_ROAM_INTRA_BAND_ENABLED(pMac)) |
| 4013 | { |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4014 | csrNeighborRoamChannelsFilterByBand( |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 4015 | pMac, |
| 4016 | (tANI_U8 *)pMac->roam.validChannelList, |
| 4017 | numOfChannels, |
| 4018 | channelList, |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4019 | &numOfChannels, |
| 4020 | GetRFBand(pMac->roam.neighborRoamInfo.currAPoperationChannel)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 4021 | } |
| 4022 | |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 4023 | if (numOfChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) |
| 4024 | { |
| 4025 | numOfChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 4026 | } |
Kanchanapally, Vidyullatha | 406ef0e | 2015-03-25 12:23:19 +0530 | [diff] [blame] | 4027 | |
| 4028 | if (numOfChannels == 0) |
| 4029 | { |
| 4030 | smsLog(pMac, LOGE, FL("No channels to scan")); |
| 4031 | return VOS_STATUS_E_FAILURE; |
| 4032 | } |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4033 | currChannelListInfo->ChannelList = |
| 4034 | vos_mem_malloc(numOfChannels*sizeof(tANI_U8)); |
| 4035 | |
| 4036 | if (NULL == currChannelListInfo->ChannelList) |
| 4037 | { |
| 4038 | smsLog(pMac, LOGE, FL("Memory allocation for Channel list failed")); |
| 4039 | return VOS_STATUS_E_RESOURCES; |
| 4040 | } |
Kanchanapally, Vidyullatha | 406ef0e | 2015-03-25 12:23:19 +0530 | [diff] [blame] | 4041 | currChannelListInfo->numOfChannels = numOfChannels; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4042 | #ifdef FEATURE_WLAN_LFR |
| 4043 | vos_mem_copy(currChannelListInfo->ChannelList, |
| 4044 | channelList, numOfChannels * sizeof(tANI_U8)); |
| 4045 | #else |
| 4046 | vos_mem_copy(currChannelListInfo->ChannelList, |
| 4047 | (tANI_U8 *)pMac->roam.validChannelList, |
| 4048 | numOfChannels * sizeof(tANI_U8)); |
| 4049 | #endif |
| 4050 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4051 | } |
| 4052 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4053 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, |
| 4054 | "Number of channels from CFG (or) (non-)occupied list=%d", |
| 4055 | currChannelListInfo->numOfChannels); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4056 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4057 | { |
Madan Mohan Koyyalamudi | 22f2708 | 2012-11-27 19:11:12 +0530 | [diff] [blame] | 4058 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "Channel List from CFG (or) (non-)occupied list" |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4059 | "= %d", currChannelListInfo->ChannelList[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4060 | } |
| 4061 | } |
| 4062 | |
| 4063 | /* We are gonna scan now. Remember the time stamp to filter out results only after this timestamp */ |
Deepthi Gowri | 4480a3f | 2016-05-18 19:30:17 +0530 | [diff] [blame] | 4064 | pNeighborRoamInfo->scanRequestTimeStamp = vos_timer_get_system_time(); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4065 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4066 | vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4067 | /* Start Neighbor scan timer now. Multiplication by PAL_TIMER_TO_MS_UNIT is to convert ms to us which is |
| 4068 | what palTimerStart expects */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4069 | status = vos_timer_start(&pNeighborRoamInfo->neighborScanTimer, |
| 4070 | pNeighborRoamInfo->cfgParams.neighborScanPeriod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4071 | |
| 4072 | if (eHAL_STATUS_SUCCESS != status) |
| 4073 | { |
| 4074 | /* Timer start failed.. */ |
| 4075 | smsLog(pMac, LOGE, FL("Neighbor scan PAL Timer start failed, status = %d, Ignoring state transition"), status); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4076 | vos_mem_free(currChannelListInfo->ChannelList); |
| 4077 | currChannelListInfo->ChannelList = NULL; |
Kiran Kumar Lokere | f0bd438 | 2013-03-19 22:06:52 -0700 | [diff] [blame] | 4078 | currChannelListInfo->numOfChannels = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4079 | return VOS_STATUS_E_FAILURE; |
| 4080 | } |
| 4081 | |
| 4082 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex = 0; |
| 4083 | pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress = eANI_BOOLEAN_TRUE; |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 4084 | /* We are about to start a fresh scan cycle, |
| 4085 | * purge non-P2P results from the past */ |
| 4086 | csrScanFlushSelectiveResult(pMac, VOS_FALSE); |
James Zmuda | 5ba36d0 | 2013-03-14 17:39:07 -0700 | [diff] [blame] | 4087 | |
| 4088 | /* We are about to start a fresh scan cycle, |
| 4089 | * purge failed pre-auth results from the past */ |
| 4090 | csrNeighborRoamPurgePreauthFailedList(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4091 | |
| 4092 | /* Transition to CFG_CHAN_LIST_SCAN_STATE */ |
| 4093 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN) |
| 4094 | |
| 4095 | return VOS_STATUS_SUCCESS; |
| 4096 | } |
| 4097 | |
| 4098 | /* --------------------------------------------------------------------------- |
| 4099 | |
| 4100 | \fn csrNeighborRoamNeighborLookupUpEvent |
| 4101 | |
| 4102 | \brief This function is called as soon as TL indicates that the current AP's |
| 4103 | RSSI is better than the neighbor lookup threshold. Here, we transition to |
| 4104 | CONNECTED state and reset all the scan parameters |
| 4105 | |
| 4106 | \param pMac - The handle returned by macOpen. |
| 4107 | |
| 4108 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4109 | |
| 4110 | ---------------------------------------------------------------------------*/ |
| 4111 | VOS_STATUS csrNeighborRoamNeighborLookupUpEvent(tpAniSirGlobal pMac) |
| 4112 | { |
| 4113 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4114 | VOS_STATUS vosStatus; |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 4115 | csrNeighborRoamDeregAllRssiIndication(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4116 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4117 | /* Recheck whether the below check is needed. */ |
Santhosh Kumar Padma | 8f930ce | 2014-06-25 15:06:40 +0530 | [diff] [blame] | 4118 | if ((pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CONNECTED) |
| 4119 | && (pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4120 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED) |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4121 | #ifdef FEATURE_WLAN_LFR |
| 4122 | if (!csrRoamIsFastRoamEnabled(pMac,pMac->roam.neighborRoamInfo.csrSessionId)) |
| 4123 | { |
| 4124 | smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); |
| 4125 | return eHAL_STATUS_SUCCESS; |
| 4126 | } |
| 4127 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4128 | /* Reset all the neighbor roam info control variables. Free all the allocated memory. It is like we are just associated now */ |
| 4129 | csrNeighborRoamResetConnectedStateControlInfo(pMac); |
| 4130 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4131 | |
| 4132 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event neighbor lookup callback with TL. RSSI = %d,"), pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); |
| 4133 | /* Register Neighbor Lookup threshold callback with TL for DOWN event now */ |
| 4134 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 4135 | WLANTL_HO_THRESHOLD_DOWN, |
| 4136 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 4137 | VOS_MODULE_ID_SME, pMac); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4138 | #ifdef FEATURE_WLAN_LFR |
| 4139 | pNeighborRoamInfo->lookupDOWNRssi = 0; |
| 4140 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4141 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 4142 | { |
| 4143 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4144 | smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupCallback DOWN event with TL: Status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4145 | } |
| 4146 | |
| 4147 | |
| 4148 | return vosStatus; |
| 4149 | } |
| 4150 | |
| 4151 | /* --------------------------------------------------------------------------- |
| 4152 | |
| 4153 | \fn csrNeighborRoamNeighborLookupDownEvent |
| 4154 | |
| 4155 | \brief This function is called as soon as TL indicates that the current AP's |
| 4156 | RSSI falls below the current eighbor lookup threshold. Here, we transition to |
| 4157 | REPORT_QUERY for 11r association and CFG_CHAN_LIST_SCAN state if the assoc is |
| 4158 | a non-11R association. |
| 4159 | |
| 4160 | \param pMac - The handle returned by macOpen. |
| 4161 | |
| 4162 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4163 | |
| 4164 | ---------------------------------------------------------------------------*/ |
| 4165 | VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) |
| 4166 | { |
| 4167 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4168 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 4169 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 4170 | |
| 4171 | switch (pNeighborRoamInfo->neighborRoamState) |
| 4172 | { |
| 4173 | case eCSR_NEIGHBOR_ROAM_STATE_CONNECTED: |
| 4174 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4175 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering DOWN event neighbor lookup callback with TL. RSSI = %d,"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4176 | pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); |
| 4177 | /* De-register Neighbor Lookup threshold callback with TL */ |
| 4178 | vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
| 4179 | WLANTL_HO_THRESHOLD_DOWN, |
| 4180 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 4181 | VOS_MODULE_ID_SME); |
| 4182 | |
| 4183 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 4184 | { |
| 4185 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4186 | smsLog(pMac, LOGW, FL(" Couldn't Deregister csrNeighborRoamNeighborLookupCallback DOWN event from TL: Status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4187 | } |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4188 | #ifdef FEATURE_WLAN_LFR |
| 4189 | if (!csrRoamIsFastRoamEnabled(pMac,pMac->roam.neighborRoamInfo.csrSessionId)) |
| 4190 | { |
| 4191 | smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); |
| 4192 | return eHAL_STATUS_SUCCESS; |
| 4193 | } |
| 4194 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4195 | |
| 4196 | #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI |
| 4197 | if ((pNeighborRoamInfo->is11rAssoc) && (pMac->rrm.rrmSmeContext.rrmConfig.rrmEnabled)) |
| 4198 | { |
| 4199 | |
| 4200 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("11R Association:Neighbor Lookup Down event received in CONNECTED state")); |
| 4201 | vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); |
| 4202 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 4203 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4204 | smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4205 | return vosStatus; |
| 4206 | } |
| 4207 | /* Increment the neighbor report retry count after sending the neighbor request successfully */ |
| 4208 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; |
| 4209 | pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; |
| 4210 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY) |
| 4211 | } |
| 4212 | else |
| 4213 | #endif |
| 4214 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4215 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Non 11R or ESE Association:Neighbor Lookup Down event received in CONNECTED state")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4216 | |
| 4217 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 4218 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 4219 | { |
Madan Mohan Koyyalamudi | 4450acc | 2012-11-15 17:24:31 -0800 | [diff] [blame] | 4220 | NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("csrNeighborRoamTransitToCFGChanScan failed" |
| 4221 | " with status=%d"), vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4222 | return vosStatus; |
| 4223 | } |
| 4224 | } |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4225 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering UP event neighbor lookup callback with TL. RSSI = %d,"), NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4226 | /* Register Neighbor Lookup threshold callback with TL for UP event now */ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4227 | vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, |
| 4228 | (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4229 | WLANTL_HO_THRESHOLD_UP, |
| 4230 | csrNeighborRoamNeighborLookupUPCallback, |
| 4231 | VOS_MODULE_ID_SME, pMac); |
| 4232 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 4233 | { |
| 4234 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4235 | smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupCallback UP event with TL: Status = %d"), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4236 | } |
| 4237 | break; |
| 4238 | default: |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 4239 | smsLog(pMac, LOGE, FL("DOWN event received in invalid" |
| 4240 | "state %s ..Ignoring..."), |
| 4241 | macTraceGetNeighbourRoamState( |
| 4242 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4243 | break; |
| 4244 | |
| 4245 | } |
| 4246 | return vosStatus; |
| 4247 | } |
| 4248 | |
| 4249 | /* --------------------------------------------------------------------------- |
| 4250 | |
| 4251 | \fn csrNeighborRoamNeighborLookupUPCallback |
| 4252 | |
| 4253 | \brief This function is registered with TL to indicate whenever the RSSI |
| 4254 | gets better than the neighborLookup RSSI Threshold |
| 4255 | |
| 4256 | \param pAdapter - VOS Context |
| 4257 | trafficStatus - UP/DOWN indication from TL |
| 4258 | pUserCtxt - Parameter for callback registered during callback registration. Should be pMac |
| 4259 | |
| 4260 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4261 | |
| 4262 | ---------------------------------------------------------------------------*/ |
| 4263 | VOS_STATUS csrNeighborRoamNeighborLookupUPCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 4264 | v_PVOID_t pUserCtxt, |
| 4265 | v_S7_t avgRssi) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4266 | { |
| 4267 | tpAniSirGlobal pMac = PMAC_STRUCT( pUserCtxt ); |
| 4268 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4269 | VOS_STATUS vosStatus = eHAL_STATUS_SUCCESS; |
| 4270 | |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 4271 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Neighbor Lookup UP indication callback called with notification %d Reported RSSI = %d"), |
| 4272 | rssiNotification, |
| 4273 | avgRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4274 | |
| 4275 | if(!csrIsConnStateConnectedInfra(pMac, pNeighborRoamInfo->csrSessionId)) |
| 4276 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4277 | smsLog(pMac, LOGW, "Ignoring the indication as we are not connected"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4278 | return VOS_STATUS_SUCCESS; |
| 4279 | } |
| 4280 | |
| 4281 | VOS_ASSERT(WLANTL_HO_THRESHOLD_UP == rssiNotification); |
| 4282 | vosStatus = csrNeighborRoamNeighborLookupUpEvent(pMac); |
| 4283 | return vosStatus; |
| 4284 | } |
| 4285 | |
| 4286 | /* --------------------------------------------------------------------------- |
| 4287 | |
| 4288 | \fn csrNeighborRoamNeighborLookupDOWNCallback |
| 4289 | |
| 4290 | \brief This function is registered with TL to indicate whenever the RSSI |
| 4291 | falls below the current neighborLookup RSSI Threshold |
| 4292 | |
| 4293 | \param pAdapter - VOS Context |
| 4294 | trafficStatus - UP/DOWN indication from TL |
| 4295 | pUserCtxt - Parameter for callback registered during callback registration. Should be pMac |
| 4296 | |
| 4297 | \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4298 | |
| 4299 | ---------------------------------------------------------------------------*/ |
| 4300 | VOS_STATUS csrNeighborRoamNeighborLookupDOWNCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 4301 | v_PVOID_t pUserCtxt, |
| 4302 | v_S7_t avgRssi) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4303 | { |
| 4304 | tpAniSirGlobal pMac = PMAC_STRUCT( pUserCtxt ); |
| 4305 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4306 | VOS_STATUS vosStatus = eHAL_STATUS_SUCCESS; |
| 4307 | |
Srinivas | daaec71 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 4308 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Neighbor Lookup DOWN indication callback called with notification %d Reported RSSI = %d"), |
| 4309 | rssiNotification, |
| 4310 | avgRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4311 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4312 | #ifdef FEATURE_WLAN_LFR |
| 4313 | pNeighborRoamInfo->lookupDOWNRssi = avgRssi; |
| 4314 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4315 | if(!csrIsConnStateConnectedInfra(pMac, pNeighborRoamInfo->csrSessionId)) |
| 4316 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4317 | smsLog(pMac, LOGW, "Ignoring the indication as we are not connected"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4318 | return VOS_STATUS_SUCCESS; |
| 4319 | } |
| 4320 | |
| 4321 | VOS_ASSERT(WLANTL_HO_THRESHOLD_DOWN == rssiNotification); |
| 4322 | vosStatus = csrNeighborRoamNeighborLookupDownEvent(pMac); |
| 4323 | |
| 4324 | return vosStatus; |
| 4325 | } |
| 4326 | |
| 4327 | #ifdef RSSI_HACK |
| 4328 | extern int dumpCmdRSSI; |
| 4329 | #endif |
| 4330 | |
| 4331 | /* --------------------------------------------------------------------------- |
| 4332 | |
| 4333 | \fn csrNeighborRoamIndicateDisconnect |
| 4334 | |
| 4335 | \brief This function is called by CSR as soon as the station disconnects from |
| 4336 | the AP. This function does the necessary cleanup of neighbor roam data |
| 4337 | structures. Neighbor roam state transitions to INIT state whenever this |
| 4338 | function is called except if the current state is REASSOCIATING |
| 4339 | |
| 4340 | \param pMac - The handle returned by macOpen. |
| 4341 | sessionId - CSR session id that got disconnected |
| 4342 | |
| 4343 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4344 | |
| 4345 | ---------------------------------------------------------------------------*/ |
| 4346 | eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 4347 | { |
| 4348 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4349 | #ifdef FEATURE_WLAN_LFR |
| 4350 | tCsrRoamConnectedProfile *pPrevProfile = &pNeighborRoamInfo->prevConnProfile; |
| 4351 | #endif |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4352 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4353 | |
krunal soni | 587bf01 | 2014-02-04 12:35:11 -0800 | [diff] [blame] | 4354 | if (NULL == pSession) |
| 4355 | { |
| 4356 | smsLog(pMac, LOGE, FL("pSession is NULL ")); |
| 4357 | return eHAL_STATUS_FAILURE; |
| 4358 | } |
Kaushik, Sushant | 8489f47 | 2014-01-27 11:41:22 +0530 | [diff] [blame] | 4359 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 4360 | FL("Disconnect indication on session %d in state %s" |
| 4361 | "from BSSID : " |
| 4362 | MAC_ADDRESS_STR), sessionId, |
| 4363 | macTraceGetNeighbourRoamState( |
| 4364 | pNeighborRoamInfo->neighborRoamState), |
Kaushik, Sushant | 8489f47 | 2014-01-27 11:41:22 +0530 | [diff] [blame] | 4365 | MAC_ADDR_ARRAY(pSession->connectedProfile.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4366 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4367 | #ifdef FEATURE_WLAN_LFR |
| 4368 | /*Free the current previous profile and move the current profile to prev profile.*/ |
| 4369 | csrRoamFreeConnectProfile(pMac, pPrevProfile); |
Srinivas Girigowda | 254925a | 2013-06-25 17:54:33 -0700 | [diff] [blame] | 4370 | csrRoamCopyConnectProfile(pMac, sessionId, pPrevProfile); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4371 | #endif |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4372 | if (NULL != pSession) |
| 4373 | { |
| 4374 | if (NULL != pSession->pCurRoamProfile) |
| 4375 | { |
| 4376 | if (VOS_STA_MODE != pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona) |
| 4377 | { |
| 4378 | smsLog(pMac, LOGE, FL("Ignoring Disconnect indication received from a non STA persona." |
| 4379 | "sessionId: %d, csrPersonna %d"), sessionId, |
| 4380 | (int)pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona); |
| 4381 | return eHAL_STATUS_SUCCESS; |
| 4382 | } |
| 4383 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4384 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4385 | #ifdef FEATURE_WLAN_ESE |
| 4386 | if (pSession->connectedProfile.isESEAssoc) |
Praveen Kumar Sirisilla | 8bdfac4 | 2013-10-10 17:20:48 -0700 | [diff] [blame] | 4387 | { |
| 4388 | vos_mem_copy(&pSession->prevApSSID, &pSession->connectedProfile.SSID, |
| 4389 | sizeof(tSirMacSSid)); |
| 4390 | vos_mem_copy(pSession->prevApBssid, pSession->connectedProfile.bssid, |
| 4391 | sizeof(tSirMacAddr)); |
| 4392 | pSession->prevOpChannel = pSession->connectedProfile.operationChannel; |
| 4393 | pSession->isPrevApInfoValid = TRUE; |
| 4394 | pSession->roamTS1 = vos_timer_get_system_time(); |
| 4395 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4396 | #endif |
Praveen Kumar Sirisilla | 8bdfac4 | 2013-10-10 17:20:48 -0700 | [diff] [blame] | 4397 | } //if (NULL != pSession) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4398 | |
| 4399 | #ifdef RSSI_HACK |
| 4400 | dumpCmdRSSI = -40; |
| 4401 | #endif |
| 4402 | switch (pNeighborRoamInfo->neighborRoamState) |
| 4403 | { |
| 4404 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 4405 | // Stop scan and neighbor refresh timers. |
| 4406 | // These are indeed not required when we are in reassociating |
| 4407 | // state. |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4408 | vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); |
| 4409 | vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 4410 | vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Madan Mohan Koyyalamudi | 5ad3dff | 2012-10-21 11:32:02 -0700 | [diff] [blame] | 4411 | if (!CSR_IS_ROAM_SUBSTATE_DISASSOC_HO( pMac, sessionId )) { |
| 4412 | /* |
| 4413 | * Disconnect indication during Disassoc Handoff sub-state |
| 4414 | * is received when we are trying to disconnect with the old |
| 4415 | * AP during roam. BUT, if receive a disconnect indication |
| 4416 | * outside of Disassoc Handoff sub-state, then it means that |
| 4417 | * this is a genuine disconnect and we need to clean up. |
| 4418 | * Otherwise, we will be stuck in reassoc state which will |
| 4419 | * in-turn block scans (see csrIsScanAllowed). |
| 4420 | */ |
| 4421 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT); |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4422 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | 5ad3dff | 2012-10-21 11:32:02 -0700 | [diff] [blame] | 4423 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4424 | break; |
| 4425 | |
| 4426 | case eCSR_NEIGHBOR_ROAM_STATE_INIT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4427 | csrNeighborRoamResetInitStateControlInfo(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4428 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4429 | if (!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4430 | { |
| 4431 | #endif |
| 4432 | csrNeighborRoamDeregAllRssiIndication(pMac); |
| 4433 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4434 | } |
| 4435 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4436 | break; |
| 4437 | |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4438 | case eCSR_NEIGHBOR_ROAM_STATE_CONNECTED: |
| 4439 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4440 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4441 | csrNeighborRoamResetConnectedStateControlInfo(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4442 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4443 | if (!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4444 | { |
| 4445 | #endif |
| 4446 | csrNeighborRoamDeregAllRssiIndication(pMac); |
| 4447 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4448 | } |
| 4449 | #endif |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4450 | break; |
| 4451 | |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 4452 | case eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN: |
| 4453 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT); |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4454 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 4455 | csrNeighborRoamResetCfgListChanScanControlInfo(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4456 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4457 | if (!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4458 | { |
| 4459 | #endif |
| 4460 | csrNeighborRoamDeregAllRssiIndication(pMac); |
| 4461 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4462 | } |
| 4463 | #endif |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 4464 | break; |
| 4465 | |
| 4466 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 4467 | /* Stop pre-auth to reassoc interval timer */ |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4468 | vos_timer_stop(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer); |
Madan Mohan Koyyalamudi | 4f292df | 2012-09-18 17:27:40 -0700 | [diff] [blame] | 4469 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 4470 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 4471 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4472 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | edee8aa | 2012-10-15 15:36:40 -0700 | [diff] [blame] | 4473 | csrNeighborRoamResetPreauthControlInfo(pMac); |
Madan Mohan Koyyalamudi | 4f292df | 2012-09-18 17:27:40 -0700 | [diff] [blame] | 4474 | csrNeighborRoamResetReportScanStateControlInfo(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4475 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4476 | if (!csrRoamIsRoamOffloadScanEnabled(pMac)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4477 | { |
| 4478 | #endif |
| 4479 | csrNeighborRoamDeregAllRssiIndication(pMac); |
| 4480 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4481 | } |
| 4482 | #endif |
Madan Mohan Koyyalamudi | 4f292df | 2012-09-18 17:27:40 -0700 | [diff] [blame] | 4483 | break; |
| 4484 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4485 | default: |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 4486 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Received disconnect event" |
| 4487 | "in state %s"), |
| 4488 | macTraceGetNeighbourRoamState( |
| 4489 | pNeighborRoamInfo->neighborRoamState)); |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 4490 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Transitioning to INIT state")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4491 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4492 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | 4f292df | 2012-09-18 17:27:40 -0700 | [diff] [blame] | 4493 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4494 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4495 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4496 | /*Inform the Firmware to STOP Scanning as the host has a disconnect.*/ |
| 4497 | if (csrRoamIsStaMode(pMac, sessionId)) |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 4498 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4499 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, REASON_DISCONNECTED); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 4500 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4501 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4502 | return eHAL_STATUS_SUCCESS; |
| 4503 | } |
| 4504 | |
| 4505 | /* --------------------------------------------------------------------------- |
| 4506 | |
| 4507 | \fn csrNeighborRoamIndicateConnect |
| 4508 | |
| 4509 | \brief This function is called by CSR as soon as the station connects to an AP. |
| 4510 | This initializes all the necessary data structures related to the |
| 4511 | associated AP and transitions the state to CONNECTED state |
| 4512 | |
| 4513 | \param pMac - The handle returned by macOpen. |
| 4514 | sessionId - CSR session id that got connected |
| 4515 | vosStatus - connect status SUCCESS/FAILURE |
| 4516 | |
| 4517 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4518 | |
| 4519 | ---------------------------------------------------------------------------*/ |
| 4520 | eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId, VOS_STATUS vosStatus) |
| 4521 | { |
| 4522 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4523 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4524 | VOS_STATUS vstatus; |
| 4525 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4526 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4527 | int init_ft_flag = FALSE; |
| 4528 | #endif |
| 4529 | |
krunal soni | 289815a | 2013-07-16 16:20:19 -0700 | [diff] [blame] | 4530 | // if session id invalid then we need return failure |
| 4531 | if (NULL == pNeighborRoamInfo || !CSR_IS_SESSION_VALID(pMac, sessionId) || |
| 4532 | (NULL == pMac->roam.roamSession[sessionId].pCurRoamProfile)) |
krunal soni | 4878252 | 2013-06-13 12:24:10 -0700 | [diff] [blame] | 4533 | { |
| 4534 | return eHAL_STATUS_FAILURE; |
| 4535 | } |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 4536 | smsLog(pMac, LOG2, FL("Connect indication received with session id %d" |
| 4537 | "in state %s"), |
| 4538 | sessionId, macTraceGetNeighbourRoamState( |
| 4539 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4540 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4541 | // Bail out if this is NOT a STA persona |
| 4542 | if (pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona != VOS_STA_MODE) |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4543 | { |
| 4544 | smsLog(pMac, LOGE, FL("Ignoring Connect indication received from a non STA persona." |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4545 | "sessionId: %d, csrPersonna %d"), |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4546 | sessionId, |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4547 | (int)pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona); |
Dhanashri Atre | 9ae0dd1 | 2013-05-02 11:11:05 -0700 | [diff] [blame] | 4548 | return eHAL_STATUS_SUCCESS; |
| 4549 | } |
| 4550 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4551 | // if a concurrent session is running |
| 4552 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4553 | if (eANI_BOOLEAN_FALSE == CSR_IS_FASTROAM_IN_CONCURRENCY_INI_FEATURE_ENABLED(pMac)) |
| 4554 | { |
| 4555 | #endif |
| 4556 | if (csrIsConcurrentSessionRunning(pMac)) |
| 4557 | { |
| 4558 | smsLog(pMac, LOGE, FL("Ignoring Connect indication received in multisession %d"), |
| 4559 | csrIsConcurrentSessionRunning(pMac)); |
| 4560 | return eHAL_STATUS_SUCCESS; |
| 4561 | } |
| 4562 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4563 | } |
| 4564 | #endif |
| 4565 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4566 | switch (pNeighborRoamInfo->neighborRoamState) |
| 4567 | { |
| 4568 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 4569 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 4570 | { |
| 4571 | /* Just transition the state to INIT state. Rest of the clean up happens when we get next connect indication */ |
| 4572 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4573 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4574 | break; |
| 4575 | } |
| 4576 | /* Fall through if the status is SUCCESS */ |
| 4577 | case eCSR_NEIGHBOR_ROAM_STATE_INIT: |
| 4578 | /* Reset all the data structures here */ |
| 4579 | csrNeighborRoamResetInitStateControlInfo(pMac); |
| 4580 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4581 | pNeighborRoamInfo->csrSessionId = sessionId; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4582 | |
| 4583 | #ifdef FEATURE_WLAN_LFR |
| 4584 | /* |
| 4585 | * Initialize the occupied list ONLY if we are |
| 4586 | * transitioning from INIT state to CONNECTED state. |
| 4587 | */ |
| 4588 | if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) |
| 4589 | csrInitOccupiedChannelsList(pMac); |
| 4590 | #endif |
| 4591 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); |
| 4592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4593 | vos_mem_copy(pNeighborRoamInfo->currAPbssid, |
| 4594 | pMac->roam.roamSession[sessionId].connectedProfile.bssid, sizeof(tCsrBssid)); |
| 4595 | pNeighborRoamInfo->currAPoperationChannel = pMac->roam.roamSession[sessionId].connectedProfile.operationChannel; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4596 | pNeighborRoamInfo->currentNeighborLookupThreshold = |
| 4597 | pNeighborRoamInfo->cfgParams.neighborLookupThreshold; |
| 4598 | #ifdef FEATURE_WLAN_LFR |
| 4599 | pNeighborRoamInfo->uEmptyScanCount = 0; |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4600 | pNeighborRoamInfo->lookupDOWNRssi = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4601 | pNeighborRoamInfo->uScanMode = DEFAULT_SCAN; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4602 | #endif |
| 4603 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4604 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4605 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4606 | /* Now we can clear the preauthDone that was saved as we are connected afresh */ |
| 4607 | csrNeighborRoamFreeRoamableBSSList(pMac, &pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList); |
| 4608 | #endif |
| 4609 | |
| 4610 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 4611 | // Based on the auth scheme tell if we are 11r |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 4612 | if ( csrIsAuthType11r( pMac->roam.roamSession[sessionId].connectedProfile.AuthType, |
| 4613 | pMac->roam.roamSession[sessionId].connectedProfile.MDID.mdiePresent)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4614 | { |
| 4615 | if (pMac->roam.configParam.isFastTransitionEnabled) |
| 4616 | init_ft_flag = TRUE; |
| 4617 | pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_TRUE; |
| 4618 | } |
| 4619 | else |
| 4620 | pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_FALSE; |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 4621 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("11rAssoc is = %d"), pNeighborRoamInfo->is11rAssoc); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4622 | #endif |
| 4623 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4624 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4625 | // Based on the auth scheme tell if we are 11r |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4626 | if (pMac->roam.roamSession[sessionId].connectedProfile.isESEAssoc) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4627 | { |
| 4628 | if (pMac->roam.configParam.isFastTransitionEnabled) |
| 4629 | init_ft_flag = TRUE; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4630 | pNeighborRoamInfo->isESEAssoc = eANI_BOOLEAN_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4631 | } |
| 4632 | else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4633 | pNeighborRoamInfo->isESEAssoc = eANI_BOOLEAN_FALSE; |
| 4634 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("isESEAssoc is = %d ft = %d"), |
| 4635 | pNeighborRoamInfo->isESEAssoc, init_ft_flag); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4636 | |
| 4637 | #endif |
| 4638 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 4639 | #ifdef FEATURE_WLAN_LFR |
| 4640 | // If "Legacy Fast Roaming" is enabled |
Madan Mohan Koyyalamudi | 03aae5f | 2012-11-28 01:51:22 +0530 | [diff] [blame] | 4641 | if (csrRoamIsFastRoamEnabled(pMac, sessionId)) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 4642 | { |
| 4643 | init_ft_flag = TRUE; |
| 4644 | } |
| 4645 | #endif |
| 4646 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4647 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4648 | if ( init_ft_flag == TRUE ) |
| 4649 | { |
| 4650 | /* Initialize all the data structures needed for the 11r FT Preauth */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4651 | pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; |
| 4652 | csrNeighborRoamPurgePreauthFailedList(pMac); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4653 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4654 | if (csrRoamIsRoamOffloadScanEnabled(pMac)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4655 | { |
| 4656 | /*If this is not a INFRA type BSS, then do not send the command |
| 4657 | * down to firmware.Do not send the START command for other session |
| 4658 | * connections.*/ |
| 4659 | if(csrRoamIsStaMode(pMac, sessionId)) |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 4660 | { |
| 4661 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
Mukul Sharma | 9da30f5 | 2014-12-05 21:02:56 +0530 | [diff] [blame] | 4662 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; |
Mukul Sharma | c353a5b | 2015-01-16 20:49:12 +0530 | [diff] [blame] | 4663 | if(pNeighborRoamInfo->cfgParams.neighborInitialForcedRoamTo5GhEnable && |
| 4664 | (GetRFBand(pNeighborRoamInfo->currAPoperationChannel) == |
| 4665 | SIR_BAND_2_4_GHZ)) |
| 4666 | { |
| 4667 | /* |
| 4668 | * Keep 5G and Fwr roaming mutually exclusive so do not |
| 4669 | * send RSO start Note we have to send RSO start in all |
| 4670 | * errro case. |
| 4671 | */ |
| 4672 | smsLog(pMac, LOG1, |
| 4673 | FL("Do not send RSO start" |
| 4674 | "because 5G force roaming is enabled")); |
| 4675 | break; |
| 4676 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 4677 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 4678 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4679 | } else { |
| 4680 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4681 | |
| 4682 | NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), pNeighborRoamInfo->currentNeighborLookupThreshold); |
| 4683 | /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4684 | vstatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4685 | WLANTL_HO_THRESHOLD_DOWN, |
| 4686 | csrNeighborRoamNeighborLookupDOWNCallback, |
| 4687 | VOS_MODULE_ID_SME, pMac); |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4688 | #ifdef FEATURE_WLAN_LFR |
| 4689 | pNeighborRoamInfo->lookupDOWNRssi = 0; |
| 4690 | #endif |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4691 | if(!VOS_IS_STATUS_SUCCESS(vstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4692 | { |
| 4693 | //err msg |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 4694 | smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vstatus); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4695 | status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4696 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 4697 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 4698 | } |
| 4699 | #endif /* WLAN_FEATURE_ROAM_SCAN_OFFLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4700 | } |
| 4701 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4702 | break; |
| 4703 | default: |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 4704 | smsLog(pMac, LOGE, FL("Connect event received in invalid state %s" |
| 4705 | "..Ignoring..."), |
| 4706 | macTraceGetNeighbourRoamState( |
| 4707 | pNeighborRoamInfo->neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4708 | break; |
| 4709 | } |
| 4710 | return status; |
| 4711 | } |
| 4712 | |
| 4713 | |
| 4714 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 4715 | /* --------------------------------------------------------------------------- |
| 4716 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4717 | \fn csrNeighborRoamPurgePreauthFailedList |
| 4718 | |
| 4719 | \brief This function purges all the MAC addresses in the pre-auth fail list |
| 4720 | |
| 4721 | \param pMac - The handle returned by macOpen. |
| 4722 | |
| 4723 | \return VOID |
| 4724 | |
| 4725 | ---------------------------------------------------------------------------*/ |
| 4726 | void csrNeighborRoamPurgePreauthFailedList(tpAniSirGlobal pMac) |
| 4727 | { |
| 4728 | tANI_U8 i; |
| 4729 | |
| 4730 | for (i = 0; i < pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthFailList.numMACAddress; i++) |
| 4731 | { |
| 4732 | vos_mem_zero(pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthFailList.macAddress[i], sizeof(tSirMacAddr)); |
| 4733 | } |
| 4734 | pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthFailList.numMACAddress = 0; |
| 4735 | |
| 4736 | return; |
| 4737 | } |
| 4738 | |
| 4739 | /* --------------------------------------------------------------------------- |
| 4740 | |
| 4741 | \fn csrNeighborRoamInit11rAssocInfo |
| 4742 | |
| 4743 | \brief This function initializes 11r related neighbor roam data structures |
| 4744 | |
| 4745 | \param pMac - The handle returned by macOpen. |
| 4746 | |
| 4747 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4748 | |
| 4749 | ---------------------------------------------------------------------------*/ |
| 4750 | eHalStatus csrNeighborRoamInit11rAssocInfo(tpAniSirGlobal pMac) |
| 4751 | { |
| 4752 | eHalStatus status; |
| 4753 | tpCsr11rAssocNeighborInfo pFTRoamInfo = &pMac->roam.neighborRoamInfo.FTRoamInfo; |
| 4754 | |
| 4755 | pMac->roam.neighborRoamInfo.is11rAssoc = eANI_BOOLEAN_FALSE; |
| 4756 | pMac->roam.neighborRoamInfo.cfgParams.maxNeighborRetries = pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries; |
| 4757 | pFTRoamInfo->neighborReportTimeout = CSR_NEIGHBOR_ROAM_REPORT_QUERY_TIMEOUT; |
| 4758 | pFTRoamInfo->PEPreauthRespTimeout = CSR_NEIGHBOR_ROAM_PREAUTH_RSP_WAIT_MULTIPLIER * pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 4759 | pFTRoamInfo->neighborRptPending = eANI_BOOLEAN_FALSE; |
| 4760 | pFTRoamInfo->preauthRspPending = eANI_BOOLEAN_FALSE; |
| 4761 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4762 | pMac->roam.neighborRoamInfo.FTRoamInfo.currentNeighborRptRetryNum = 0; |
| 4763 | pMac->roam.neighborRoamInfo.FTRoamInfo.numBssFromNeighborReport = 0; |
| 4764 | vos_mem_zero(pMac->roam.neighborRoamInfo.FTRoamInfo.neighboReportBssInfo, |
| 4765 | sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); |
| 4766 | |
| 4767 | |
| 4768 | status = csrLLOpen(pMac->hHdd, &pFTRoamInfo->preAuthDoneList); |
| 4769 | if (eHAL_STATUS_SUCCESS != status) |
| 4770 | { |
| 4771 | smsLog(pMac, LOGE, FL("LL Open of preauth done AP List failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4772 | return eHAL_STATUS_RESOURCES; |
| 4773 | } |
| 4774 | return status; |
| 4775 | } |
| 4776 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 4777 | |
| 4778 | /* --------------------------------------------------------------------------- |
| 4779 | |
| 4780 | \fn csrNeighborRoamInit |
| 4781 | |
| 4782 | \brief This function initializes neighbor roam data structures |
| 4783 | |
| 4784 | \param pMac - The handle returned by macOpen. |
| 4785 | |
| 4786 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 4787 | |
| 4788 | ---------------------------------------------------------------------------*/ |
| 4789 | eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) |
| 4790 | { |
| 4791 | eHalStatus status; |
| 4792 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4793 | |
| 4794 | pNeighborRoamInfo->neighborRoamState = eCSR_NEIGHBOR_ROAM_STATE_CLOSED; |
| 4795 | pNeighborRoamInfo->prevNeighborRoamState = eCSR_NEIGHBOR_ROAM_STATE_CLOSED; |
| 4796 | pNeighborRoamInfo->csrSessionId = CSR_SESSION_ID_INVALID; |
| 4797 | pNeighborRoamInfo->cfgParams.maxChannelScanTime = pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime; |
| 4798 | pNeighborRoamInfo->cfgParams.minChannelScanTime = pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime; |
| 4799 | pNeighborRoamInfo->cfgParams.maxNeighborRetries = 0; |
| 4800 | pNeighborRoamInfo->cfgParams.neighborLookupThreshold = pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 4801 | pNeighborRoamInfo->cfgParams.neighborReassocThreshold = pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold; |
| 4802 | pNeighborRoamInfo->cfgParams.neighborScanPeriod = pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod; |
| 4803 | pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod = pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4804 | pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod = pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4805 | pNeighborRoamInfo->cfgParams.neighborInitialForcedRoamTo5GhEnable = pMac->roam.configParam.neighborRoamConfig.nNeighborInitialForcedRoamTo5GhEnable; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4806 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4807 | pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4808 | pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels; |
| 4809 | |
Hanumantha Reddy Pothula | f7d308c | 2015-03-24 13:44:52 +0530 | [diff] [blame] | 4810 | if (pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels != 0) |
| 4811 | { |
| 4812 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4813 | vos_mem_malloc(pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels); |
| 4814 | |
Hanumantha Reddy Pothula | f7d308c | 2015-03-24 13:44:52 +0530 | [diff] [blame] | 4815 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 4816 | { |
| 4817 | smsLog(pMac, LOGE, FL("Memory Allocation for CFG Channel List failed")); |
| 4818 | return eHAL_STATUS_RESOURCES; |
| 4819 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4820 | |
Hanumantha Reddy Pothula | f7d308c | 2015-03-24 13:44:52 +0530 | [diff] [blame] | 4821 | /* Update the roam global structure from CFG */ |
| 4822 | vos_mem_copy(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4823 | pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.channelList, |
| 4824 | pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels); |
Hanumantha Reddy Pothula | f7d308c | 2015-03-24 13:44:52 +0530 | [diff] [blame] | 4825 | } |
| 4826 | else |
| 4827 | { |
| 4828 | smsLog(pMac, LOGW, |
| 4829 | FL("invalid neighbor roam channel list: %u"), |
| 4830 | pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels); |
| 4831 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4832 | |
| 4833 | vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0); |
| 4834 | pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4835 | #ifdef FEATURE_WLAN_LFR |
Srikant Kuppa | 866893f | 2012-12-27 17:28:14 -0800 | [diff] [blame] | 4836 | pNeighborRoamInfo->lookupDOWNRssi = 0; |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4837 | pNeighborRoamInfo->uEmptyScanCount = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4838 | pNeighborRoamInfo->uScanMode = DEFAULT_SCAN; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4839 | vos_mem_set(&pNeighborRoamInfo->prevConnProfile, sizeof(tCsrRoamConnectedProfile), 0); |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 4840 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4841 | pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; |
| 4842 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4843 | status = vos_timer_init(&pNeighborRoamInfo->neighborScanTimer, VOS_TIMER_TYPE_SW, |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 4844 | csrNeighborRoamNeighborScanTimerCallback, (void *)pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4845 | |
| 4846 | if (eHAL_STATUS_SUCCESS != status) |
| 4847 | { |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4848 | smsLog(pMac, LOGE, FL("Neighbor scan timer allocation failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4849 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4850 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
| 4851 | return eHAL_STATUS_RESOURCES; |
| 4852 | } |
| 4853 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4854 | status = vos_timer_init(&pNeighborRoamInfo->neighborResultsRefreshTimer, VOS_TIMER_TYPE_SW, |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 4855 | csrNeighborRoamResultsRefreshTimerCallback, (void *)pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4856 | |
| 4857 | if (eHAL_STATUS_SUCCESS != status) |
| 4858 | { |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4859 | smsLog(pMac, LOGE, FL("Neighbor results refresh timer allocation failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4860 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4861 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4862 | vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4863 | return eHAL_STATUS_RESOURCES; |
| 4864 | } |
| 4865 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4866 | status = vos_timer_init(&pNeighborRoamInfo->emptyScanRefreshTimer, VOS_TIMER_TYPE_SW, |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4867 | csrNeighborRoamEmptyScanRefreshTimerCallback, |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 4868 | (void *)pMac); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4869 | |
| 4870 | if (eHAL_STATUS_SUCCESS != status) |
| 4871 | { |
| 4872 | smsLog(pMac, LOGE, FL("Empty scan refresh timer allocation failed")); |
| 4873 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4874 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4875 | vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); |
| 4876 | vos_timer_destroy(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 4877 | return eHAL_STATUS_RESOURCES; |
| 4878 | } |
| 4879 | |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4880 | status = vos_timer_init(&pNeighborRoamInfo->forcedInitialRoamTo5GHTimer, VOS_TIMER_TYPE_SW, |
Mukul Sharma | d177bd5 | 2015-01-05 21:03:38 +0530 | [diff] [blame] | 4881 | csrForcedInitialRoamTo5GHTimerCallback, (void *)pMac); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4882 | |
| 4883 | if (eHAL_STATUS_SUCCESS != status) |
| 4884 | { |
| 4885 | smsLog(pMac, LOGE, FL("forcedInitialRoamTo5GHTimer timer allocation failed")); |
| 4886 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4887 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
| 4888 | vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); |
| 4889 | vos_timer_destroy(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 4890 | vos_timer_destroy(&pNeighborRoamInfo->emptyScanRefreshTimer); |
| 4891 | return eHAL_STATUS_RESOURCES; |
| 4892 | } |
| 4893 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4894 | status = csrLLOpen(pMac->hHdd, &pNeighborRoamInfo->roamableAPList); |
| 4895 | if (eHAL_STATUS_SUCCESS != status) |
| 4896 | { |
| 4897 | smsLog(pMac, LOGE, FL("LL Open of roamable AP List failed")); |
| 4898 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4899 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4900 | vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); |
| 4901 | vos_timer_destroy(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 4902 | vos_timer_destroy(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4903 | vos_timer_destroy(&pNeighborRoamInfo->forcedInitialRoamTo5GHTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4904 | return eHAL_STATUS_RESOURCES; |
| 4905 | } |
| 4906 | |
| 4907 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex = CSR_NEIGHBOR_ROAM_INVALID_CHANNEL_INDEX; |
| 4908 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
| 4909 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
| 4910 | pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress = eANI_BOOLEAN_FALSE; |
| 4911 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
| 4912 | |
| 4913 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 4914 | status = csrNeighborRoamInit11rAssocInfo(pMac); |
| 4915 | if (eHAL_STATUS_SUCCESS != status) |
| 4916 | { |
| 4917 | smsLog(pMac, LOGE, FL("LL Open of roamable AP List failed")); |
| 4918 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4919 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4920 | vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); |
| 4921 | vos_timer_destroy(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 4922 | vos_timer_destroy(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4923 | vos_timer_destroy(&pNeighborRoamInfo->forcedInitialRoamTo5GHTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4924 | csrLLClose(&pNeighborRoamInfo->roamableAPList); |
| 4925 | return eHAL_STATUS_RESOURCES; |
| 4926 | } |
| 4927 | #endif |
| 4928 | /* Initialize this with the current tick count */ |
Deepthi Gowri | 4480a3f | 2016-05-18 19:30:17 +0530 | [diff] [blame] | 4929 | pNeighborRoamInfo->scanRequestTimeStamp = vos_timer_get_system_time(); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4930 | |
| 4931 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 4932 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Mukul Sharma | d68cda6 | 2015-03-20 21:25:41 +0530 | [diff] [blame] | 4933 | |
| 4934 | //Set the Last Sent Cmd as RSO_STOP |
| 4935 | pNeighborRoamInfo->lastSentCmd = ROAM_SCAN_OFFLOAD_STOP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4936 | return eHAL_STATUS_SUCCESS; |
| 4937 | } |
| 4938 | |
| 4939 | /* --------------------------------------------------------------------------- |
| 4940 | |
| 4941 | \fn csrNeighborRoamClose |
| 4942 | |
| 4943 | \brief This function closes/frees all the neighbor roam data structures |
| 4944 | |
| 4945 | \param pMac - The handle returned by macOpen. |
| 4946 | |
| 4947 | \return VOID |
| 4948 | |
| 4949 | ---------------------------------------------------------------------------*/ |
| 4950 | void csrNeighborRoamClose(tpAniSirGlobal pMac) |
| 4951 | { |
| 4952 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 4953 | |
| 4954 | if (eCSR_NEIGHBOR_ROAM_STATE_CLOSED == pNeighborRoamInfo->neighborRoamState) |
| 4955 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 4956 | smsLog(pMac, LOGW, FL("Neighbor Roam Algorithm Already Closed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4957 | return; |
| 4958 | } |
| 4959 | |
| 4960 | if (pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 4961 | vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList); |
| 4962 | |
| 4963 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL; |
| 4964 | |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 4965 | vos_timer_destroy(&pNeighborRoamInfo->neighborScanTimer); |
| 4966 | vos_timer_destroy(&pNeighborRoamInfo->neighborResultsRefreshTimer); |
| 4967 | vos_timer_destroy(&pNeighborRoamInfo->emptyScanRefreshTimer); |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 4968 | vos_timer_destroy(&pNeighborRoamInfo->forcedInitialRoamTo5GHTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4969 | |
| 4970 | /* Should free up the nodes in the list before closing the double Linked list */ |
| 4971 | csrNeighborRoamFreeRoamableBSSList(pMac, &pNeighborRoamInfo->roamableAPList); |
| 4972 | csrLLClose(&pNeighborRoamInfo->roamableAPList); |
| 4973 | |
| 4974 | if (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList) |
| 4975 | { |
| 4976 | vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); |
| 4977 | } |
| 4978 | |
| 4979 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
| 4980 | pNeighborRoamInfo->roamChannelInfo.currentChanIndex = CSR_NEIGHBOR_ROAM_INVALID_CHANNEL_INDEX; |
| 4981 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; |
| 4982 | pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; |
| 4983 | pNeighborRoamInfo->roamChannelInfo.chanListScanInProgress = eANI_BOOLEAN_FALSE; |
| 4984 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
| 4985 | |
| 4986 | /* Free the profile.. */ |
| 4987 | csrReleaseProfile(pMac, &pNeighborRoamInfo->csrNeighborRoamProfile); |
Sandeep P | c4818ef | 2012-12-13 14:19:25 -0800 | [diff] [blame] | 4988 | #ifdef FEATURE_WLAN_LFR |
Sandeep P | c2b00f6 | 2012-12-12 16:44:44 -0800 | [diff] [blame] | 4989 | csrRoamFreeConnectProfile(pMac, &pNeighborRoamInfo->prevConnProfile); |
Sandeep P | c4818ef | 2012-12-13 14:19:25 -0800 | [diff] [blame] | 4990 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4991 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 4992 | pMac->roam.neighborRoamInfo.FTRoamInfo.currentNeighborRptRetryNum = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4993 | pMac->roam.neighborRoamInfo.FTRoamInfo.numBssFromNeighborReport = 0; |
| 4994 | vos_mem_zero(pMac->roam.neighborRoamInfo.FTRoamInfo.neighboReportBssInfo, |
| 4995 | sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); |
| 4996 | csrNeighborRoamFreeRoamableBSSList(pMac, &pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList); |
| 4997 | csrLLClose(&pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList); |
| 4998 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 4999 | |
| 5000 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CLOSED) |
| 5001 | |
| 5002 | return; |
| 5003 | } |
| 5004 | |
| 5005 | /* --------------------------------------------------------------------------- |
| 5006 | |
| 5007 | \fn csrNeighborRoamRequestHandoff |
| 5008 | |
| 5009 | \brief This function triggers actual switching from one AP to the new AP. |
| 5010 | It issues disassociate with reason code as Handoff and CSR as a part of |
| 5011 | handling disassoc rsp, issues reassociate to the new AP |
| 5012 | |
| 5013 | \param pMac - The handle returned by macOpen. |
| 5014 | |
| 5015 | \return VOID |
| 5016 | |
| 5017 | ---------------------------------------------------------------------------*/ |
| 5018 | void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) |
| 5019 | { |
| 5020 | |
| 5021 | tCsrRoamInfo roamInfo; |
| 5022 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 5023 | tANI_U32 sessionId = pNeighborRoamInfo->csrSessionId; |
| 5024 | tCsrNeighborRoamBSSInfo handoffNode; |
| 5025 | extern void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSmeDisassocRsp ); |
| 5026 | tANI_U32 roamId = 0; |
Kiet Lam | 1cc9539 | 2013-11-22 15:59:36 +0530 | [diff] [blame] | 5027 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5028 | |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 5029 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 5030 | tCsrRoamInfo *roamInfoMetrics; |
| 5031 | #endif |
| 5032 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5033 | if (pMac->roam.neighborRoamInfo.neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) |
| 5034 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 5035 | smsLog(pMac, LOGE, FL("Roam requested when Neighbor roam is in %s state"), |
| 5036 | macTraceGetNeighbourRoamState( |
| 5037 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5038 | return; |
| 5039 | } |
| 5040 | |
c_hpothu | b8bdd36 | 2014-10-29 20:49:02 +0530 | [diff] [blame] | 5041 | if (eANI_BOOLEAN_FALSE == |
| 5042 | csrNeighborRoamGetHandoffAPInfo(pMac, &handoffNode)) |
| 5043 | { |
| 5044 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5045 | FL("failed to obtain handoff AP")); |
| 5046 | return; |
| 5047 | } |
| 5048 | |
| 5049 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 5050 | FL("HANDOFF CANDIDATE BSSID "MAC_ADDRESS_STR), |
| 5051 | MAC_ADDR_ARRAY(handoffNode.pBssDescription->bssId)); |
| 5052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5053 | vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo)); |
| 5054 | csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, &roamInfo, roamId, eCSR_ROAM_FT_START, |
| 5055 | eSIR_SME_SUCCESS); |
| 5056 | |
| 5057 | vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo)); |
| 5058 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING) |
| 5059 | |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 5060 | #ifdef FEATURE_WLAN_LFR_METRICS |
| 5061 | /* LFR metrics - pre-auth completion metric. |
| 5062 | Send the event to supplicant that pre-auth successfully completed */ |
| 5063 | roamInfoMetrics = vos_mem_malloc(sizeof(tCsrRoamInfo)); |
| 5064 | if (NULL == roamInfoMetrics) |
| 5065 | { |
| 5066 | smsLog(pMac, LOG1, FL("Memory allocation failed!")); |
| 5067 | } |
| 5068 | else |
| 5069 | { |
| 5070 | vos_mem_copy((void *)roamInfoMetrics->bssid, |
| 5071 | (void *)&handoffNode.pBssDescription->bssId, sizeof(tCsrBssid)); |
| 5072 | csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, |
| 5073 | roamInfoMetrics, 0, eCSR_ROAM_HANDOVER_SUCCESS, 0); |
Mukul Sharma | bff8d72 | 2014-07-22 18:39:05 +0530 | [diff] [blame] | 5074 | vos_mem_free(roamInfoMetrics); |
Yue Ma | ef60827 | 2013-04-08 23:09:17 -0700 | [diff] [blame] | 5075 | } |
| 5076 | #endif |
| 5077 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5078 | /* Free the profile.. Just to make sure we dont leak memory here */ |
| 5079 | csrReleaseProfile(pMac, &pNeighborRoamInfo->csrNeighborRoamProfile); |
| 5080 | /* Create the Handoff AP profile. Copy the currently connected profile and update only the BSSID and channel number |
| 5081 | This should happen before issuing disconnect */ |
Kiet Lam | 1cc9539 | 2013-11-22 15:59:36 +0530 | [diff] [blame] | 5082 | status = csrRoamCopyConnectedProfile(pMac, |
| 5083 | pNeighborRoamInfo->csrSessionId, |
| 5084 | &pNeighborRoamInfo->csrNeighborRoamProfile); |
| 5085 | if(eHAL_STATUS_SUCCESS != status) |
| 5086 | { |
| 5087 | VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5088 | FL("csrRoamCopyConnectedProfile returned failed %d"), status); |
| 5089 | return; |
| 5090 | } |
| 5091 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5092 | vos_mem_copy(pNeighborRoamInfo->csrNeighborRoamProfile.BSSIDs.bssid, handoffNode.pBssDescription->bssId, sizeof(tSirMacAddr)); |
| 5093 | pNeighborRoamInfo->csrNeighborRoamProfile.ChannelInfo.ChannelList[0] = handoffNode.pBssDescription->channelId; |
| 5094 | |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 5095 | NEIGHBOR_ROAM_DEBUG(pMac, LOGW, " csrRoamHandoffRequested: disassociating with current AP"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5096 | |
| 5097 | if(!HAL_STATUS_SUCCESS(csrRoamIssueDisassociateCmd(pMac, sessionId, eCSR_DISCONNECT_REASON_HANDOFF))) |
| 5098 | { |
Kiran Kumar Lokere | 3334fbb | 2013-03-07 12:36:05 -0800 | [diff] [blame] | 5099 | smsLog(pMac, LOGW, "csrRoamHandoffRequested: fail to issue disassociate"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5100 | return; |
| 5101 | } |
| 5102 | |
| 5103 | //notify HDD for handoff, providing the BSSID too |
| 5104 | roamInfo.reasonCode = eCsrRoamReasonBetterAP; |
| 5105 | |
| 5106 | vos_mem_copy(roamInfo.bssid, |
| 5107 | handoffNode.pBssDescription->bssId, |
| 5108 | sizeof( tCsrBssid )); |
| 5109 | |
| 5110 | csrRoamCallCallback(pMac, sessionId, &roamInfo, 0, eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE); |
| 5111 | |
| 5112 | |
| 5113 | return; |
| 5114 | } |
| 5115 | |
| 5116 | /* --------------------------------------------------------------------------- |
| 5117 | |
| 5118 | \fn csrNeighborRoamIsHandoffInProgress |
| 5119 | |
| 5120 | \brief This function returns whether handoff is in progress or not based on |
| 5121 | the current neighbor roam state |
| 5122 | |
| 5123 | \param pMac - The handle returned by macOpen. |
| 5124 | is11rReassoc - Return whether reassoc is of type 802.11r reassoc |
| 5125 | |
| 5126 | \return eANI_BOOLEAN_TRUE if reassoc in progress, eANI_BOOLEAN_FALSE otherwise |
| 5127 | |
| 5128 | ---------------------------------------------------------------------------*/ |
| 5129 | tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac) |
| 5130 | { |
| 5131 | if (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == pMac->roam.neighborRoamInfo.neighborRoamState) |
| 5132 | return eANI_BOOLEAN_TRUE; |
| 5133 | |
| 5134 | return eANI_BOOLEAN_FALSE; |
| 5135 | } |
| 5136 | |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 5137 | #if defined(WLAN_FEATURE_VOWIFI_11R) || defined(WLAN_FEATURE_NEIGHBOR_ROAMING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5138 | /* --------------------------------------------------------------------------- |
| 5139 | |
| 5140 | \fn csrNeighborRoamIs11rAssoc |
| 5141 | |
| 5142 | \brief This function returns whether the current association is a 11r assoc or not |
| 5143 | |
| 5144 | \param pMac - The handle returned by macOpen. |
| 5145 | |
| 5146 | \return eANI_BOOLEAN_TRUE if current assoc is 11r, eANI_BOOLEAN_FALSE otherwise |
| 5147 | |
| 5148 | ---------------------------------------------------------------------------*/ |
| 5149 | tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac) |
| 5150 | { |
| 5151 | return pMac->roam.neighborRoamInfo.is11rAssoc; |
| 5152 | } |
| 5153 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 5154 | |
| 5155 | |
| 5156 | /* --------------------------------------------------------------------------- |
| 5157 | |
| 5158 | \fn csrNeighborRoamGetHandoffAPInfo |
| 5159 | |
| 5160 | \brief This function returns the best possible AP for handoff. For 11R case, it |
| 5161 | returns the 1st entry from pre-auth done list. For non-11r case, it returns |
| 5162 | the 1st entry from roamable AP list |
| 5163 | |
| 5164 | \param pMac - The handle returned by macOpen. |
| 5165 | pHandoffNode - AP node that is the handoff candidate returned |
| 5166 | |
c_hpothu | b8bdd36 | 2014-10-29 20:49:02 +0530 | [diff] [blame] | 5167 | \return eANI_BOOLEAN_TRUE if able find handoff AP, eANI_BOOLEAN_FALSE otherwise |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5168 | |
| 5169 | ---------------------------------------------------------------------------*/ |
c_hpothu | b8bdd36 | 2014-10-29 20:49:02 +0530 | [diff] [blame] | 5170 | tANI_BOOLEAN csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo pHandoffNode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5171 | { |
| 5172 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
c_hpothu | b8bdd36 | 2014-10-29 20:49:02 +0530 | [diff] [blame] | 5173 | tpCsrNeighborRoamBSSInfo pBssNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5174 | |
| 5175 | VOS_ASSERT(NULL != pHandoffNode); |
| 5176 | |
| 5177 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 5178 | if (pNeighborRoamInfo->is11rAssoc) |
| 5179 | { |
| 5180 | /* Always the BSS info in the head is the handoff candidate */ |
| 5181 | pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL); |
| 5182 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList)); |
| 5183 | } |
| 5184 | else |
| 5185 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5186 | #ifdef FEATURE_WLAN_ESE |
| 5187 | if (pNeighborRoamInfo->isESEAssoc) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5188 | { |
| 5189 | /* Always the BSS info in the head is the handoff candidate */ |
| 5190 | pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL); |
| 5191 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList)); |
| 5192 | } |
| 5193 | else |
| 5194 | #endif |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 5195 | #ifdef FEATURE_WLAN_LFR |
Madan Mohan Koyyalamudi | 03aae5f | 2012-11-28 01:51:22 +0530 | [diff] [blame] | 5196 | if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 5197 | { |
| 5198 | /* Always the BSS info in the head is the handoff candidate */ |
| 5199 | pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL); |
| 5200 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList)); |
| 5201 | } |
| 5202 | else |
| 5203 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5204 | { |
| 5205 | pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->roamableAPList, NULL); |
| 5206 | NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->roamableAPList)); |
| 5207 | } |
c_hpothu | b8bdd36 | 2014-10-29 20:49:02 +0530 | [diff] [blame] | 5208 | |
| 5209 | if (NULL == pBssNode) |
| 5210 | { |
| 5211 | return eANI_BOOLEAN_FALSE; |
| 5212 | } |
| 5213 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5214 | vos_mem_copy(pHandoffNode, pBssNode, sizeof(tCsrNeighborRoamBSSInfo)); |
| 5215 | |
c_hpothu | b8bdd36 | 2014-10-29 20:49:02 +0530 | [diff] [blame] | 5216 | return eANI_BOOLEAN_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5217 | } |
| 5218 | |
| 5219 | /* --------------------------------------------------------------------------- |
| 5220 | \brief This function returns TRUE if preauth is completed |
| 5221 | |
| 5222 | \param pMac - The handle returned by macOpen. |
| 5223 | |
| 5224 | \return boolean |
| 5225 | |
| 5226 | ---------------------------------------------------------------------------*/ |
| 5227 | tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac) |
| 5228 | { |
| 5229 | return (pMac->roam.neighborRoamInfo.neighborRoamState == |
| 5230 | eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE); |
| 5231 | } |
| 5232 | |
| 5233 | /* --------------------------------------------------------------------------- |
| 5234 | \brief In the event that we are associated with AP1 and we have |
| 5235 | completed pre auth with AP2. Then we receive a deauth/disassoc from |
| 5236 | AP1. |
| 5237 | At this point neighbor roam is in pre auth done state, pre auth timer |
| 5238 | is running. We now handle this case by stopping timer and clearing |
| 5239 | the pre-auth state. We basically clear up and just go to disconnected |
| 5240 | state. |
| 5241 | |
| 5242 | \param pMac - The handle returned by macOpen. |
| 5243 | |
| 5244 | \return boolean |
| 5245 | ---------------------------------------------------------------------------*/ |
| 5246 | void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac) |
| 5247 | { |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 5248 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5249 | if (pMac->roam.neighborRoamInfo.neighborRoamState != |
| 5250 | eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) return; |
| 5251 | |
| 5252 | // Stop timer |
Madan Mohan Koyyalamudi | a48c681 | 2013-07-11 12:01:37 +0530 | [diff] [blame] | 5253 | vos_timer_stop(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5254 | |
| 5255 | // Transition to init state |
| 5256 | CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) |
Varun Reddy Yeturu | b4dedf2 | 2013-09-13 15:58:26 -0700 | [diff] [blame] | 5257 | pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5258 | } |
| 5259 | |
Srikant Kuppa | fef66a7 | 2013-01-30 17:32:44 -0800 | [diff] [blame] | 5260 | /* --------------------------------------------------------------------------- |
Srikant Kuppa | a3ed0a3 | 2013-02-20 07:24:43 -0800 | [diff] [blame] | 5261 | \brief This function returns TRUE if background scan triggered by |
| 5262 | LFR is in progress. |
Srikant Kuppa | fef66a7 | 2013-01-30 17:32:44 -0800 | [diff] [blame] | 5263 | |
| 5264 | \param halHandle - The handle from HDD context. |
| 5265 | |
| 5266 | \return boolean |
| 5267 | |
| 5268 | ---------------------------------------------------------------------------*/ |
| 5269 | tANI_BOOLEAN csrNeighborRoamScanRspPending (tHalHandle hHal) |
| 5270 | { |
| 5271 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5272 | return (pMac->roam.neighborRoamInfo.scanRspPending); |
| 5273 | } |
| 5274 | |
Srinivas Girigowda | a553c46 | 2013-03-07 19:42:52 -0800 | [diff] [blame] | 5275 | /* --------------------------------------------------------------------------- |
| 5276 | \brief This function returns TRUE if STA is in the middle of roaming states |
| 5277 | |
| 5278 | \param halHandle - The handle from HDD context. |
| 5279 | |
| 5280 | \return boolean |
| 5281 | |
| 5282 | ---------------------------------------------------------------------------*/ |
| 5283 | tANI_BOOLEAN csrNeighborMiddleOfRoaming (tHalHandle hHal) |
| 5284 | { |
| 5285 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5286 | tANI_BOOLEAN val = (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == pMac->roam.neighborRoamInfo.neighborRoamState) || |
| 5287 | (eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING == pMac->roam.neighborRoamInfo.neighborRoamState) || |
| 5288 | (eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE == pMac->roam.neighborRoamInfo.neighborRoamState) || |
| 5289 | (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pMac->roam.neighborRoamInfo.neighborRoamState) || |
| 5290 | (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN == pMac->roam.neighborRoamInfo.neighborRoamState); |
| 5291 | return (val); |
| 5292 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 5293 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 5294 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | a553c46 | 2013-03-07 19:42:52 -0800 | [diff] [blame] | 5295 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 5296 | \fn csrNeighborRoamCandidateFoundIndHdlr |
| 5297 | |
| 5298 | \brief This function is called by CSR as soon as TL posts the candidate |
| 5299 | found indication to SME via MC thread |
| 5300 | |
| 5301 | \param pMac - The handle returned by macOpen. |
| 5302 | pMsg - Msg sent by PE |
| 5303 | |
| 5304 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 5305 | |
| 5306 | ---------------------------------------------------------------------------*/ |
| 5307 | eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, void* pMsg) |
| 5308 | { |
| 5309 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 5310 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5311 | /* we must be in connected state, if not ignore it */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5312 | if ((eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) |
| 5313 | || (pNeighborRoamInfo->uOsRequestedHandoff)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 5314 | { |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5315 | smsLog(pMac, LOGE, FL("Received in not CONNECTED state OR uOsRequestedHandoff is set. Ignore it")); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 5316 | status = eHAL_STATUS_FAILURE; |
| 5317 | } |
| 5318 | else |
| 5319 | { |
| 5320 | /* We are about to start a fresh scan cycle, |
| 5321 | * purge non-P2P results from the past */ |
| 5322 | csrScanFlushSelectiveResult(pMac, VOS_FALSE); |
| 5323 | /* Once it gets the candidates found indication from PE, will issue a scan |
| 5324 | - req to PE with “freshScan” in scanreq structure set as follows: |
| 5325 | 0x42 - Return & purge LFR scan results |
| 5326 | */ |
| 5327 | status = csrScanRequestLfrResult(pMac, pNeighborRoamInfo->csrSessionId, |
| 5328 | csrNeighborRoamScanResultRequestCallback, pMac); |
| 5329 | } |
| 5330 | |
| 5331 | return status; |
| 5332 | } |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5333 | |
| 5334 | /* --------------------------------------------------------------------------- |
| 5335 | |
| 5336 | \fn csrNeighborRoamProcessHandoffReq |
| 5337 | |
| 5338 | \brief This function is called start with the handoff process. First do a |
| 5339 | SSID scan for the BSSID provided |
| 5340 | |
| 5341 | \param pMac - The handle returned by macOpen. |
| 5342 | |
| 5343 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 5344 | |
| 5345 | ---------------------------------------------------------------------------*/ |
| 5346 | eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac) |
| 5347 | { |
| 5348 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 5349 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5350 | tANI_U32 roamId; |
| 5351 | tCsrRoamProfile *pProfile = NULL; |
| 5352 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pNeighborRoamInfo->csrSessionId ); |
| 5353 | tANI_U8 i = 0; |
Selvaraj, Sridhar | 95e226f | 2016-06-18 12:27:25 +0530 | [diff] [blame] | 5354 | uint8_t roam_now = 0; |
| 5355 | uint8_t roamable_ap_count = 0; |
| 5356 | tCsrScanResultFilter scan_filter; |
| 5357 | tScanResultHandle scan_result; |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5358 | |
krunal soni | 587bf01 | 2014-02-04 12:35:11 -0800 | [diff] [blame] | 5359 | if (NULL == pSession) |
| 5360 | { |
| 5361 | smsLog(pMac, LOGE, FL("pSession is NULL ")); |
| 5362 | return eHAL_STATUS_FAILURE; |
| 5363 | } |
| 5364 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5365 | do |
| 5366 | { |
| 5367 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5368 | pProfile = vos_mem_malloc(sizeof(tCsrRoamProfile)); |
| 5369 | if ( NULL == pProfile ) |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5370 | { |
| 5371 | smsLog(pMac, LOGE, FL("Memory alloc failed")); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5372 | return eHAL_STATUS_FAILURE; |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5373 | } |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5374 | vos_mem_set(pProfile, sizeof(tCsrRoamProfile), 0); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5375 | status = csrRoamCopyProfile(pMac, pProfile, pSession->pCurRoamProfile); |
| 5376 | if(!HAL_STATUS_SUCCESS(status)) |
| 5377 | { |
| 5378 | smsLog(pMac, LOGE, FL("Profile copy failed")); |
| 5379 | break; |
| 5380 | } |
| 5381 | |
| 5382 | //Add the BSSID & Channel |
| 5383 | pProfile->BSSIDs.numOfBSSIDs = 1; |
| 5384 | pProfile->BSSIDs.bssid = vos_mem_malloc(sizeof(tSirMacAddr) * pProfile->BSSIDs.numOfBSSIDs); |
| 5385 | if (NULL == pProfile->BSSIDs.bssid) |
| 5386 | { |
| 5387 | smsLog(pMac, LOGE, FL("mem alloc failed for BSSID")); |
| 5388 | status = eHAL_STATUS_FAILURE; |
| 5389 | break; |
| 5390 | } |
| 5391 | |
| 5392 | vos_mem_zero(pProfile->BSSIDs.bssid, sizeof(tSirMacAddr) * pProfile->BSSIDs.numOfBSSIDs); |
| 5393 | |
| 5394 | /* Populate the BSSID from handoff info received from HDD */ |
| 5395 | for (i = 0; i < pProfile->BSSIDs.numOfBSSIDs; i++) |
| 5396 | { |
| 5397 | vos_mem_copy(&pProfile->BSSIDs.bssid[i], |
| 5398 | pNeighborRoamInfo->handoffReqInfo.bssid, sizeof(tSirMacAddr)); |
| 5399 | } |
| 5400 | |
| 5401 | pProfile->ChannelInfo.numOfChannels = 1; |
| 5402 | pProfile->ChannelInfo.ChannelList = |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5403 | vos_mem_malloc(sizeof(*pProfile->ChannelInfo.ChannelList) * |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5404 | pProfile->ChannelInfo.numOfChannels); |
| 5405 | if (NULL == pProfile->ChannelInfo.ChannelList) |
| 5406 | { |
| 5407 | smsLog(pMac, LOGE, FL("mem alloc failed for ChannelList")); |
| 5408 | status = eHAL_STATUS_FAILURE; |
| 5409 | break; |
| 5410 | } |
| 5411 | pProfile->ChannelInfo.ChannelList[0] = pNeighborRoamInfo->handoffReqInfo.channel; |
| 5412 | |
Selvaraj, Sridhar | 95e226f | 2016-06-18 12:27:25 +0530 | [diff] [blame] | 5413 | /* |
| 5414 | * For User space connect requests, the scan has already been done. |
| 5415 | * So, check if the BSS descriptor exists in the scan cache and |
| 5416 | * proceed with the handoff instead of a redundant scan again. |
| 5417 | */ |
| 5418 | if (pNeighborRoamInfo->handoffReqInfo.src == CONNECT_CMD_USERSPACE) { |
| 5419 | smsLog(pMac, LOG1, FL("Connect cmd with bssid within same ESS")); |
| 5420 | status = csrNeighborRoamPrepareScanProfileFilter( |
| 5421 | pMac, &scan_filter); |
| 5422 | smsLog(pMac, LOG1, FL("Filter creation status = %d"), status); |
| 5423 | status = csrScanGetResult(pMac, &scan_filter, &scan_result); |
| 5424 | roam_now = csrNeighborRoamProcessScanResults(pMac, &scan_result); |
| 5425 | roamable_ap_count = csrLLCount(&pNeighborRoamInfo->roamableAPList); |
| 5426 | csrFreeScanFilter(pMac, &scan_filter); |
| 5427 | smsLog(pMac, LOG1, FL("roam_now=%d, roamable_ap_count=%d"), |
| 5428 | roam_now, roamable_ap_count); |
| 5429 | } |
| 5430 | if (roam_now && roamable_ap_count) { |
| 5431 | csrNeighborRoamTriggerHandoff(pMac, pNeighborRoamInfo); |
| 5432 | } else { |
| 5433 | status = csrScanForSSID(pMac, pSession->sessionId, |
| 5434 | pProfile, roamId, FALSE); |
| 5435 | if(!HAL_STATUS_SUCCESS(status)) |
| 5436 | smsLog(pMac, LOGE, FL("SSID scan failed")); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5437 | } |
| 5438 | }while(0); |
| 5439 | |
| 5440 | if(NULL != pProfile) |
| 5441 | { |
| 5442 | csrReleaseProfile(pMac, pProfile); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5443 | vos_mem_free(pProfile); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5444 | } |
| 5445 | |
| 5446 | return status; |
| 5447 | } |
| 5448 | |
| 5449 | /* --------------------------------------------------------------------------- |
| 5450 | |
| 5451 | \fn csrNeighborRoamSssidScanDone |
| 5452 | |
| 5453 | \brief This function is called once SSID scan is done. If SSID scan failed |
| 5454 | to find our candidate add an entry to csr scan cache ourself before starting |
| 5455 | the handoff process |
| 5456 | |
| 5457 | \param pMac - The handle returned by macOpen. |
| 5458 | |
| 5459 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 5460 | |
| 5461 | ---------------------------------------------------------------------------*/ |
| 5462 | eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status) |
| 5463 | { |
| 5464 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 5465 | eHalStatus hstatus; |
| 5466 | |
| 5467 | smsLog(pMac, LOGE, FL("called ")); |
| 5468 | |
| 5469 | /* we must be in connected state, if not ignore it */ |
| 5470 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) |
| 5471 | { |
| 5472 | smsLog(pMac, LOGE, FL("Received in not CONNECTED state. Ignore it")); |
| 5473 | return eHAL_STATUS_FAILURE; |
| 5474 | } |
| 5475 | |
| 5476 | //if SSID scan failed to find our candidate add an entry to csr scan cache ourself |
| 5477 | if(!HAL_STATUS_SUCCESS(status)) |
| 5478 | { |
| 5479 | smsLog(pMac, LOGE, FL("Add an entry to csr scan cache")); |
| 5480 | hstatus = csrScanCreateEntryInScanCache(pMac, pNeighborRoamInfo->csrSessionId, |
| 5481 | pNeighborRoamInfo->handoffReqInfo.bssid, |
| 5482 | pNeighborRoamInfo->handoffReqInfo.channel); |
| 5483 | if (eHAL_STATUS_SUCCESS != hstatus) |
| 5484 | { |
| 5485 | smsLog(pMac, LOGE, FL("csrScanCreateEntryInScanCache failed with status %d"), hstatus); |
| 5486 | return eHAL_STATUS_FAILURE; |
| 5487 | } |
| 5488 | } |
| 5489 | |
| 5490 | /* Now we have completed scanning for the candidate provided by HDD. Let move on to HO*/ |
| 5491 | hstatus = csrNeighborRoamProcessScanComplete(pMac); |
| 5492 | |
| 5493 | if (eHAL_STATUS_SUCCESS != hstatus) |
| 5494 | { |
| 5495 | smsLog(pMac, LOGE, FL("Neighbor scan process complete failed with status %d"), hstatus); |
| 5496 | return eHAL_STATUS_FAILURE; |
| 5497 | } |
| 5498 | return eHAL_STATUS_SUCCESS; |
| 5499 | } |
| 5500 | |
Selvaraj, Sridhar | 32417ed | 2016-06-22 15:19:12 +0530 | [diff] [blame] | 5501 | /** |
| 5502 | * csr_neighbor_roam_handler_assign_handoff_src() - Assign source of |
| 5503 | * roam handoff |
| 5504 | * @pNeighborRoamInfo: Pointer to csr neighbor roam control info |
| 5505 | * @pHandoffReqInfo: Pointer to the Handoff request |
| 5506 | * |
| 5507 | * Return: None |
| 5508 | */ |
| 5509 | #ifndef QCA_WIFI_ISOC |
| 5510 | static inline void csr_neighbor_roam_handler_assign_handoff_src( |
| 5511 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo, |
| 5512 | tAniHandoffReq *pHandoffReqInfo) |
| 5513 | { |
| 5514 | pNeighborRoamInfo->handoffReqInfo.src |
| 5515 | = pHandoffReqInfo->handoff_src; |
| 5516 | } |
| 5517 | #else |
| 5518 | static inline void csr_neighbor_roam_handler_assign_handoff_src( |
| 5519 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo, |
| 5520 | tAniHandoffReq *pHandoffReqInfo) |
| 5521 | { |
| 5522 | } |
| 5523 | #endif |
| 5524 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5525 | /* --------------------------------------------------------------------------- |
| 5526 | |
| 5527 | \fn csrNeighborRoamHandoffReqHdlr |
| 5528 | |
| 5529 | \brief This function is called by CSR as soon as it gets a handoff request |
| 5530 | to SME via MC thread |
| 5531 | |
| 5532 | \param pMac - The handle returned by macOpen. |
| 5533 | pMsg - Msg sent by HDD |
| 5534 | |
| 5535 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 5536 | |
| 5537 | ---------------------------------------------------------------------------*/ |
| 5538 | eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg) |
| 5539 | { |
| 5540 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 5541 | tAniHandoffReq *pHandoffReqInfo; |
| 5542 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5543 | /* we must be in connected state, if not ignore it */ |
| 5544 | if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) |
| 5545 | { |
| 5546 | smsLog(pMac, LOGE, FL("Received in not CONNECTED state. Ignore it")); |
| 5547 | status = eHAL_STATUS_FAILURE; |
| 5548 | } |
| 5549 | else |
| 5550 | { |
| 5551 | //save the handoff info came from HDD as part of the reassoc req |
| 5552 | pHandoffReqInfo = (tAniHandoffReq *)pMsg; |
| 5553 | if (NULL != pHandoffReqInfo) |
| 5554 | { |
| 5555 | //sanity check |
| 5556 | if (VOS_FALSE == vos_mem_compare(pHandoffReqInfo->bssid, |
| 5557 | pNeighborRoamInfo->currAPbssid, |
| 5558 | sizeof(tSirMacAddr))) |
| 5559 | { |
| 5560 | |
| 5561 | pNeighborRoamInfo->handoffReqInfo.channel = pHandoffReqInfo->channel; |
Selvaraj, Sridhar | 32417ed | 2016-06-22 15:19:12 +0530 | [diff] [blame] | 5562 | csr_neighbor_roam_handler_assign_handoff_src(pNeighborRoamInfo, |
| 5563 | pHandoffReqInfo); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5564 | vos_mem_copy(pNeighborRoamInfo->handoffReqInfo.bssid, |
| 5565 | pHandoffReqInfo->bssid, |
| 5566 | 6); |
| 5567 | pNeighborRoamInfo->uOsRequestedHandoff = 1; |
| 5568 | status = csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, |
| 5569 | REASON_OS_REQUESTED_ROAMING_NOW); |
| 5570 | if (eHAL_STATUS_SUCCESS != status) |
| 5571 | { |
| 5572 | smsLog(pMac, LOGE, FL("csrRoamOffloadScan failed")); |
| 5573 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
| 5574 | } |
| 5575 | } |
| 5576 | else |
| 5577 | { |
| 5578 | smsLog(pMac, LOGE, FL("Received req has same BSSID as current AP!!")); |
| 5579 | status = eHAL_STATUS_FAILURE; |
| 5580 | } |
| 5581 | } |
| 5582 | else |
| 5583 | { |
| 5584 | smsLog(pMac, LOGE, FL("Received msg is NULL")); |
| 5585 | status = eHAL_STATUS_FAILURE; |
| 5586 | } |
| 5587 | } |
| 5588 | |
| 5589 | return status; |
| 5590 | } |
| 5591 | |
| 5592 | /* --------------------------------------------------------------------------- |
| 5593 | |
| 5594 | \fn csrNeighborRoamProceedWithHandoffReq |
| 5595 | |
| 5596 | \brief This function is called by CSR as soon as it gets rsp back for |
| 5597 | ROAM_SCAN_OFFLOAD_STOP with reason REASON_OS_REQUESTED_ROAMING_NOW |
| 5598 | |
| 5599 | \param pMac - The handle returned by macOpen. |
| 5600 | |
| 5601 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 5602 | |
| 5603 | ---------------------------------------------------------------------------*/ |
| 5604 | eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac) |
| 5605 | { |
| 5606 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 5607 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5608 | /* we must be in connected state, if not ignore it */ |
| 5609 | if ((eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) |
| 5610 | || (!pNeighborRoamInfo->uOsRequestedHandoff)) |
| 5611 | { |
| 5612 | smsLog(pMac, LOGE, FL("Received in not CONNECTED state or uOsRequestedHandoff is not set. Ignore it")); |
| 5613 | status = eHAL_STATUS_FAILURE; |
| 5614 | } |
| 5615 | else |
| 5616 | { |
| 5617 | //Let's go ahead with handoff |
| 5618 | status = csrNeighborRoamProcessHandoffReq(pMac); |
| 5619 | } |
| 5620 | if(!HAL_STATUS_SUCCESS(status)) |
| 5621 | { |
| 5622 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
| 5623 | } |
| 5624 | return status; |
| 5625 | } |
| 5626 | |
| 5627 | /* --------------------------------------------------------------------------- |
| 5628 | |
Varun Reddy Yeturu | e3af428 | 2013-06-07 00:56:52 -0700 | [diff] [blame] | 5629 | \fn csrNeighborRoamStartLfrScan |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5630 | |
| 5631 | \brief This function is called if HDD requested handoff failed for some |
Varun Reddy Yeturu | e3af428 | 2013-06-07 00:56:52 -0700 | [diff] [blame] | 5632 | reason. start the LFR logic at that point.By the time, this function is |
| 5633 | called, a STOP command has already been issued. |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5634 | |
| 5635 | \param pMac - The handle returned by macOpen. |
| 5636 | |
| 5637 | \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise |
| 5638 | |
| 5639 | ---------------------------------------------------------------------------*/ |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 5640 | eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac, tANI_U8 OffloadCmdStopReason) |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5641 | { |
| 5642 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 5643 | |
| 5644 | smsLog(pMac, LOGE, |
| 5645 | FL(" uOsRequestedHandoff=%d isForcedInitialRoamTo5GH=%d OffloadCmdStopReason = %d"), |
| 5646 | pNeighborRoamInfo->uOsRequestedHandoff, |
| 5647 | pNeighborRoamInfo->isForcedInitialRoamTo5GH, |
| 5648 | OffloadCmdStopReason); |
| 5649 | |
| 5650 | if(OffloadCmdStopReason == REASON_OS_REQUESTED_ROAMING_NOW) |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5651 | pNeighborRoamInfo->uOsRequestedHandoff = 0; |
Mukul Sharma | 20aa658 | 2014-08-07 21:36:12 +0530 | [diff] [blame] | 5652 | if(OffloadCmdStopReason == REASON_INITIAL_FORCED_ROAM_TO_5G) |
| 5653 | pNeighborRoamInfo->isForcedInitialRoamTo5GH = 0; |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5654 | /* There is no candidate or We are not roaming Now. |
| 5655 | * Inform the FW to restart Roam Offload Scan */ |
Varun Reddy Yeturu | e3af428 | 2013-06-07 00:56:52 -0700 | [diff] [blame] | 5656 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 5657 | |
| 5658 | return eHAL_STATUS_SUCCESS; |
| 5659 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 5660 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5661 | #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ |