1 #ifndef _RTL819XU_HTTYPE_H_
2 #define _RTL819XU_HTTYPE_H_
4 //------------------------------------------------------------
5 // The HT Capability element is present in beacons, association request,
6 // reassociation request and probe response frames
7 //------------------------------------------------------------
10 // Operation mode value
12 #define HT_OPMODE_NO_PROTECT 0
13 #define HT_OPMODE_OPTIONAL 1
14 #define HT_OPMODE_40MHZ_PROTECT 2
15 #define HT_OPMODE_MIXED 3
18 // MIMO Power Save Setings
20 #define MIMO_PS_STATIC 0
21 #define MIMO_PS_DYNAMIC 1
22 #define MIMO_PS_NOLIMIT 3
26 // There should be 128 bits to cover all of the MCS rates. However, since
27 // 8190 does not support too much rates, one integer is quite enough.
33 #define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff
34 #define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00
35 #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP
38 typedef enum _HT_MCS_RATE
{
49 HT_MCS10
= 0x00000400,
50 HT_MCS11
= 0x00000800,
51 HT_MCS12
= 0x00001000,
52 HT_MCS13
= 0x00002000,
53 HT_MCS14
= 0x00004000,
54 HT_MCS15
= 0x00008000,
55 // Do not define MCS32 here although 8190 support MCS32
56 }HT_MCS_RATE
,*PHT_MCS_RATE
;
59 // Represent Channel Width in HT Capabilities
61 typedef enum _HT_CHANNEL_WIDTH
{
62 HT_CHANNEL_WIDTH_20
= 0,
63 HT_CHANNEL_WIDTH_20_40
= 1,
64 }HT_CHANNEL_WIDTH
, *PHT_CHANNEL_WIDTH
;
67 // Represent Extension Channel Offset in HT Capabilities
68 // This is available only in 40Mhz mode.
70 typedef enum _HT_EXTCHNL_OFFSET
{
71 HT_EXTCHNL_OFFSET_NO_EXT
= 0,
72 HT_EXTCHNL_OFFSET_UPPER
= 1,
73 HT_EXTCHNL_OFFSET_NO_DEF
= 2,
74 HT_EXTCHNL_OFFSET_LOWER
= 3,
75 }HT_EXTCHNL_OFFSET
, *PHT_EXTCHNL_OFFSET
;
78 CHNLOP_NONE
= 0, // No Action now
79 CHNLOP_SCAN
= 1, // Scan in progress
80 CHNLOP_SWBW
= 2, // Bandwidth switching in progress
81 CHNLOP_SWCHNL
= 3, // Software Channel switching in progress
84 // Determine if the Channel Operation is in progress
85 #define CHHLOP_IN_PROGRESS(_pHTInfo) \
86 ((_pHTInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE
89 typedef union _HT_CAPABILITY{
108 }HT_CAPABILITY, *PHT_CAPABILITY;
110 typedef union _HT_CAPABILITY_MACPARA{
119 }HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA;
122 typedef enum _HT_ACTION
{
123 ACT_RECOMMAND_WIDTH
= 0,
124 ACT_MIMO_PWR_SAVE
= 1,
126 ACT_SET_PCO_PHASE
= 3,
127 ACT_MIMO_CHL_MEASURE
= 4,
128 ACT_RECIPROCITY_CORRECT
= 5,
129 ACT_MIMO_CSI_MATRICS
= 6,
130 ACT_MIMO_NOCOMPR_STEER
= 7,
131 ACT_MIMO_COMPR_STEER
= 8,
132 ACT_ANTENNA_SELECT
= 9,
133 } HT_ACTION
, *PHT_ACTION
;
136 /* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */
137 typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier
{
138 SC_MODE_DUPLICATE
= 0,
141 SC_MODE_FULL40MHZ
= 3,
144 typedef struct _HT_CAPABILITY_ELE
{
160 u8 LSigTxopProtect
:1;
162 //MAC HT parameters info
163 u8 MaxRxAMPDUFactor
:2;
171 //Extended HT Capability Info
177 //Antenna Selection Capabilities
180 } __attribute__ ((packed
)) HT_CAPABILITY_ELE
, *PHT_CAPABILITY_ELE
;
182 //------------------------------------------------------------
183 // The HT Information element is present in beacons
184 // Only AP is required to include this element
185 //------------------------------------------------------------
187 typedef struct _HT_INFORMATION_ELE
{
191 u8 RecommemdedTxWidth
:1;
194 u8 SrvIntGranularity
:3;
197 u8 NonGFDevPresent
:1;
205 u8 SecondaryBeacon
:1;
206 u8 LSigTxopProtectFull
:1;
212 } __attribute__ ((packed
)) HT_INFORMATION_ELE
, *PHT_INFORMATION_ELE
;
215 // MIMO Power Save control field.
216 // This is appear in MIMO Power Save Action Frame
218 typedef struct _MIMOPS_CTRL
{
222 } MIMOPS_CTRL
, *PMIMOPS_CTRL
;
224 typedef enum _HT_SPEC_VER
{
225 HT_SPEC_VER_IEEE
= 0,
227 }HT_SPEC_VER
, *PHT_SPEC_VER
;
229 typedef enum _HT_AGGRE_MODE_E
{
231 HT_AGG_FORCE_ENABLE
= 1,
232 HT_AGG_FORCE_DISABLE
= 2,
233 }HT_AGGRE_MODE_E
, *PHT_AGGRE_MODE_E
;
235 //------------------------------------------------------------
236 // The Data structure is used to keep HT related variables when card is
237 // configured as non-AP STA mode. **Note** Current_xxx should be set
238 // to default value in HTInitializeHTInfo()
239 //------------------------------------------------------------
241 typedef struct _RT_HIGH_THROUGHPUT
{
243 u8 bCurrentHTSupport
;
245 u8 bRegBW40MHz
; // Tx 40MHz channel capablity
246 u8 bCurBW40MHz
; // Tx 40MHz channel capability
248 u8 bRegShortGI40MHz
; // Tx Short GI for 40Mhz
249 u8 bCurShortGI40MHz
; // Tx Short GI for 40MHz
251 u8 bRegShortGI20MHz
; // Tx Short GI for 20MHz
252 u8 bCurShortGI20MHz
; // Tx Short GI for 20MHz
254 u8 bRegSuppCCK
; // Tx CCK rate capability
255 u8 bCurSuppCCK
; // Tx CCK rate capability
257 // 802.11n spec version for "peer"
258 HT_SPEC_VER ePeerHTSpecVer
;
261 // HT related information for "Self"
262 HT_CAPABILITY_ELE SelfHTCap
; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities.
263 HT_INFORMATION_ELE SelfHTInfo
; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities.
265 // HT related information for "Peer"
267 u8 PeerHTInfoBuf
[32];
271 u8 bAMSDU_Support
; // This indicates Tx A-MSDU capability
272 u16 nAMSDU_MaxSize
; // This indicates Tx A-MSDU capability
273 u8 bCurrent_AMSDU_Support
; // This indicates Tx A-MSDU capability
274 u16 nCurrent_AMSDU_MaxSize
; // This indicates Tx A-MSDU capability
277 // AMPDU related <2006.08.10 Emily>
278 u8 bAMPDUEnable
; // This indicate Tx A-MPDU capability
279 u8 bCurrentAMPDUEnable
; // This indicate Tx A-MPDU capability
280 u8 AMPDU_Factor
; // This indicate Tx A-MPDU capability
281 u8 CurrentAMPDUFactor
; // This indicate Tx A-MPDU capability
282 u8 MPDU_Density
; // This indicate Tx A-MPDU capability
283 u8 CurrentMPDUDensity
; // This indicate Tx A-MPDU capability
285 // Forced A-MPDU enable
286 HT_AGGRE_MODE_E ForcedAMPDUMode
;
287 u8 ForcedAMPDUFactor
;
288 u8 ForcedMPDUDensity
;
290 // Forced A-MSDU enable
291 HT_AGGRE_MODE_E ForcedAMSDUMode
;
292 u16 ForcedAMSDUMaxSize
;
302 // 40MHz Channel Offset settings.
303 HT_EXTCHNL_OFFSET CurSTAExtChnlOffset
;
304 u8 bCurTxBW40MHz
; // If we use 40 MHz to Tx
307 // For Bandwidth Switching
309 CHNLOP ChnlOp
; // software switching channel in progress. By Bruce, 2008-02-15.
311 //struct timer_list SwBwTimer; //moved to ieee80211_device. as timer_list need include some header file here.
313 // For Realtek proprietary A-MPDU factor for aggregation
314 u8 bRegRT2RTAggregation
;
315 u8 bCurrentRT2RTAggregation
;
316 u8 bCurrentRT2RTLongSlotTime
;
317 u8 szRT2RTAggBuffer
[10];
319 // Rx Reorder control
320 u8 bRegRxReorderEnable
;
321 u8 bCurRxReorderEnable
;
323 u8 RxReorderPendingTime
;
324 u16 RxReorderDropCounter
;
326 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
329 #ifdef USB_RX_AGGREGATION_SUPPORT
331 u8 UsbRxFwAggrPageNum
;
332 u8 UsbRxFwAggrPacketNum
;
333 u8 UsbRxFwAggrTimeout
;
336 // Add for Broadcom(Linksys) IOT. Joseph
342 } __attribute__ ((packed
)) RT_HIGH_THROUGHPUT
, *PRT_HIGH_THROUGHPUT
;
345 //------------------------------------------------------------
346 // The Data structure is used to keep HT related variable for "each Sta"
347 // when card is configured as "AP mode"
348 //------------------------------------------------------------
350 typedef struct _RT_HTINFO_STA_ENTRY
{
360 u8 HTHighestOperaRate
;
369 }RT_HTINFO_STA_ENTRY
, *PRT_HTINFO_STA_ENTRY
;
375 //------------------------------------------------------------
376 // The Data structure is used to keep HT related variable for "each AP"
377 // when card is configured as "STA mode"
378 //------------------------------------------------------------
380 typedef struct _BSS_HT
{
384 // HT related elements
390 HT_SPEC_VER bdHTSpecVer
;
391 //HT_CAPABILITY_ELE bdHTCapEle;
392 //HT_INFORMATION_ELE bdHTInfoEle;
394 u8 bdRT2RTAggregation
;
395 u8 bdRT2RTLongSlotTime
;
396 } __attribute__ ((packed
)) BSS_HT
, *PBSS_HT
;
398 typedef struct _MIMO_RSSI
{
405 }MIMO_RSSI
, *PMIMO_RSSI
;
407 typedef struct _MIMO_EVM
{
410 }MIMO_EVM
, *PMIMO_EVM
;
412 typedef struct _FALSE_ALARM_STATISTICS
{
414 u32 Cnt_Rate_Illegal
;
417 }FALSE_ALARM_STATISTICS
, *PFALSE_ALARM_STATISTICS
;
420 extern u8 MCS_FILTER_ALL
[16];
421 extern u8 MCS_FILTER_1SS
[16];
423 /* 2007/07/11 MH Modify the macro. Becaus STA may link with a N-AP. If we set
424 STA in A/B/G mode and AP is still in N mode. The macro will be wrong. We have
425 to add a macro to judge wireless mode. */
426 #define PICK_RATE(_nLegacyRate, _nMcsRate) \
427 (_nMcsRate==0)?(_nLegacyRate&0x7f):(_nMcsRate)
428 /* 2007/07/12 MH We only define legacy and HT wireless mode now. */
429 #define LEGACY_WIRELESS_MODE IEEE_MODE_MASK
431 #define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \
432 ((WirelessMode & (LEGACY_WIRELESS_MODE))!=0)?\
434 (PICK_RATE(LegacyRate, HTRate))
438 // MCS Bw 40 {1~7, 12~15,32}
439 #define RATE_ADPT_1SS_MASK 0xFF
440 #define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
441 #define RATE_ADPT_MCS32_MASK 0x01
443 #define IS_11N_MCS_RATE(rate) (rate&0x80)
445 typedef enum _HT_AGGRE_SIZE
{
450 }HT_AGGRE_SIZE_E
, *PHT_AGGRE_SIZE_E
;
452 /* Indicate different AP vendor for IOT issue */
453 typedef enum _HT_IOT_PEER
455 HT_IOT_PEER_UNKNOWN
= 0,
456 HT_IOT_PEER_REALTEK
= 1,
457 HT_IOT_PEER_BROADCOM
= 2,
458 HT_IOT_PEER_RALINK
= 3,
459 HT_IOT_PEER_ATHEROS
= 4,
460 HT_IOT_PEER_CISCO
= 5,
462 }HT_IOT_PEER_E
, *PHTIOT_PEER_E
;
465 // IOT Action for different AP
467 typedef enum _HT_IOT_ACTION
{
468 HT_IOT_ACT_TX_USE_AMSDU_4K
= 0x00000001,
469 HT_IOT_ACT_TX_USE_AMSDU_8K
= 0x00000002,
470 HT_IOT_ACT_DISABLE_MCS14
= 0x00000004,
471 HT_IOT_ACT_DISABLE_MCS15
= 0x00000008,
472 HT_IOT_ACT_DISABLE_ALL_2SS
= 0x00000010,
473 HT_IOT_ACT_DISABLE_EDCA_TURBO
= 0x00000020,
474 HT_IOT_ACT_MGNT_USE_CCK_6M
= 0x00000040,
475 HT_IOT_ACT_CDD_FSYNC
= 0x00000080,
476 HT_IOT_ACT_PURE_N_MODE
= 0x00000100,
477 HT_IOT_ACT_FORCED_CTS2SELF
= 0x00000200,
478 }HT_IOT_ACTION_E
, *PHT_IOT_ACTION_E
;
480 #endif //_RTL819XU_HTTYPE_H_