1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _RTL819XU_HTTYPE_H_
3 #define _RTL819XU_HTTYPE_H_
6 * The HT Capability element is present in beacons, association request,
7 * reassociation request and probe response frames
11 * MIMO Power Save Settings
13 #define MIMO_PS_STATIC 0
16 * There should be 128 bits to cover all of the MCS rates. However, since
17 * 8190 does not support too much rates, one integer is quite enough.
22 * Represent Channel Width in HT Capabilities
24 enum ht_channel_width {
25 HT_CHANNEL_WIDTH_20 = 0,
26 HT_CHANNEL_WIDTH_20_40 = 1,
30 * Represent Extension Channel Offset in HT Capabilities
31 * This is available only in 40Mhz mode.
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,
40 struct ht_capability_ele {
57 //MAC HT parameters info
58 u8 MaxRxAMPDUFactor:2;
65 //Extended HT Capability Info
71 //Antenna Selection Capabilities
77 * The HT Information element is present in beacons
78 * Only AP is required to include this element
80 typedef struct _HT_INFORMATION_ELE {
84 u8 RecommemdedTxWidth:1;
87 u8 SrvIntGranularity:3;
99 u8 LSigTxopProtectFull:1;
105 } __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
107 typedef enum _HT_SPEC_VER {
108 HT_SPEC_VER_IEEE = 0,
110 } HT_SPEC_VER, *PHT_SPEC_VER;
112 typedef enum _HT_AGGRE_MODE_E {
114 HT_AGG_FORCE_ENABLE = 1,
115 HT_AGG_FORCE_DISABLE = 2,
116 } HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E;
119 * The Data structure is used to keep HT related variables when card is
120 * configured as non-AP STA mode. **Note** Current_xxx should be set
121 * to default value in HTInitializeHTInfo()
123 typedef struct _RT_HIGH_THROUGHPUT {
125 u8 bCurrentHTSupport;
127 u8 bRegBW40MHz; // Tx 40MHz channel capability
128 u8 bCurBW40MHz; // Tx 40MHz channel capability
130 u8 bRegShortGI40MHz; // Tx Short GI for 40Mhz
131 u8 bCurShortGI40MHz; // Tx Short GI for 40MHz
133 u8 bRegShortGI20MHz; // Tx Short GI for 20MHz
134 u8 bCurShortGI20MHz; // Tx Short GI for 20MHz
136 u8 bRegSuppCCK; // Tx CCK rate capability
137 u8 bCurSuppCCK; // Tx CCK rate capability
139 // 802.11n spec version for "peer"
140 HT_SPEC_VER ePeerHTSpecVer;
142 // HT related information for "Self"
143 struct ht_capability_ele SelfHTCap; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities.
144 HT_INFORMATION_ELE SelfHTInfo; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities.
146 // HT related information for "Peer"
148 u8 PeerHTInfoBuf[32];
151 u8 bAMSDU_Support; // This indicates Tx A-MSDU capability
152 u16 nAMSDU_MaxSize; // This indicates Tx A-MSDU capability
153 u8 bCurrent_AMSDU_Support; // This indicates Tx A-MSDU capability
154 u16 nCurrent_AMSDU_MaxSize; // This indicates Tx A-MSDU capability
156 // AMPDU related <2006.08.10 Emily>
157 u8 bAMPDUEnable; // This indicate Tx A-MPDU capability
158 u8 bCurrentAMPDUEnable; // This indicate Tx A-MPDU capability
159 u8 AMPDU_Factor; // This indicate Tx A-MPDU capability
160 u8 CurrentAMPDUFactor; // This indicate Tx A-MPDU capability
161 u8 MPDU_Density; // This indicate Tx A-MPDU capability
162 u8 CurrentMPDUDensity; // This indicate Tx A-MPDU capability
164 // Forced A-MPDU enable
165 HT_AGGRE_MODE_E ForcedAMPDUMode;
166 u8 ForcedAMPDUFactor;
167 u8 ForcedMPDUDensity;
169 // Forced A-MSDU enable
170 HT_AGGRE_MODE_E ForcedAMSDUMode;
171 u16 ForcedAMSDUMaxSize;
181 // 40MHz Channel Offset settings.
182 enum ht_extension_chan_offset CurSTAExtChnlOffset;
183 u8 bCurTxBW40MHz; // If we use 40 MHz to Tx
186 // For Bandwidth Switching
189 //struct timer_list SwBwTimer; //moved to ieee80211_device. as timer_list need include some header file here.
191 // For Realtek proprietary A-MPDU factor for aggregation
192 u8 bRegRT2RTAggregation;
193 u8 bCurrentRT2RTAggregation;
194 u8 bCurrentRT2RTLongSlotTime;
195 u8 szRT2RTAggBuffer[10];
197 // Rx Reorder control
198 u8 bRegRxReorderEnable;
199 u8 bCurRxReorderEnable;
201 u8 RxReorderPendingTime;
202 u16 RxReorderDropCounter;
204 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
207 #ifdef USB_RX_AGGREGATION_SUPPORT
209 u8 UsbRxFwAggrPageNum;
210 u8 UsbRxFwAggrPacketNum;
211 u8 UsbRxFwAggrTimeout;
214 // Add for Broadcom(Linksys) IOT. Joseph
220 } __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
223 * The Data structure is used to keep HT related variable for "each AP"
224 * when card is configured as "STA mode"
226 typedef struct _BSS_HT {
229 // HT related elements
235 HT_SPEC_VER bdHTSpecVer;
236 //struct ht_capability_ele bdHTCapEle;
237 //HT_INFORMATION_ELE bdHTInfoEle;
239 u8 bdRT2RTAggregation;
240 u8 bdRT2RTLongSlotTime;
241 } __attribute__ ((packed)) BSS_HT, *PBSS_HT;
243 extern u8 MCS_FILTER_ALL[16];
244 extern u8 MCS_FILTER_1SS[16];
247 * 2007/07/11 MH Modify the macro. Becaus STA may link with a N-AP. If we set
248 * STA in A/B/G mode and AP is still in N mode. The macro will be wrong. We have
249 * to add a macro to judge wireless mode.
251 #define PICK_RATE(_nLegacyRate, _nMcsRate) \
252 (_nMcsRate == 0) ? (_nLegacyRate & 0x7f) : (_nMcsRate)
253 /* 2007/07/12 MH We only define legacy and HT wireless mode now. */
254 #define LEGACY_WIRELESS_MODE IEEE_MODE_MASK
256 #define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \
257 ((WirelessMode & (LEGACY_WIRELESS_MODE)) != 0) ? \
259 (PICK_RATE(LegacyRate, HTRate))
261 // MCS Bw 40 {1~7, 12~15,32}
262 #define RATE_ADPT_1SS_MASK 0xFF
263 #define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
264 #define RATE_ADPT_MCS32_MASK 0x01
266 #define IS_11N_MCS_RATE(rate) (rate & 0x80)
268 typedef enum _HT_AGGRE_SIZE {
273 } HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E;
275 /* Indicate different AP vendor for IOT issue */
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,
284 } HT_IOT_PEER_E, *PHTIOT_PEER_E;
287 * IOT Action for different AP
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;
302 #endif //_RTL819XU_HTTYPE_H_