blob: 34b3c710ae2e3427dbf4e4c355605d0543a51d97 [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 * Airgo Networks, Inc proprietary. All rights reserved.
44 *
45 * Author: Sandesh Goel
46 * Date: 02/25/02
47 * History:-
48 * Date Modified by Modification Information
49 * --------------------------------------------------------------------
50 *
51 */
52
53#ifndef __SCH_GLOBAL_H__
54#define __SCH_GLOBAL_H__
55
56#include "sirMacPropExts.h"
57#include "limGlobal.h"
58
59#include "parserApi.h"
60
61
62#define ANI_SCH_ADAPTIVE_THRESHOLD_TH_CD 0x00000001
63#define ANI_SCH_ADAPTIVE_THRESHOLD_TH_D0 0x00000002
64
65#define ANI_SCH_ADAPTIVE_THRESHOLD_ALL (ANI_SCH_ADAPTIVE_THRESHOLD_TH_CD | ANI_SCH_ADAPTIVE_THRESHOLD_TH_D0)
66
67#define ANI_SCH_ADAPTIVE_ALGO_BAND_2GHZ 0x00000001
68#define ANI_SCH_ADAPTIVE_ALGO_BAND_5GHZ 0x00000002
69
70#define ANI_SCH_ADAPTIVE_ALGO_BAND_ALL (ANI_SCH_ADAPTIVE_ALGO_BAND_2GHZ | ANI_SCH_ADAPTIVE_ALGO_BAND_5GHZ)
71
72
73// Diagnostic bitmap defines
74
75#define SCH_DIAG_RR_TIMEOUT_DELETE 0x1
76#define SCH_DIAG_RR_LOWER_RATE 0x2
77
Yathish H69765a92012-12-13 14:57:31 -080078#ifdef WLAN_SOFTAP_VSTA_FEATURE
79#define TIM_IE_SIZE 0xA
80#else
81#define TIM_IE_SIZE 0x7
82#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070083
84// ----------------------- Beacon processing ------------------------
85
86/// Beacon structure
87#define tSchBeaconStruct tSirProbeRespBeacon
88#define tpSchBeaconStruct struct sSirProbeRespBeacon *
89
90// -------------------------------------------------------------------
91
92//****************** MISC defs *********************************
93
94/// Maximum allowable size of a beacon frame
95#if (WNI_POLARIS_FW_PRODUCT == AP)
96#define SCH_MAX_BEACON_SIZE 2048
97#else
98#define SCH_MAX_BEACON_SIZE 512
99#endif
100
101#define SCH_MAX_PROBE_RESP_SIZE 512
102
103struct schMisc {
104
105 tANI_U8 *gSchProbeRspTemplate;
106
107 /// Beginning portion of the beacon frame to be written to TFP
108 tANI_U8 *gSchBeaconFrameBegin;
109
110 /// Trailing portion of the beacon frame to be written to TFP
111 tANI_U8 *gSchBeaconFrameEnd;
112
113 /// Size of the beginning portion
114 tANI_U16 gSchBeaconOffsetBegin;
115 /// Size of the trailing portion
116 tANI_U16 gSchBeaconOffsetEnd;
117
118 tANI_U16 gSchBeaconInterval;
119
120 /// Current CFP count
121 tANI_U8 gSchCFPCount;
122
123 /// CFP Duration remaining
124 tANI_U8 gSchCFPDurRemaining;
125
126 /// CFP Maximum Duration
127 tANI_U8 gSchCFPMaxDuration;
128
129 /// Current DTIM count
130 tANI_U8 gSchDTIMCount;
131
132 /// Whether we have initiated a CFP or not
133 tANI_U8 gSchCFPInitiated;
134
135 /// Whether we have initiated a CFB or not
136 tANI_U8 gSchCFBInitiated;
137
138 /// CFP is enabled and AP is configured as HCF
139 tANI_U8 gSchCFPEnabled;
140
141 /// CFB is enabled and AP is configured as HCF
142 tANI_U8 gSchCFBEnabled;
143
144 // --------- STA ONLY state -----------
145
146 /// Indicates whether RR timer is running or not
147 tANI_U8 rrTimer[8];
148
149 /// Indicates the remaining RR timeout value if the RR timer is running
150 tANI_U16 rrTimeout[8];
151
152 /// Number of RRs transmitted
153 tANI_U16 numRR[8];
154 tANI_U16 numRRtimeouts[8];
155
156 /// flag to indicate that beacon template has been updated
157 tANI_U8 fBeaconChanged;
158
159#if defined(WLAN_SOFTAP_FEATURE) && defined(WLAN_FEATURE_P2P)
160 tANI_U16 p2pIeOffset;
161#endif
162
163};
164
165//****************** MISC defs *********************************
166
167typedef struct schStaWaitList
168{
169 tANI_U16 staId;
170 tANI_U16 count;
171} tStaWaitList, *tpStaWaitList;
172
173
174/// Global SCH structure
175typedef struct sAniSirSch
176{
177 /// The scheduler object
178 struct schMisc schObject;
179
180 // schQoSClass unsolicited;
181
182 /// Whether HCF is enabled or not
183 tANI_U8 gSchHcfEnabled;
184
185 /// Whether scan is requested by LIM or not
186 tANI_U8 gSchScanRequested;
187
188 /// Whether scan request is received by SCH or not
189 tANI_U8 gSchScanReqRcvd;
190
191#if (WNI_POLARIS_FW_PRODUCT == AP)
192 tANI_U8 gSchRRRecd;
193#endif
194
195 /// Debug flag to disable beacon generation
196 tANI_U32 gSchGenBeacon;
197
198#define SCH_MAX_ARR 100
199 tANI_U32 gSchBeaconsWritten;
200 tANI_U32 gSchBeaconsSent;
201 tANI_U32 gSchBBXportRcvCnt;
202 tANI_U32 gSchRRRcvCnt, qosNullCnt;
203 tANI_U32 gSchBcnRcvCnt;
204 tANI_U32 gSchUnknownRcvCnt;
205
206 tANI_U32 gSchBcnParseErrorCnt;
207 tANI_U32 gSchBcnIgnored;
208
209 // tTmpInstBuffer TIB;
210 // tANI_U16 gSchQuantum[8];
211
212 tANI_U32 numPoll, numData, numCorrupt;
213 tANI_U32 numBogusInt, numTxAct0;
214
215#define SCH_MAX_NUM_SCH 21
216 // tANI_U32 numSchHist[SCH_MAX_NUM_SCH];
217 // tANI_U32 defaultTxop;
218
219 tANI_U32 lastBeaconLength;
220 tANI_U16 rrTimeout;
221 tANI_U32 pollPeriod;
222 tANI_U32 keepAlive;
223 tANI_U32 multipleSched;
224 tANI_U32 pollFeedbackHist[8];
225 tANI_U32 dataFeedbackHist[8];
226 tANI_U32 maxPollTimeouts;
227 tANI_U32 checkCfbFlagStuck;
228
229 /// Sta Wait list
230 tpStaWaitList pStaWaitList;
231
232 /// Pointer to next available entry in sta wait list
233 tANI_U16 staWaitListIn;
234 /// Pointer to first waiting sta in sta wait list
235 tANI_U16 staWaitListOut;
236 /// Total number of waiting STAs in sta wait list
237 tANI_U16 staWaitListCount;
238 /// Total number of schedules to be waited
239 tANI_U16 staWaitListTotalWait;
240
241 /// Number of entries in DPH activity queue that were ignored
242 tANI_U32 ignoreDph;
243
244} tAniSirSch, *tpAniSirSch;
245
246
247#endif