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