1
2 #ifndef _RTL819XU_HTTYPE_H_
3 #define _RTL819XU_HTTYPE_H_
4
5
6
7
8
9
10
11
12
13 #define MIMO_PS_STATIC 0
14
15
16
17
18
19 #define HTCLNG 4
20
21
22
23
24 enum ht_channel_width {
25 HT_CHANNEL_WIDTH_20 = 0,
26 HT_CHANNEL_WIDTH_20_40 = 1,
27 };
28
29
30
31
32
33 enum ht_extension_chan_offset {
34 HT_EXTCHNL_OFFSET_NO_EXT = 0,
35 HT_EXTCHNL_OFFSET_UPPER = 1,
36 HT_EXTCHNL_OFFSET_NO_DEF = 2,
37 HT_EXTCHNL_OFFSET_LOWER = 3,
38 };
39
40 struct ht_capability_ele {
41
42 u8 AdvCoding:1;
43 u8 ChlWidth:1;
44 u8 MimoPwrSave:2;
45 u8 GreenField:1;
46 u8 ShortGI20Mhz:1;
47 u8 ShortGI40Mhz:1;
48 u8 TxSTBC:1;
49 u8 RxSTBC:2;
50 u8 DelayBA:1;
51 u8 MaxAMSDUSize:1;
52 u8 DssCCk:1;
53 u8 PSMP:1;
54 u8 Rsvd1:1;
55 u8 LSigTxopProtect:1;
56
57
58 u8 MaxRxAMPDUFactor:2;
59 u8 MPDUDensity:3;
60 u8 Rsvd2:3;
61
62
63 u8 MCS[16];
64
65
66 u16 ExtHTCapInfo;
67
68
69 u8 TxBFCap[4];
70
71
72 u8 ASCap;
73
74 } __packed;
75
76
77
78
79
80 typedef struct _HT_INFORMATION_ELE {
81 u8 ControlChl;
82
83 u8 ExtChlOffset:2;
84 u8 RecommemdedTxWidth:1;
85 u8 RIFS:1;
86 u8 PSMPAccessOnly:1;
87 u8 SrvIntGranularity:3;
88
89 u8 OptMode:2;
90 u8 NonGFDevPresent:1;
91 u8 Revd1:5;
92 u8 Revd2:8;
93
94 u8 Rsvd3:6;
95 u8 DualBeacon:1;
96 u8 DualCTSProtect:1;
97
98 u8 SecondaryBeacon:1;
99 u8 LSigTxopProtectFull:1;
100 u8 PcoActive:1;
101 u8 PcoPhase:1;
102 u8 Rsvd4:4;
103
104 u8 BasicMSC[16];
105 } __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
106
107 typedef enum _HT_SPEC_VER {
108 HT_SPEC_VER_IEEE = 0,
109 HT_SPEC_VER_EWC = 1,
110 } HT_SPEC_VER, *PHT_SPEC_VER;
111
112 typedef enum _HT_AGGRE_MODE_E {
113 HT_AGG_AUTO = 0,
114 HT_AGG_FORCE_ENABLE = 1,
115 HT_AGG_FORCE_DISABLE = 2,
116 } HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E;
117
118
119
120
121
122
123 typedef struct _RT_HIGH_THROUGHPUT {
124 u8 bEnableHT;
125 u8 bCurrentHTSupport;
126
127 u8 bRegBW40MHz;
128 u8 bCurBW40MHz;
129
130 u8 bRegShortGI40MHz;
131 u8 bCurShortGI40MHz;
132
133 u8 bRegShortGI20MHz;
134 u8 bCurShortGI20MHz;
135
136 u8 bRegSuppCCK;
137 u8 bCurSuppCCK;
138
139
140 HT_SPEC_VER ePeerHTSpecVer;
141
142
143 struct ht_capability_ele SelfHTCap;
144 HT_INFORMATION_ELE SelfHTInfo;
145
146
147 u8 PeerHTCapBuf[32];
148 u8 PeerHTInfoBuf[32];
149
150
151 u8 bAMSDU_Support;
152 u16 nAMSDU_MaxSize;
153 u8 bCurrent_AMSDU_Support;
154 u16 nCurrent_AMSDU_MaxSize;
155
156
157 u8 bAMPDUEnable;
158 u8 bCurrentAMPDUEnable;
159 u8 AMPDU_Factor;
160 u8 CurrentAMPDUFactor;
161 u8 MPDU_Density;
162 u8 CurrentMPDUDensity;
163
164
165 HT_AGGRE_MODE_E ForcedAMPDUMode;
166 u8 ForcedAMPDUFactor;
167 u8 ForcedMPDUDensity;
168
169
170 HT_AGGRE_MODE_E ForcedAMSDUMode;
171 u16 ForcedAMSDUMaxSize;
172
173 u8 bForcedShortGI;
174
175 u8 CurrentOpMode;
176
177
178 u8 SelfMimoPs;
179 u8 PeerMimoPs;
180
181
182 enum ht_extension_chan_offset CurSTAExtChnlOffset;
183 u8 bCurTxBW40MHz;
184 u8 PeerBandwidth;
185
186
187 u8 bSwBwInProgress;
188 u8 SwBwStep;
189
190
191
192 u8 bRegRT2RTAggregation;
193 u8 bCurrentRT2RTAggregation;
194 u8 bCurrentRT2RTLongSlotTime;
195 u8 szRT2RTAggBuffer[10];
196
197
198 u8 bRegRxReorderEnable;
199 u8 bCurRxReorderEnable;
200 u8 RxReorderWinSize;
201 u8 RxReorderPendingTime;
202 u16 RxReorderDropCounter;
203
204 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
205 u8 UsbTxAggrNum;
206 #endif
207 #ifdef USB_RX_AGGREGATION_SUPPORT
208 u8 UsbRxFwAggrEn;
209 u8 UsbRxFwAggrPageNum;
210 u8 UsbRxFwAggrPacketNum;
211 u8 UsbRxFwAggrTimeout;
212 #endif
213
214
215 u8 bIsPeerBcm;
216
217
218 u8 IOTPeer;
219 u32 IOTAction;
220 } __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
221
222
223
224
225
226 typedef struct _BSS_HT {
227 u8 bdSupportHT;
228
229
230 u8 bdHTCapBuf[32];
231 u16 bdHTCapLen;
232 u8 bdHTInfoBuf[32];
233 u16 bdHTInfoLen;
234
235 HT_SPEC_VER bdHTSpecVer;
236
237
238
239 u8 bdRT2RTAggregation;
240 u8 bdRT2RTLongSlotTime;
241 } __attribute__ ((packed)) BSS_HT, *PBSS_HT;
242
243 extern u8 MCS_FILTER_ALL[16];
244 extern u8 MCS_FILTER_1SS[16];
245
246
247
248
249
250
251 #define PICK_RATE(_nLegacyRate, _nMcsRate) \
252 (_nMcsRate == 0) ? (_nLegacyRate & 0x7f) : (_nMcsRate)
253
254 #define LEGACY_WIRELESS_MODE IEEE_MODE_MASK
255
256 #define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \
257 ((WirelessMode & (LEGACY_WIRELESS_MODE)) != 0) ? \
258 (LegacyRate) : \
259 (PICK_RATE(LegacyRate, HTRate))
260
261
262 #define RATE_ADPT_1SS_MASK 0xFF
263 #define RATE_ADPT_2SS_MASK 0xF0
264 #define RATE_ADPT_MCS32_MASK 0x01
265
266 #define IS_11N_MCS_RATE(rate) (rate & 0x80)
267
268 typedef enum _HT_AGGRE_SIZE {
269 HT_AGG_SIZE_8K = 0,
270 HT_AGG_SIZE_16K = 1,
271 HT_AGG_SIZE_32K = 2,
272 HT_AGG_SIZE_64K = 3,
273 } HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E;
274
275
276 typedef enum _HT_IOT_PEER {
277 HT_IOT_PEER_UNKNOWN = 0,
278 HT_IOT_PEER_REALTEK = 1,
279 HT_IOT_PEER_BROADCOM = 2,
280 HT_IOT_PEER_RALINK = 3,
281 HT_IOT_PEER_ATHEROS = 4,
282 HT_IOT_PEER_CISCO = 5,
283 HT_IOT_PEER_MAX = 6
284 } HT_IOT_PEER_E, *PHTIOT_PEER_E;
285
286
287
288
289 typedef enum _HT_IOT_ACTION {
290 HT_IOT_ACT_TX_USE_AMSDU_4K = 0x00000001,
291 HT_IOT_ACT_TX_USE_AMSDU_8K = 0x00000002,
292 HT_IOT_ACT_DISABLE_MCS14 = 0x00000004,
293 HT_IOT_ACT_DISABLE_MCS15 = 0x00000008,
294 HT_IOT_ACT_DISABLE_ALL_2SS = 0x00000010,
295 HT_IOT_ACT_DISABLE_EDCA_TURBO = 0x00000020,
296 HT_IOT_ACT_MGNT_USE_CCK_6M = 0x00000040,
297 HT_IOT_ACT_CDD_FSYNC = 0x00000080,
298 HT_IOT_ACT_PURE_N_MODE = 0x00000100,
299 HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200,
300 } HT_IOT_ACTION_E, *PHT_IOT_ACTION_E;
301
302 #endif