linux/drivers/staging/rtl8192su/ieee80211/rtl819x_HT.h
<<
>>
Prefs
   1#ifndef _RTL819XU_HTTYPE_H_
   2#define _RTL819XU_HTTYPE_H_
   3
   4//------------------------------------------------------------
   5// The HT Capability element is present in beacons, association request,
   6//      reassociation request and probe response frames
   7//------------------------------------------------------------
   8
   9//
  10// Operation mode value
  11//
  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
  16
  17//
  18// MIMO Power Save Setings
  19//
  20#define MIMO_PS_STATIC                          0
  21#define MIMO_PS_DYNAMIC                 1
  22#define MIMO_PS_NOLIMIT                 3
  23
  24
  25//
  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.
  28//
  29
  30#define sHTCLng 4
  31
  32
  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
  36
  37
  38typedef enum _HT_MCS_RATE{
  39        HT_MCS0   = 0x00000001,
  40        HT_MCS1   = 0x00000002,
  41        HT_MCS2   = 0x00000004,
  42        HT_MCS3   = 0x00000008,
  43        HT_MCS4   = 0x00000010,
  44        HT_MCS5   = 0x00000020,
  45        HT_MCS6   = 0x00000040,
  46        HT_MCS7   = 0x00000080,
  47        HT_MCS8   = 0x00000100,
  48        HT_MCS9   = 0x00000200,
  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;
  57
  58//
  59// Represent Channel Width in HT Capabilities
  60//
  61typedef enum _HT_CHANNEL_WIDTH{
  62        HT_CHANNEL_WIDTH_20 = 0,
  63        HT_CHANNEL_WIDTH_20_40 = 1,
  64}HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH;
  65
  66//
  67// Represent Extention Channel Offset in HT Capabilities
  68// This is available only in 40Mhz mode.
  69//
  70typedef 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;
  76
  77typedef enum _CHNLOP{
  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
  82} CHNLOP, *PCHNLOP;
  83
  84// Determine if the Channel Operation is in progress
  85#define CHHLOP_IN_PROGRESS(_pHTInfo)    \
  86                ((_pHTInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE
  87
  88/*
  89typedef union _HT_CAPABILITY{
  90        u16     ShortData;
  91        u8      CharData[2];
  92        struct
  93        {
  94                u16     AdvCoding:1;
  95                u16     ChlWidth:1;
  96                u16     MimoPwrSave:2;
  97                u16     GreenField:1;
  98                u16     ShortGI20Mhz:1;
  99                u16     ShortGI40Mhz:1;
 100                u16     STBC:1;
 101                u16     BeamForm:1;
 102                u16     DelayBA:1;
 103                u16     MaxAMSDUSize:1;
 104                u16     DssCCk:1;
 105                u16     PSMP:1;
 106                u16     Rsvd:3;
 107        }Field;
 108}HT_CAPABILITY, *PHT_CAPABILITY;
 109
 110typedef union _HT_CAPABILITY_MACPARA{
 111        u8      ShortData;
 112        u8      CharData[1];
 113        struct
 114        {
 115                u8      MaxRxAMPDU:2;
 116                u8      MPDUDensity:2;
 117                u8      Rsvd:4;
 118        }Field;
 119}HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA;
 120*/
 121
 122typedef enum _HT_ACTION{
 123        ACT_RECOMMAND_WIDTH             = 0,
 124        ACT_MIMO_PWR_SAVE               = 1,
 125        ACT_PSMP                                        = 2,
 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;
 134
 135
 136/* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */
 137typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier{
 138        SC_MODE_DUPLICATE = 0,
 139        SC_MODE_LOWER = 1,
 140        SC_MODE_UPPER = 2,
 141        SC_MODE_FULL40MHZ = 3,
 142}HT_BW40_SC_E;
 143
 144typedef struct _HT_CAPABILITY_ELE{
 145
 146        //HT capability info
 147        u8      AdvCoding:1;
 148        u8      ChlWidth:1;
 149        u8      MimoPwrSave:2;
 150        u8      GreenField:1;
 151        u8      ShortGI20Mhz:1;
 152        u8      ShortGI40Mhz:1;
 153        u8      TxSTBC:1;
 154        u8      RxSTBC:2;
 155        u8      DelayBA:1;
 156        u8      MaxAMSDUSize:1;
 157        u8      DssCCk:1;
 158        u8      PSMP:1;
 159        u8      Rsvd1:1;
 160        u8      LSigTxopProtect:1;
 161
 162        //MAC HT parameters info
 163        u8      MaxRxAMPDUFactor:2;
 164        u8      MPDUDensity:3;
 165        u8      Rsvd2:3;
 166
 167        //Supported MCS set
 168        u8      MCS[16];
 169
 170
 171        //Extended HT Capability Info
 172        u16     ExtHTCapInfo;
 173
 174        //TXBF Capabilities
 175        u8      TxBFCap[4];
 176
 177        //Antenna Selection Capabilities
 178        u8      ASCap;
 179
 180} __attribute__ ((packed)) HT_CAPABILITY_ELE, *PHT_CAPABILITY_ELE;
 181
 182//------------------------------------------------------------
 183// The HT Information element is present in beacons
 184// Only AP is required to include this element
 185//------------------------------------------------------------
 186
 187typedef struct _HT_INFORMATION_ELE{
 188        u8      ControlChl;
 189
 190        u8      ExtChlOffset:2;
 191        u8      RecommemdedTxWidth:1;
 192        u8      RIFS:1;
 193        u8      PSMPAccessOnly:1;
 194        u8      SrvIntGranularity:3;
 195
 196        u8      OptMode:2;
 197        u8      NonGFDevPresent:1;
 198        u8      Revd1:5;
 199        u8      Revd2:8;
 200
 201        u8      Rsvd3:6;
 202        u8      DualBeacon:1;
 203        u8      DualCTSProtect:1;
 204
 205        u8      SecondaryBeacon:1;
 206        u8      LSigTxopProtectFull:1;
 207        u8      PcoActive:1;
 208        u8      PcoPhase:1;
 209        u8      Rsvd4:4;
 210
 211        u8      BasicMSC[16];
 212} __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
 213
 214//
 215// MIMO Power Save control field.
 216// This is appear in MIMO Power Save Action Frame
 217//
 218typedef struct _MIMOPS_CTRL{
 219        u8      MimoPsEnable:1;
 220        u8      MimoPsMode:1;
 221        u8      Reserved:6;
 222} MIMOPS_CTRL, *PMIMOPS_CTRL;
 223
 224typedef enum _HT_SPEC_VER{
 225        HT_SPEC_VER_IEEE = 0,
 226        HT_SPEC_VER_EWC = 1,
 227}HT_SPEC_VER, *PHT_SPEC_VER;
 228
 229typedef enum _HT_AGGRE_MODE_E{
 230        HT_AGG_AUTO = 0,
 231        HT_AGG_FORCE_ENABLE = 1,
 232        HT_AGG_FORCE_DISABLE = 2,
 233}HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E;
 234
 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//------------------------------------------------------------
 240
 241typedef struct _RT_HIGH_THROUGHPUT{
 242        u8                              bEnableHT;
 243        u8                              bCurrentHTSupport;
 244
 245        u8                              bRegBW40MHz;                            // Tx 40MHz channel capablity
 246        u8                              bCurBW40MHz;                            // Tx 40MHz channel capability
 247
 248        u8                              bRegShortGI40MHz;                       // Tx Short GI for 40Mhz
 249        u8                              bCurShortGI40MHz;                       // Tx Short GI for 40MHz
 250
 251        u8                              bRegShortGI20MHz;                       // Tx Short GI for 20MHz
 252        u8                              bCurShortGI20MHz;                       // Tx Short GI for 20MHz
 253
 254        u8                              bRegSuppCCK;                            // Tx CCK rate capability
 255        u8                              bCurSuppCCK;                            // Tx CCK rate capability
 256
 257        // 802.11n spec version for "peer"
 258        HT_SPEC_VER                     ePeerHTSpecVer;
 259
 260
 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.
 264
 265        // HT related information for "Peer"
 266        u8                              PeerHTCapBuf[32];
 267        u8                              PeerHTInfoBuf[32];
 268
 269
 270        // A-MSDU related
 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
 275
 276
 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
 284
 285        // Forced A-MPDU enable
 286        HT_AGGRE_MODE_E ForcedAMPDUMode;
 287        u8                              ForcedAMPDUFactor;
 288        u8                              ForcedMPDUDensity;
 289
 290        // Forced A-MSDU enable
 291        HT_AGGRE_MODE_E ForcedAMSDUMode;
 292        u16                             ForcedAMSDUMaxSize;
 293
 294        u8                              bForcedShortGI;
 295
 296        u8                              CurrentOpMode;
 297
 298        // MIMO PS related
 299        u8                              SelfMimoPs;
 300        u8                              PeerMimoPs;
 301
 302        // 40MHz Channel Offset settings.
 303        HT_EXTCHNL_OFFSET       CurSTAExtChnlOffset;
 304        u8                              bCurTxBW40MHz;  // If we use 40 MHz to Tx
 305        u8                              PeerBandwidth;
 306
 307        // For Bandwidth Switching
 308        u8                              bSwBwInProgress;
 309        CHNLOP                          ChnlOp; // software switching channel in progress. By Bruce, 2008-02-15.
 310        u8                              SwBwStep;
 311        //struct timer_list             SwBwTimer;  //moved to ieee80211_device. as timer_list need include some header file here.
 312
 313        // For Realtek proprietary A-MPDU factor for aggregation
 314        u8                              bRegRT2RTAggregation;
 315        u8                              RT2RT_HT_Mode;
 316        u8                              bCurrentRT2RTAggregation;
 317        u8                              bCurrentRT2RTLongSlotTime;
 318        u8                              szRT2RTAggBuffer[10];
 319
 320        // Rx Reorder control
 321        u8                              bRegRxReorderEnable;
 322        u8                              bCurRxReorderEnable;
 323        u8                              RxReorderWinSize;
 324        u8                              RxReorderPendingTime;
 325        u16                             RxReorderDropCounter;
 326
 327
 328        // Add for Broadcom(Linksys) IOT. Joseph
 329        u8                              bIsPeerBcm;
 330
 331        // For IOT issue.
 332        u8                              IOTPeer;
 333        u32                             IOTAction;
 334        u8                              IOTRaFunc;
 335} __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
 336
 337
 338//------------------------------------------------------------
 339// The Data structure is used to keep HT related variable for "each Sta"
 340// when card is configured as "AP mode"
 341//------------------------------------------------------------
 342
 343typedef struct _RT_HTINFO_STA_ENTRY{
 344        u8                      bEnableHT;
 345
 346        u8                      bSupportCck;
 347
 348        u16                     AMSDU_MaxSize;
 349
 350        u8                      AMPDU_Factor;
 351        u8                      MPDU_Density;
 352
 353        u8                      HTHighestOperaRate;
 354
 355        u8                      bBw40MHz;
 356
 357        u8                      MimoPs;
 358
 359        u8                      McsRateSet[16];
 360
 361
 362}RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY;
 363
 364
 365
 366
 367
 368//------------------------------------------------------------
 369// The Data structure is used to keep HT related variable for "each AP"
 370// when card is configured as "STA mode"
 371//------------------------------------------------------------
 372
 373typedef struct _BSS_HT{
 374
 375        u8                              bdSupportHT;
 376
 377        // HT related elements
 378        u8                                      bdHTCapBuf[32];
 379        u16                                     bdHTCapLen;
 380        u8                                      bdHTInfoBuf[32];
 381        u16                                     bdHTInfoLen;
 382
 383        HT_SPEC_VER                             bdHTSpecVer;
 384        //HT_CAPABILITY_ELE                     bdHTCapEle;
 385        //HT_INFORMATION_ELE            bdHTInfoEle;
 386
 387        u8                                      bdRT2RTAggregation;
 388        u8                                      bdRT2RTLongSlotTime;
 389        u8                                      RT2RT_HT_Mode;
 390        bool                                    bdHT1R;
 391} __attribute__ ((packed)) BSS_HT, *PBSS_HT;
 392
 393typedef struct _MIMO_RSSI{
 394        u32     EnableAntenna;
 395        u32     AntennaA;
 396        u32     AntennaB;
 397        u32     AntennaC;
 398        u32     AntennaD;
 399        u32     Average;
 400}MIMO_RSSI, *PMIMO_RSSI;
 401
 402typedef struct _MIMO_EVM{
 403        u32     EVM1;
 404        u32    EVM2;
 405}MIMO_EVM, *PMIMO_EVM;
 406
 407typedef struct _FALSE_ALARM_STATISTICS{
 408        u32     Cnt_Parity_Fail;
 409        u32    Cnt_Rate_Illegal;
 410        u32     Cnt_Crc8_fail;
 411        u32     Cnt_all;
 412}FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS;
 413
 414
 415extern u8 MCS_FILTER_ALL[16];
 416extern u8 MCS_FILTER_1SS[16];
 417
 418/* 2007/07/11 MH Modify the macro. Becaus STA may link with a N-AP. If we set
 419   STA in A/B/G mode and AP is still in N mode. The macro will be wrong. We have
 420   to add a macro to judge wireless mode. */
 421#define PICK_RATE(_nLegacyRate, _nMcsRate)      \
 422                (_nMcsRate==0)?(_nLegacyRate&0x7f):(_nMcsRate)
 423/* 2007/07/12 MH We only define legacy and HT wireless mode now. */
 424#define LEGACY_WIRELESS_MODE    IEEE_MODE_MASK
 425
 426#define CURRENT_RATE(WirelessMode, LegacyRate, HTRate)  \
 427                                        ((WirelessMode & (LEGACY_WIRELESS_MODE))!=0)?\
 428                                                (LegacyRate):\
 429                                                (PICK_RATE(LegacyRate, HTRate))
 430
 431
 432
 433// MCS Bw 40 {1~7, 12~15,32}
 434#define RATE_ADPT_1SS_MASK              0xFF
 435#define RATE_ADPT_2SS_MASK              0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
 436#define RATE_ADPT_MCS32_MASK            0x01
 437
 438#define         IS_11N_MCS_RATE(rate)           (rate&0x80)
 439
 440typedef enum _HT_AGGRE_SIZE{
 441        HT_AGG_SIZE_8K = 0,
 442        HT_AGG_SIZE_16K = 1,
 443        HT_AGG_SIZE_32K = 2,
 444        HT_AGG_SIZE_64K = 3,
 445}HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E;
 446
 447/* Indicate different AP vendor for IOT issue */
 448typedef enum _HT_IOT_PEER
 449{
 450        HT_IOT_PEER_UNKNOWN = 0,
 451        HT_IOT_PEER_REALTEK = 1,
 452        HT_IOT_PEER_REALTEK_92SE = 2,
 453        HT_IOT_PEER_BROADCOM = 3,
 454        HT_IOT_PEER_RALINK = 4,
 455        HT_IOT_PEER_ATHEROS = 5,
 456        HT_IOT_PEER_CISCO= 6,
 457        HT_IOT_PEER_MARVELL=7,
 458        HT_IOT_PEER_92U_SOFTAP = 8,
 459        HT_IOT_PEER_SELF_SOFTAP = 9,
 460        HT_IOT_PEER_MAX = 10,
 461}HT_IOT_PEER_E, *PHTIOT_PEER_E;
 462
 463//
 464// IOT Action for different AP
 465//
 466typedef enum _HT_IOT_ACTION{
 467        HT_IOT_ACT_TX_USE_AMSDU_4K = 0x00000001,
 468        HT_IOT_ACT_TX_USE_AMSDU_8K = 0x00000002,
 469        HT_IOT_ACT_DISABLE_MCS14 = 0x00000004,
 470        HT_IOT_ACT_DISABLE_MCS15 = 0x00000008,
 471        HT_IOT_ACT_DISABLE_ALL_2SS = 0x00000010,
 472        HT_IOT_ACT_DISABLE_EDCA_TURBO = 0x00000020,
 473        HT_IOT_ACT_MGNT_USE_CCK_6M = 0x00000040,
 474        HT_IOT_ACT_CDD_FSYNC = 0x00000080,
 475        HT_IOT_ACT_PURE_N_MODE = 0x00000100,
 476        HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200,
 477        HT_IOT_ACT_FORCED_RTS = 0x00000400,
 478        HT_IOT_ACT_AMSDU_ENABLE = 0x00000800,
 479        HT_IOT_ACT_MID_HIGHPOWER = 0x00001000,
 480        HT_IOT_ACT_REJECT_ADDBA_REQ = 0x00002000,
 481        HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT = 0x00004000,
 482        HT_IOT_ACT_EDCA_BIAS_ON_RX = 0x00008000,
 483
 484        HT_IOT_ACT_HYBRID_AGGREGATION = 0x00010000,
 485        HT_IOT_ACT_DISABLE_SHORT_GI = 0x00020000,
 486        HT_IOT_ACT_DISABLE_HIGH_POWER = 0x00040000,
 487        HT_IOT_ACT_DISABLE_TX_40_MHZ = 0x00080000,
 488        HT_IOT_ACT_TX_NO_AGGREGATION = 0x00100000,
 489        HT_IOT_ACT_DISABLE_TX_2SS = 0x00200000,
 490}HT_IOT_ACTION_E, *PHT_IOT_ACTION_E;
 491
 492typedef enum _HT_IOT_RAFUNC{
 493        HT_IOT_RAFUNC_PEER_1R = 0x01,
 494        HT_IOT_RAFUNC_TX_AMSDU = 0x02,
 495        HT_IOT_RAFUNC_DISABLE_ALL = 0x80,
 496}HT_IOT_RAFUNC, *PHT_IOT_RAFUNC;
 497
 498typedef enum _RT_HT_CAP{
 499        RT_HT_CAP_USE_TURBO_AGGR = 0x01,
 500        RT_HT_CAP_USE_LONG_PREAMBLE = 0x02,
 501        RT_HT_CAP_USE_AMPDU = 0x04,
 502        RT_HT_CAP_USE_WOW = 0x8,
 503        RT_HT_CAP_USE_SOFTAP = 0x10,
 504        RT_HT_CAP_USE_92SE = 0x20,
 505}RT_HT_CAPBILITY, *PRT_HT_CAPBILITY;
 506
 507#endif //_RTL819XU_HTTYPE_H_
 508
 509