Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 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. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | /** ------------------------------------------------------------------------- * |
| 43 | ------------------------------------------------------------------------- * |
| 44 | |
| 45 | |
| 46 | \file csrNeighborRoam.h |
| 47 | |
| 48 | Exports and types for the neighbor roaming algorithm which is sepcifically |
| 49 | designed for Android. |
| 50 | |
| 51 | Copyright (C) 2006 Airgo Networks, Incorporated |
| 52 | |
| 53 | ========================================================================== */ |
| 54 | #ifndef CSR_NEIGHBOR_ROAM_H |
| 55 | #define CSR_NEIGHBOR_ROAM_H |
| 56 | |
| 57 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
| 58 | |
| 59 | /* Enumeration of various states in neighbor roam algorithm */ |
| 60 | typedef enum |
| 61 | { |
| 62 | eCSR_NEIGHBOR_ROAM_STATE_CLOSED, |
| 63 | eCSR_NEIGHBOR_ROAM_STATE_INIT, |
| 64 | eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, |
| 65 | eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN, |
| 66 | eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING, |
| 67 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 68 | eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY, |
| 69 | eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN, |
| 70 | eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING, |
| 71 | eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE, |
| 72 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 73 | eNEIGHBOR_STATE_MAX |
| 74 | } eCsrNeighborRoamState; |
| 75 | |
| 76 | /* Parameters that are obtained from CFG */ |
| 77 | typedef struct sCsrNeighborRoamCfgParams |
| 78 | { |
| 79 | tANI_U8 maxNeighborRetries; |
| 80 | tANI_U32 neighborScanPeriod; |
| 81 | tCsrChannelInfo channelInfo; |
| 82 | tANI_U8 neighborLookupThreshold; |
| 83 | tANI_U8 neighborReassocThreshold; |
| 84 | tANI_U32 minChannelScanTime; |
| 85 | tANI_U32 maxChannelScanTime; |
| 86 | tANI_U16 neighborResultsRefreshPeriod; |
| 87 | } tCsrNeighborRoamCfgParams, *tpCsrNeighborRoamCfgParams; |
| 88 | |
| 89 | #define CSR_NEIGHBOR_ROAM_INVALID_CHANNEL_INDEX 255 |
| 90 | typedef struct sCsrNeighborRoamChannelInfo |
| 91 | { |
| 92 | tANI_BOOLEAN IAPPNeighborListReceived; // Flag to mark reception of IAPP Neighbor list |
| 93 | tANI_BOOLEAN chanListScanInProgress; |
| 94 | tANI_U8 currentChanIndex; //Current channel index that is being scanned |
| 95 | tCsrChannelInfo currentChannelListInfo; //Max number of channels in channel list and the list of channels |
| 96 | } tCsrNeighborRoamChannelInfo, *tpCsrNeighborRoamChannelInfo; |
| 97 | |
| 98 | typedef struct sCsrNeighborRoamBSSInfo |
| 99 | { |
| 100 | tListElem List; |
| 101 | tANI_U8 apPreferenceVal; |
| 102 | // tCsrScanResultInfo *scanResultInfo; |
| 103 | tpSirBssDescription pBssDescription; |
| 104 | } tCsrNeighborRoamBSSInfo, *tpCsrNeighborRoamBSSInfo; |
| 105 | |
| 106 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 107 | #define CSR_NEIGHBOR_ROAM_REPORT_QUERY_TIMEOUT 1000 //in milliseconds |
Madan Mohan Koyyalamudi | ee87bfc | 2012-09-18 17:21:00 -0700 | [diff] [blame] | 108 | #define CSR_NEIGHBOR_ROAM_PREAUTH_RSP_WAIT_MULTIPLIER 10 //in milliseconds |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | #define MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS 10 //Max number of MAC addresses with which the pre-auth was failed |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 110 | #define MAX_BSS_IN_NEIGHBOR_RPT 15 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | #define CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES 3 |
| 112 | |
| 113 | /* Black listed APs. List of MAC Addresses with which the Preauthentication was failed. */ |
| 114 | typedef struct sCsrPreauthFailListInfo |
| 115 | { |
| 116 | tANI_U8 numMACAddress; |
| 117 | tSirMacAddr macAddress[MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS]; |
| 118 | } tCsrPreauthFailListInfo, *tpCsrPreauthFailListInfo; |
| 119 | |
| 120 | typedef struct sCsrNeighborReportBssInfo |
| 121 | { |
| 122 | tANI_U8 channelNum; |
| 123 | tANI_U8 neighborScore; |
| 124 | tSirMacAddr neighborBssId; |
| 125 | } tCsrNeighborReportBssInfo, *tpCsrNeighborReportBssInfo; |
| 126 | |
| 127 | typedef struct sCsr11rAssocNeighborInfo |
| 128 | { |
| 129 | tANI_BOOLEAN preauthRspPending; |
| 130 | tANI_BOOLEAN neighborRptPending; |
| 131 | tANI_U8 currentNeighborRptRetryNum; |
| 132 | tPalTimerHandle preAuthRspWaitTimer; //This timer is used for preauth response |
| 133 | tCsrTimerInfo preAuthRspWaitTimerInfo; |
| 134 | tCsrPreauthFailListInfo preAuthFailList; |
| 135 | tANI_U32 neighborReportTimeout; |
| 136 | tANI_U32 PEPreauthRespTimeout; |
| 137 | tANI_U8 numPreAuthRetries; |
| 138 | tDblLinkList preAuthDoneList; /* Linked list which consists or preauthenticated nodes */ |
| 139 | tANI_U8 numBssFromNeighborReport; |
| 140 | tCsrNeighborReportBssInfo neighboReportBssInfo[MAX_BSS_IN_NEIGHBOR_RPT]; //Contains info needed during REPORT_SCAN State |
| 141 | } tCsr11rAssocNeighborInfo, *tpCsr11rAssocNeighborInfo; |
| 142 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 143 | |
| 144 | /* Below macros are used to increase the registered neighbor Lookup threshold with TL when |
| 145 | * we dont see any AP during back ground scanning. The values are incremented from neighborLookupThreshold |
| 146 | * from CFG, incremented by 5,10,15...50(LOOKUP_THRESHOLD_INCREMENT_MULTIPLIER_MAX * |
| 147 | * NEIGHBOR_LOOKUP_THRESHOLD_INCREMENT_CONSTANT) */ |
| 148 | #define NEIGHBOR_LOOKUP_THRESHOLD_INCREMENT_CONSTANT 5 |
| 149 | #define LOOKUP_THRESHOLD_INCREMENT_MULTIPLIER_MAX 4 |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 150 | /* |
| 151 | * Set lookup UP threshold 5 dB higher than the configured |
| 152 | * lookup DOWN threshold to minimize thrashing between |
| 153 | * DOWN and UP events. |
Madan Mohan Koyyalamudi | 04039a1 | 2012-10-21 12:24:56 -0700 | [diff] [blame] | 154 | */ |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 155 | #define NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD \ |
| 156 | (pNeighborRoamInfo->cfgParams.neighborLookupThreshold-5) |
| 157 | #ifdef FEATURE_WLAN_LFR |
| 158 | typedef enum |
| 159 | { |
| 160 | eFirstEmptyScan=1, |
| 161 | eSecondEmptyScan, |
| 162 | eThirdEmptyScan, |
| 163 | eFourthEmptyScan, |
| 164 | eFifthEmptyScan, |
| 165 | } eNeighborRoamEmptyScanCount; |
| 166 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 167 | |
| 168 | /* Complete control information for neighbor roam algorithm */ |
| 169 | typedef struct sCsrNeighborRoamControlInfo |
| 170 | { |
| 171 | eCsrNeighborRoamState neighborRoamState; |
| 172 | eCsrNeighborRoamState prevNeighborRoamState; |
| 173 | tCsrNeighborRoamCfgParams cfgParams; |
| 174 | tCsrBssid currAPbssid; // current assoc AP |
| 175 | tANI_U8 currAPoperationChannel; // current assoc AP |
| 176 | tPalTimerHandle neighborScanTimer; |
| 177 | tPalTimerHandle neighborResultsRefreshTimer; |
| 178 | tCsrTimerInfo neighborScanTimerInfo; |
| 179 | tCsrNeighborRoamChannelInfo roamChannelInfo; |
| 180 | tANI_U8 currentNeighborLookupThreshold; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 181 | tANI_BOOLEAN scanRspPending; |
| 182 | tANI_TIMESTAMP scanRequestTimeStamp; |
| 183 | tDblLinkList roamableAPList; // List of current FT candidates |
| 184 | tANI_U32 csrSessionId; |
| 185 | tCsrRoamProfile csrNeighborRoamProfile; |
| 186 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 187 | tANI_BOOLEAN is11rAssoc; |
| 188 | tCsr11rAssocNeighborInfo FTRoamInfo; |
| 189 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 190 | #ifdef FEATURE_WLAN_CCX |
| 191 | tANI_BOOLEAN isCCXAssoc; |
| 192 | tANI_BOOLEAN isVOAdmitted; |
| 193 | tANI_U32 MinQBssLoadRequired; |
| 194 | #endif |
Madan Mohan Koyyalamudi | dd3c966 | 2012-11-09 17:39:30 -0800 | [diff] [blame] | 195 | #ifdef FEATURE_WLAN_LFR |
| 196 | tANI_U8 uEmptyScanCount; /* Consecutive number of times scan |
| 197 | yielded no results. */ |
| 198 | tCsrRoamConnectedProfile prevConnProfile; /* Previous connected profile. If the |
| 199 | new profile does not match previous |
| 200 | we re-initialize occupied channel list */ |
| 201 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 202 | } tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo; |
| 203 | |
| 204 | |
| 205 | /* All the necessary Function declarations are here */ |
| 206 | eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac,tANI_U8 sessionId, VOS_STATUS status); |
| 207 | eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac,tANI_U8 sessionId); |
| 208 | tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac); |
| 209 | void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac); |
| 210 | eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac); |
| 211 | void csrNeighborRoamClose(tpAniSirGlobal pMac); |
| 212 | void csrNeighborRoamPurgePreauthFailedList(tpAniSirGlobal pMac); |
| 213 | VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac); |
| 214 | VOS_STATUS csrNeighborRoamTransitionToPreauthDone(tpAniSirGlobal pMac); |
| 215 | eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter); |
| 216 | void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo pHandoffNode); |
Madan Mohan Koyyalamudi | 7a579cc | 2012-10-21 11:25:39 -0700 | [diff] [blame] | 217 | eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, VOS_STATUS vosStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 218 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 219 | tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac); |
| 220 | #endif |
| 221 | VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac); |
| 222 | void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac); |
| 223 | tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac); |
| 224 | |
| 225 | |
| 226 | |
| 227 | #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ |
| 228 | |
| 229 | #endif /* CSR_NEIGHBOR_ROAM_H */ |