blob: 996b582be7b508f8872671c7853bf517cc8d7d15 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * 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 Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
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 */
60typedef 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 */
77typedef 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
90typedef 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
98typedef 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 Koyyalamudiee87bfc2012-09-18 17:21:00 -0700108#define CSR_NEIGHBOR_ROAM_PREAUTH_RSP_WAIT_MULTIPLIER 10 //in milliseconds
Jeff Johnson295189b2012-06-20 16:38:30 -0700109#define MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS 10 //Max number of MAC addresses with which the pre-auth was failed
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700110#define MAX_BSS_IN_NEIGHBOR_RPT 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700111#define CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES 3
112
113/* Black listed APs. List of MAC Addresses with which the Preauthentication was failed. */
114typedef struct sCsrPreauthFailListInfo
115{
116 tANI_U8 numMACAddress;
117 tSirMacAddr macAddress[MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS];
118} tCsrPreauthFailListInfo, *tpCsrPreauthFailListInfo;
119
120typedef struct sCsrNeighborReportBssInfo
121{
122 tANI_U8 channelNum;
123 tANI_U8 neighborScore;
124 tSirMacAddr neighborBssId;
125} tCsrNeighborReportBssInfo, *tpCsrNeighborReportBssInfo;
126
127typedef 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 Koyyalamudidd3c9662012-11-09 17:39:30 -0800150/*
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 Koyyalamudi04039a12012-10-21 12:24:56 -0700154 */
Madan Mohan Koyyalamudidd3c9662012-11-09 17:39:30 -0800155#define NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD \
156 (pNeighborRoamInfo->cfgParams.neighborLookupThreshold-5)
157#ifdef FEATURE_WLAN_LFR
158typedef enum
159{
160 eFirstEmptyScan=1,
161 eSecondEmptyScan,
162 eThirdEmptyScan,
163 eFourthEmptyScan,
164 eFifthEmptyScan,
165} eNeighborRoamEmptyScanCount;
166#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700167
168/* Complete control information for neighbor roam algorithm */
169typedef 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 Johnson295189b2012-06-20 16:38:30 -0700181 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 Koyyalamudidd3c9662012-11-09 17:39:30 -0800195#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 */
Srikant Kuppa866893f2012-12-27 17:28:14 -0800201 tANI_S8 lookupDOWNRssi;
Madan Mohan Koyyalamudidd3c9662012-11-09 17:39:30 -0800202#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700203} tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo;
204
205
206/* All the necessary Function declarations are here */
207eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac,tANI_U8 sessionId, VOS_STATUS status);
208eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac,tANI_U8 sessionId);
209tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac);
210void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac);
211eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac);
212void csrNeighborRoamClose(tpAniSirGlobal pMac);
213void csrNeighborRoamPurgePreauthFailedList(tpAniSirGlobal pMac);
214VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac);
215VOS_STATUS csrNeighborRoamTransitionToPreauthDone(tpAniSirGlobal pMac);
216eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter);
217void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo pHandoffNode);
Madan Mohan Koyyalamudi7a579cc2012-10-21 11:25:39 -0700218eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, VOS_STATUS vosStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -0700219#ifdef WLAN_FEATURE_VOWIFI_11R
220tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac);
221#endif
222VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac);
223void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac);
224tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac);
Srikant Kuppafef66a72013-01-30 17:32:44 -0800225tANI_BOOLEAN csrNeighborRoamScanRspPending(tHalHandle hHal);
Jeff Johnson295189b2012-06-20 16:38:30 -0700226
227
228#endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */
229
230#endif /* CSR_NEIGHBOR_ROAM_H */