sched_clock: Disable seqlock lockdep usage in sched_clock()
[linux-2.6/btrfs-unstable.git] / drivers / staging / rtl8192u / r819xU_HTType.h
blob2cbb8e6584f893fb6ab714a8ad57dd4ef356e7cb
1 #ifndef _R819XU_HTTYPE_H_
2 #define _R819XU_HTTYPE_H_
5 /*----------------------------------------------------------------------
6 * The HT Capability element is present in beacons, association request,
7 * reassociation request and probe response frames
8 *----------------------------------------------------------------------*/
10 /* Operation mode value */
11 #define HT_OPMODE_NO_PROTECT 0
12 #define HT_OPMODE_OPTIONAL 1
13 #define HT_OPMODE_40MHZ_PROTECT 2
14 #define HT_OPMODE_MIXED 3
16 /* MIMO Power Save Settings */
17 #define MIMO_PS_STATIC 0
18 #define MIMO_PS_DYNAMIC 1
19 #define MIMO_PS_NOLIMIT 3
22 /* There should be 128 bits to cover all of the MCS rates. However, since
23 * 8190 does not support too much rates, one integer is quite enough. */
25 #define sHTCLng 4
28 #define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff
29 #define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00
30 #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP \
31 (HT_MCS_1SS_BITMAP | HT_MCS_1SS_2SS_BITMAP)
34 typedef enum _HT_MCS_RATE {
35 HT_MCS0 = 0x00000001,
36 HT_MCS1 = 0x00000002,
37 HT_MCS2 = 0x00000004,
38 HT_MCS3 = 0x00000008,
39 HT_MCS4 = 0x00000010,
40 HT_MCS5 = 0x00000020,
41 HT_MCS6 = 0x00000040,
42 HT_MCS7 = 0x00000080,
43 HT_MCS8 = 0x00000100,
44 HT_MCS9 = 0x00000200,
45 HT_MCS10 = 0x00000400,
46 HT_MCS11 = 0x00000800,
47 HT_MCS12 = 0x00001000,
48 HT_MCS13 = 0x00002000,
49 HT_MCS14 = 0x00004000,
50 HT_MCS15 = 0x00008000,
51 /* Do not define MCS32 here although 8190 support MCS32 */
52 } HT_MCS_RATE, *PHT_MCS_RATE;
54 /* Represent Channel Width in HT Capabilities */
55 typedef enum _HT_CHANNEL_WIDTH {
56 HT_CHANNEL_WIDTH_20 = 0,
57 HT_CHANNEL_WIDTH_20_40 = 1,
58 } HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH;
60 /* Represent Extension Channel Offset in HT Capabilities
61 * This is available only in 40Mhz mode. */
62 typedef enum _HT_EXTCHNL_OFFSET {
63 HT_EXTCHNL_OFFSET_NO_EXT = 0,
64 HT_EXTCHNL_OFFSET_UPPER = 1,
65 HT_EXTCHNL_OFFSET_NO_DEF = 2,
66 HT_EXTCHNL_OFFSET_LOWER = 3,
67 } HT_EXTCHNL_OFFSET, *PHT_EXTCHNL_OFFSET;
69 typedef enum _CHNLOP {
70 CHNLOP_NONE = 0, /* No Action now */
71 CHNLOP_SCAN = 1, /* Scan in progress */
72 CHNLOP_SWBW = 2, /* Bandwidth switching in progress */
73 CHNLOP_SWCHNL = 3, /* Software Channel switching in progress */
74 } CHNLOP, *PCHNLOP;
76 /* Determine if the Channel Operation is in progress */
77 #define CHHLOP_IN_PROGRESS(_pHTInfo) \
78 (((_pHTInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE)
81 typedef enum _HT_ACTION {
82 ACT_RECOMMAND_WIDTH = 0,
83 ACT_MIMO_PWR_SAVE = 1,
84 ACT_PSMP = 2,
85 ACT_SET_PCO_PHASE = 3,
86 ACT_MIMO_CHL_MEASURE = 4,
87 ACT_RECIPROCITY_CORRECT = 5,
88 ACT_MIMO_CSI_MATRICS = 6,
89 ACT_MIMO_NOCOMPR_STEER = 7,
90 ACT_MIMO_COMPR_STEER = 8,
91 ACT_ANTENNA_SELECT = 9,
92 } HT_ACTION, *PHT_ACTION;
95 /* Define sub-carrier mode for 40MHZ. */
96 typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier {
97 SC_MODE_DUPLICATE = 0,
98 SC_MODE_LOWER = 1,
99 SC_MODE_UPPER = 2,
100 SC_MODE_FULL40MHZ = 3,
101 } HT_BW40_SC_E;
103 typedef struct _HT_CAPABILITY_ELE {
105 /* HT capability info */
106 u8 AdvCoding:1;
107 u8 ChlWidth:1;
108 u8 MimoPwrSave:2;
109 u8 GreenField:1;
110 u8 ShortGI20Mhz:1;
111 u8 ShortGI40Mhz:1;
112 u8 TxSTBC:1;
113 u8 RxSTBC:2;
114 u8 DelayBA:1;
115 u8 MaxAMSDUSize:1;
116 u8 DssCCk:1;
117 u8 PSMP:1;
118 u8 Rsvd1:1;
119 u8 LSigTxopProtect:1;
121 /* MAC HT parameters info */
122 u8 MaxRxAMPDUFactor:2;
123 u8 MPDUDensity:3;
124 u8 Rsvd2:3;
126 /* Supported MCS set */
127 u8 MCS[16];
130 /* Extended HT Capability Info */
131 u16 ExtHTCapInfo;
133 /* TXBF Capabilities */
134 u8 TxBFCap[4];
136 /* Antenna Selection Capabilities */
137 u8 ASCap;
139 } __packed HT_CAPABILITY_ELE, *PHT_CAPABILITY_ELE;
141 /*------------------------------------------------------------
142 * The HT Information element is present in beacons
143 * Only AP is required to include this element
144 *------------------------------------------------------------*/
146 typedef struct _HT_INFORMATION_ELE {
147 u8 ControlChl;
149 u8 ExtChlOffset:2;
150 u8 RecommemdedTxWidth:1;
151 u8 RIFS:1;
152 u8 PSMPAccessOnly:1;
153 u8 SrvIntGranularity:3;
155 u8 OptMode:2;
156 u8 NonGFDevPresent:1;
157 u8 Revd1:5;
158 u8 Revd2:8;
160 u8 Rsvd3:6;
161 u8 DualBeacon:1;
162 u8 DualCTSProtect:1;
164 u8 SecondaryBeacon:1;
165 u8 LSigTxopProtectFull:1;
166 u8 PcoActive:1;
167 u8 PcoPhase:1;
168 u8 Rsvd4:4;
170 u8 BasicMSC[16];
171 } __packed HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
173 /* MIMO Power Save control field.
174 * This is appear in MIMO Power Save Action Frame */
175 typedef struct _MIMOPS_CTRL {
176 u8 MimoPsEnable:1;
177 u8 MimoPsMode:1;
178 u8 Reserved:6;
179 } MIMOPS_CTRL, *PMIMOPS_CTRL;
181 typedef enum _HT_SPEC_VER {
182 HT_SPEC_VER_IEEE = 0,
183 HT_SPEC_VER_EWC = 1,
184 } HT_SPEC_VER, *PHT_SPEC_VER;
186 typedef enum _HT_AGGRE_MODE_E {
187 HT_AGG_AUTO = 0,
188 HT_AGG_FORCE_ENABLE = 1,
189 HT_AGG_FORCE_DISABLE = 2,
190 } HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E;
192 /*----------------------------------------------------------------------------
193 * The Data structure is used to keep HT related variables when card is
194 * configured as non-AP STA mode.
195 * **Note** Current_xxx should be set to default value in HTInitializeHTInfo()
196 *----------------------------------------------------------------------------*/
198 typedef struct _RT_HIGH_THROUGHPUT {
199 u8 bEnableHT;
200 u8 bCurrentHTSupport;
201 /* Tx 40MHz channel capability */
202 u8 bRegBW40MHz;
203 u8 bCurBW40MHz;
204 /* Tx Short GI for 40Mhz */
205 u8 bRegShortGI40MHz;
206 u8 bCurShortGI40MHz;
207 /* Tx Short GI for 20MHz */
208 u8 bRegShortGI20MHz;
209 u8 bCurShortGI20MHz;
210 /* Tx CCK rate capability */
211 u8 bRegSuppCCK;
212 u8 bCurSuppCCK;
214 /* 802.11n spec version for "peer" */
215 HT_SPEC_VER ePeerHTSpecVer;
218 /* HT related information for "Self" */
219 /* This is HT cap element sent to peer STA, which also indicate
220 * HT Rx capabilities. */
221 HT_CAPABILITY_ELE SelfHTCap;
222 HT_INFORMATION_ELE SelfHTInfo;
224 /* HT related information for "Peer" */
225 u8 PeerHTCapBuf[32];
226 u8 PeerHTInfoBuf[32];
229 /* A-MSDU related */
230 /* This indicates Tx A-MSDU capability */
231 u8 bAMSDU_Support;
232 u16 nAMSDU_MaxSize;
233 u8 bCurrent_AMSDU_Support;
234 u16 nCurrent_AMSDU_MaxSize;
237 /* A-MPDU related */
238 /* This indicate Tx A-MPDU capability */
239 u8 bAMPDUEnable;
240 u8 bCurrentAMPDUEnable;
241 u8 AMPDU_Factor;
242 u8 CurrentAMPDUFactor;
243 u8 MPDU_Density;
244 u8 CurrentMPDUDensity;
246 /* Forced A-MPDU enable */
247 HT_AGGRE_MODE_E ForcedAMPDUMode;
248 u8 ForcedAMPDUFactor;
249 u8 ForcedMPDUDensity;
251 /* Forced A-MSDU enable */
252 HT_AGGRE_MODE_E ForcedAMSDUMode;
253 u16 ForcedAMSDUMaxSize;
255 u8 bForcedShortGI;
257 u8 CurrentOpMode;
259 /* MIMO PS related */
260 u8 SelfMimoPs;
261 u8 PeerMimoPs;
263 /* 40MHz Channel Offset settings. */
264 HT_EXTCHNL_OFFSET CurSTAExtChnlOffset;
265 u8 bCurTxBW40MHz; /* If we use 40 MHz to Tx */
266 u8 PeerBandwidth;
268 /* For Bandwidth Switching */
269 u8 bSwBwInProgress;
270 CHNLOP ChnlOp; /* sw switching channel in progress. */
271 u8 SwBwStep;
272 struct timer_list SwBwTimer;
274 /* For Realtek proprietary A-MPDU factor for aggregation */
275 u8 bRegRT2RTAggregation;
276 u8 bCurrentRT2RTAggregation;
277 u8 bCurrentRT2RTLongSlotTime;
278 u8 szRT2RTAggBuffer[10];
280 /* Rx Reorder control */
281 u8 bRegRxReorderEnable;
282 u8 bCurRxReorderEnable;
283 u8 RxReorderWinSize;
284 u8 RxReorderPendingTime;
285 u16 RxReorderDropCounter;
287 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
288 u8 UsbTxAggrNum;
289 #endif
290 #ifdef USB_RX_AGGREGATION_SUPPORT
291 u8 UsbRxFwAggrEn;
292 u8 UsbRxFwAggrPageNum;
293 u8 UsbRxFwAggrPacketNum;
294 u8 UsbRxFwAggrTimeout;
295 #endif
297 /* Add for Broadcom(Linksys) IOT. */
298 u8 bIsPeerBcm;
300 /* For IOT issue. */
301 u32 IOTAction;
302 } RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
305 /*----------------------------------------------------------------------
306 * The Data structure is used to keep HT related variable for "each Sta"
307 * when card is configured as "AP mode"
308 *----------------------------------------------------------------------*/
310 typedef struct _RT_HTINFO_STA_ENTRY {
311 u8 bEnableHT;
313 u8 bSupportCck;
315 u16 AMSDU_MaxSize;
317 u8 AMPDU_Factor;
318 u8 MPDU_Density;
320 u8 HTHighestOperaRate;
322 u8 bBw40MHz;
324 u8 MimoPs;
326 u8 McsRateSet[16];
329 } RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY;
335 /*---------------------------------------------------------------------
336 * The Data structure is used to keep HT related variable for "each AP"
337 * when card is configured as "STA mode"
338 *---------------------------------------------------------------------*/
340 typedef struct _BSS_HT {
342 u8 bdSupportHT;
344 /* HT related elements */
345 u8 bdHTCapBuf[32];
346 u16 bdHTCapLen;
347 u8 bdHTInfoBuf[32];
348 u16 bdHTInfoLen;
350 HT_SPEC_VER bdHTSpecVer;
352 u8 bdRT2RTAggregation;
353 u8 bdRT2RTLongSlotTime;
354 } BSS_HT, *PBSS_HT;
356 typedef struct _MIMO_RSSI {
357 u32 EnableAntenna;
358 u32 AntennaA;
359 u32 AntennaB;
360 u32 AntennaC;
361 u32 AntennaD;
362 u32 Average;
363 } MIMO_RSSI, *PMIMO_RSSI;
365 typedef struct _MIMO_EVM {
366 u32 EVM1;
367 u32 EVM2;
368 } MIMO_EVM, *PMIMO_EVM;
370 typedef struct _FALSE_ALARM_STATISTICS {
371 u32 Cnt_Parity_Fail;
372 u32 Cnt_Rate_Illegal;
373 u32 Cnt_Crc8_fail;
374 u32 Cnt_all;
375 } FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS;
379 #endif