Merge tag 'pci-v4.3-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[cascardo/linux.git] / drivers / staging / rtl8192e / rtl819x_HT.h
1 /******************************************************************************
2  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3  *
4  * This program is distributed in the hope that it will be useful, but WITHOUT
5  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
7  * more details.
8  *
9  * You should have received a copy of the GNU General Public License along with
10  * this program; if not, write to the Free Software Foundation, Inc.,
11  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
12  *
13  * The full GNU General Public License is included in this distribution in the
14  * file called LICENSE.
15  *
16  * Contact Information:
17  * wlanfae <wlanfae@realtek.com>
18 ******************************************************************************/
19 #ifndef _RTL819XU_HTTYPE_H_
20 #define _RTL819XU_HTTYPE_H_
21
22 #define MIMO_PS_STATIC                          0
23
24 #define sHTCLng 4
25
26 enum ht_channel_width {
27         HT_CHANNEL_WIDTH_20 = 0,
28         HT_CHANNEL_WIDTH_20_40 = 1,
29 };
30
31 enum ht_extchnl_offset {
32         HT_EXTCHNL_OFFSET_NO_EXT = 0,
33         HT_EXTCHNL_OFFSET_UPPER = 1,
34         HT_EXTCHNL_OFFSET_NO_DEF = 2,
35         HT_EXTCHNL_OFFSET_LOWER = 3,
36 };
37
38 struct ht_capab_ele {
39
40         u8      AdvCoding:1;
41         u8      ChlWidth:1;
42         u8      MimoPwrSave:2;
43         u8      GreenField:1;
44         u8      ShortGI20Mhz:1;
45         u8      ShortGI40Mhz:1;
46         u8      TxSTBC:1;
47         u8      RxSTBC:2;
48         u8      DelayBA:1;
49         u8      MaxAMSDUSize:1;
50         u8      DssCCk:1;
51         u8      PSMP:1;
52         u8      Rsvd1:1;
53         u8      LSigTxopProtect:1;
54
55         u8      MaxRxAMPDUFactor:2;
56         u8      MPDUDensity:3;
57         u8      Rsvd2:3;
58
59         u8      MCS[16];
60
61
62         u16     ExtHTCapInfo;
63
64         u8      TxBFCap[4];
65
66         u8      ASCap;
67
68 } __packed;
69
70
71 struct ht_info_ele {
72         u8      ControlChl;
73
74         u8      ExtChlOffset:2;
75         u8      RecommemdedTxWidth:1;
76         u8      RIFS:1;
77         u8      PSMPAccessOnly:1;
78         u8      SrvIntGranularity:3;
79
80         u8      OptMode:2;
81         u8      NonGFDevPresent:1;
82         u8      Revd1:5;
83         u8      Revd2:8;
84
85         u8      Rsvd3:6;
86         u8      DualBeacon:1;
87         u8      DualCTSProtect:1;
88
89         u8      SecondaryBeacon:1;
90         u8      LSigTxopProtectFull:1;
91         u8      PcoActive:1;
92         u8      PcoPhase:1;
93         u8      Rsvd4:4;
94
95         u8      BasicMSC[16];
96 } __packed;
97
98 enum ht_spec_ver {
99         HT_SPEC_VER_IEEE = 0,
100         HT_SPEC_VER_EWC = 1,
101 };
102
103 enum ht_aggre_mode {
104         HT_AGG_AUTO = 0,
105         HT_AGG_FORCE_ENABLE = 1,
106         HT_AGG_FORCE_DISABLE = 2,
107 };
108
109
110 struct rt_hi_throughput {
111         u8                              bEnableHT;
112         u8                              bCurrentHTSupport;
113
114         u8                              bRegBW40MHz;
115         u8                              bCurBW40MHz;
116
117         u8                              bRegShortGI40MHz;
118         u8                              bCurShortGI40MHz;
119
120         u8                              bRegShortGI20MHz;
121         u8                              bCurShortGI20MHz;
122
123         u8                              bRegSuppCCK;
124         u8                              bCurSuppCCK;
125
126         enum ht_spec_ver ePeerHTSpecVer;
127
128
129         struct ht_capab_ele SelfHTCap;
130         struct ht_info_ele SelfHTInfo;
131
132         u8                              PeerHTCapBuf[32];
133         u8                              PeerHTInfoBuf[32];
134
135
136         u8                              bAMSDU_Support;
137         u16                             nAMSDU_MaxSize;
138         u8                              bCurrent_AMSDU_Support;
139         u16                             nCurrent_AMSDU_MaxSize;
140
141         u8                              bAMPDUEnable;
142         u8                              bCurrentAMPDUEnable;
143         u8                              AMPDU_Factor;
144         u8                              CurrentAMPDUFactor;
145         u8                              MPDU_Density;
146         u8                              CurrentMPDUDensity;
147
148         enum ht_aggre_mode ForcedAMPDUMode;
149         u8                              ForcedAMPDUFactor;
150         u8                              ForcedMPDUDensity;
151
152         enum ht_aggre_mode ForcedAMSDUMode;
153         u16                             ForcedAMSDUMaxSize;
154
155         u8                              bForcedShortGI;
156
157         u8                              CurrentOpMode;
158
159         u8                              SelfMimoPs;
160         u8                              PeerMimoPs;
161
162         enum ht_extchnl_offset CurSTAExtChnlOffset;
163         u8                              bCurTxBW40MHz;
164         u8                              PeerBandwidth;
165
166         u8                              bSwBwInProgress;
167         u8                              SwBwStep;
168
169         u8                              bRegRT2RTAggregation;
170         u8                              RT2RT_HT_Mode;
171         u8                              bCurrentRT2RTAggregation;
172         u8                              bCurrentRT2RTLongSlotTime;
173         u8                              szRT2RTAggBuffer[10];
174
175         u8                              bRegRxReorderEnable;
176         u8                              bCurRxReorderEnable;
177         u8                              RxReorderWinSize;
178         u8                              RxReorderPendingTime;
179         u16                             RxReorderDropCounter;
180
181         u8                              bIsPeerBcm;
182
183         u8                              IOTPeer;
184         u32                             IOTAction;
185         u8                              IOTRaFunc;
186
187         u8      bWAIotBroadcom;
188         u8      WAIotTH;
189
190         u8                              bAcceptAddbaReq;
191 } __packed;
192
193 struct bss_ht {
194
195         u8                              bdSupportHT;
196
197         u8                                      bdHTCapBuf[32];
198         u16                                     bdHTCapLen;
199         u8                                      bdHTInfoBuf[32];
200         u16                                     bdHTInfoLen;
201
202         enum ht_spec_ver bdHTSpecVer;
203         enum ht_channel_width bdBandWidth;
204
205         u8                                      bdRT2RTAggregation;
206         u8                                      bdRT2RTLongSlotTime;
207         u8                                      RT2RT_HT_Mode;
208         u8                                      bdHT1R;
209 };
210
211 extern u8 MCS_FILTER_ALL[16];
212 extern u8 MCS_FILTER_1SS[16];
213
214 #define RATE_ADPT_1SS_MASK              0xFF
215 #define RATE_ADPT_2SS_MASK              0xF0
216 #define RATE_ADPT_MCS32_MASK            0x01
217
218 enum ht_aggre_size {
219         HT_AGG_SIZE_8K = 0,
220         HT_AGG_SIZE_16K = 1,
221         HT_AGG_SIZE_32K = 2,
222         HT_AGG_SIZE_64K = 3,
223 };
224
225 enum ht_iot_peer {
226         HT_IOT_PEER_UNKNOWN = 0,
227         HT_IOT_PEER_REALTEK = 1,
228         HT_IOT_PEER_REALTEK_92SE = 2,
229         HT_IOT_PEER_BROADCOM = 3,
230         HT_IOT_PEER_RALINK = 4,
231         HT_IOT_PEER_ATHEROS = 5,
232         HT_IOT_PEER_CISCO = 6,
233         HT_IOT_PEER_MARVELL = 7,
234         HT_IOT_PEER_92U_SOFTAP = 8,
235         HT_IOT_PEER_SELF_SOFTAP = 9,
236         HT_IOT_PEER_AIRGO = 10,
237         HT_IOT_PEER_MAX = 11,
238 };
239
240 enum ht_iot_action {
241         HT_IOT_ACT_TX_USE_AMSDU_4K = 0x00000001,
242         HT_IOT_ACT_TX_USE_AMSDU_8K = 0x00000002,
243         HT_IOT_ACT_DISABLE_MCS14 = 0x00000004,
244         HT_IOT_ACT_DISABLE_MCS15 = 0x00000008,
245         HT_IOT_ACT_DISABLE_ALL_2SS = 0x00000010,
246         HT_IOT_ACT_DISABLE_EDCA_TURBO = 0x00000020,
247         HT_IOT_ACT_MGNT_USE_CCK_6M = 0x00000040,
248         HT_IOT_ACT_CDD_FSYNC = 0x00000080,
249         HT_IOT_ACT_PURE_N_MODE = 0x00000100,
250         HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200,
251         HT_IOT_ACT_FORCED_RTS = 0x00000400,
252         HT_IOT_ACT_AMSDU_ENABLE = 0x00000800,
253         HT_IOT_ACT_REJECT_ADDBA_REQ = 0x00001000,
254         HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT = 0x00002000,
255         HT_IOT_ACT_EDCA_BIAS_ON_RX = 0x00004000,
256
257         HT_IOT_ACT_HYBRID_AGGREGATION = 0x00010000,
258         HT_IOT_ACT_DISABLE_SHORT_GI = 0x00020000,
259         HT_IOT_ACT_DISABLE_HIGH_POWER = 0x00040000,
260         HT_IOT_ACT_DISABLE_TX_40_MHZ = 0x00080000,
261         HT_IOT_ACT_TX_NO_AGGREGATION = 0x00100000,
262         HT_IOT_ACT_DISABLE_TX_2SS = 0x00200000,
263
264         HT_IOT_ACT_MID_HIGHPOWER = 0x00400000,
265         HT_IOT_ACT_NULL_DATA_POWER_SAVING = 0x00800000,
266
267         HT_IOT_ACT_DISABLE_CCK_RATE = 0x01000000,
268         HT_IOT_ACT_FORCED_ENABLE_BE_TXOP = 0x02000000,
269         HT_IOT_ACT_WA_IOT_Broadcom = 0x04000000,
270
271         HT_IOT_ACT_DISABLE_RX_40MHZ_SHORT_GI = 0x08000000,
272
273 };
274
275 enum ht_iot_rafunc {
276         HT_IOT_RAFUNC_DISABLE_ALL = 0x00,
277         HT_IOT_RAFUNC_PEER_1R = 0x01,
278         HT_IOT_RAFUNC_TX_AMSDU = 0x02,
279 };
280
281 enum rt_ht_capability {
282         RT_HT_CAP_USE_TURBO_AGGR = 0x01,
283         RT_HT_CAP_USE_LONG_PREAMBLE = 0x02,
284         RT_HT_CAP_USE_AMPDU = 0x04,
285         RT_HT_CAP_USE_WOW = 0x8,
286         RT_HT_CAP_USE_SOFTAP = 0x10,
287         RT_HT_CAP_USE_92SE = 0x20,
288 };
289
290 #endif