PageRenderTime 156ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/staging/rtl8192su/ieee80211/rtl819x_HT.h

https://github.com/mike0/Iconia_a500_3.2
C Header | 530 lines | 298 code | 105 blank | 127 comment | 0 complexity | 06037d58e838d06fa9bbc28de19374e6 MD5 | raw file
  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. // The HT Capability element is present in beacons, association request,
  23. // reassociation request and probe response frames
  24. //------------------------------------------------------------
  25. //
  26. // Operation mode value
  27. //
  28. #define HT_OPMODE_NO_PROTECT 0
  29. #define HT_OPMODE_OPTIONAL 1
  30. #define HT_OPMODE_40MHZ_PROTECT 2
  31. #define HT_OPMODE_MIXED 3
  32. //
  33. // MIMO Power Save Setings
  34. //
  35. #define MIMO_PS_STATIC 0
  36. #define MIMO_PS_DYNAMIC 1
  37. #define MIMO_PS_NOLIMIT 3
  38. //
  39. // There should be 128 bits to cover all of the MCS rates. However, since
  40. // 8190 does not support too much rates, one integer is quite enough.
  41. //
  42. #define sHTCLng 4
  43. #define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff
  44. #define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00
  45. #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP
  46. typedef enum _HT_MCS_RATE{
  47. HT_MCS0 = 0x00000001,
  48. HT_MCS1 = 0x00000002,
  49. HT_MCS2 = 0x00000004,
  50. HT_MCS3 = 0x00000008,
  51. HT_MCS4 = 0x00000010,
  52. HT_MCS5 = 0x00000020,
  53. HT_MCS6 = 0x00000040,
  54. HT_MCS7 = 0x00000080,
  55. HT_MCS8 = 0x00000100,
  56. HT_MCS9 = 0x00000200,
  57. HT_MCS10 = 0x00000400,
  58. HT_MCS11 = 0x00000800,
  59. HT_MCS12 = 0x00001000,
  60. HT_MCS13 = 0x00002000,
  61. HT_MCS14 = 0x00004000,
  62. HT_MCS15 = 0x00008000,
  63. // Do not define MCS32 here although 8190 support MCS32
  64. }HT_MCS_RATE,*PHT_MCS_RATE;
  65. //
  66. // Represent Channel Width in HT Capabilities
  67. //
  68. typedef enum _HT_CHANNEL_WIDTH{
  69. HT_CHANNEL_WIDTH_20 = 0,
  70. HT_CHANNEL_WIDTH_20_40 = 1,
  71. }HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH;
  72. //
  73. // Represent Extention Channel Offset in HT Capabilities
  74. // This is available only in 40Mhz mode.
  75. //
  76. typedef enum _HT_EXTCHNL_OFFSET{
  77. HT_EXTCHNL_OFFSET_NO_EXT = 0,
  78. HT_EXTCHNL_OFFSET_UPPER = 1,
  79. HT_EXTCHNL_OFFSET_NO_DEF = 2,
  80. HT_EXTCHNL_OFFSET_LOWER = 3,
  81. }HT_EXTCHNL_OFFSET, *PHT_EXTCHNL_OFFSET;
  82. typedef enum _CHNLOP{
  83. CHNLOP_NONE = 0, // No Action now
  84. CHNLOP_SCAN = 1, // Scan in progress
  85. CHNLOP_SWBW = 2, // Bandwidth switching in progress
  86. CHNLOP_SWCHNL = 3, // Software Channel switching in progress
  87. } CHNLOP, *PCHNLOP;
  88. // Determine if the Channel Operation is in progress
  89. #define CHHLOP_IN_PROGRESS(_pHTInfo) \
  90. ((_pHTInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE
  91. /*
  92. typedef union _HT_CAPABILITY{
  93. u16 ShortData;
  94. u8 CharData[2];
  95. struct
  96. {
  97. u16 AdvCoding:1;
  98. u16 ChlWidth:1;
  99. u16 MimoPwrSave:2;
  100. u16 GreenField:1;
  101. u16 ShortGI20Mhz:1;
  102. u16 ShortGI40Mhz:1;
  103. u16 STBC:1;
  104. u16 BeamForm:1;
  105. u16 DelayBA:1;
  106. u16 MaxAMSDUSize:1;
  107. u16 DssCCk:1;
  108. u16 PSMP:1;
  109. u16 Rsvd:3;
  110. }Field;
  111. }HT_CAPABILITY, *PHT_CAPABILITY;
  112. typedef union _HT_CAPABILITY_MACPARA{
  113. u8 ShortData;
  114. u8 CharData[1];
  115. struct
  116. {
  117. u8 MaxRxAMPDU:2;
  118. u8 MPDUDensity:2;
  119. u8 Rsvd:4;
  120. }Field;
  121. }HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA;
  122. */
  123. typedef enum _HT_ACTION{
  124. ACT_RECOMMAND_WIDTH = 0,
  125. ACT_MIMO_PWR_SAVE = 1,
  126. ACT_PSMP = 2,
  127. ACT_SET_PCO_PHASE = 3,
  128. ACT_MIMO_CHL_MEASURE = 4,
  129. ACT_RECIPROCITY_CORRECT = 5,
  130. ACT_MIMO_CSI_MATRICS = 6,
  131. ACT_MIMO_NOCOMPR_STEER = 7,
  132. ACT_MIMO_COMPR_STEER = 8,
  133. ACT_ANTENNA_SELECT = 9,
  134. } HT_ACTION, *PHT_ACTION;
  135. /* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */
  136. typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier{
  137. SC_MODE_DUPLICATE = 0,
  138. SC_MODE_LOWER = 1,
  139. SC_MODE_UPPER = 2,
  140. SC_MODE_FULL40MHZ = 3,
  141. }HT_BW40_SC_E;
  142. typedef struct _HT_CAPABILITY_ELE{
  143. //HT capability info
  144. u8 AdvCoding:1;
  145. u8 ChlWidth:1;
  146. u8 MimoPwrSave:2;
  147. u8 GreenField:1;
  148. u8 ShortGI20Mhz:1;
  149. u8 ShortGI40Mhz:1;
  150. u8 TxSTBC:1;
  151. u8 RxSTBC:2;
  152. u8 DelayBA:1;
  153. u8 MaxAMSDUSize:1;
  154. u8 DssCCk:1;
  155. u8 PSMP:1;
  156. u8 Rsvd1:1;
  157. u8 LSigTxopProtect:1;
  158. //MAC HT parameters info
  159. u8 MaxRxAMPDUFactor:2;
  160. u8 MPDUDensity:3;
  161. u8 Rsvd2:3;
  162. //Supported MCS set
  163. u8 MCS[16];
  164. //Extended HT Capability Info
  165. u16 ExtHTCapInfo;
  166. //TXBF Capabilities
  167. u8 TxBFCap[4];
  168. //Antenna Selection Capabilities
  169. u8 ASCap;
  170. } __attribute__ ((packed)) HT_CAPABILITY_ELE, *PHT_CAPABILITY_ELE;
  171. //------------------------------------------------------------
  172. // The HT Information element is present in beacons
  173. // Only AP is required to include this element
  174. //------------------------------------------------------------
  175. typedef struct _HT_INFORMATION_ELE{
  176. u8 ControlChl;
  177. u8 ExtChlOffset:2;
  178. u8 RecommemdedTxWidth:1;
  179. u8 RIFS:1;
  180. u8 PSMPAccessOnly:1;
  181. u8 SrvIntGranularity:3;
  182. u8 OptMode:2;
  183. u8 NonGFDevPresent:1;
  184. u8 Revd1:5;
  185. u8 Revd2:8;
  186. u8 Rsvd3:6;
  187. u8 DualBeacon:1;
  188. u8 DualCTSProtect:1;
  189. u8 SecondaryBeacon:1;
  190. u8 LSigTxopProtectFull:1;
  191. u8 PcoActive:1;
  192. u8 PcoPhase:1;
  193. u8 Rsvd4:4;
  194. u8 BasicMSC[16];
  195. } __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
  196. //
  197. // MIMO Power Save control field.
  198. // This is appear in MIMO Power Save Action Frame
  199. //
  200. typedef struct _MIMOPS_CTRL{
  201. u8 MimoPsEnable:1;
  202. u8 MimoPsMode:1;
  203. u8 Reserved:6;
  204. } MIMOPS_CTRL, *PMIMOPS_CTRL;
  205. typedef enum _HT_SPEC_VER{
  206. HT_SPEC_VER_IEEE = 0,
  207. HT_SPEC_VER_EWC = 1,
  208. }HT_SPEC_VER, *PHT_SPEC_VER;
  209. typedef enum _HT_AGGRE_MODE_E{
  210. HT_AGG_AUTO = 0,
  211. HT_AGG_FORCE_ENABLE = 1,
  212. HT_AGG_FORCE_DISABLE = 2,
  213. }HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E;
  214. //------------------------------------------------------------
  215. // The Data structure is used to keep HT related variables when card is
  216. // configured as non-AP STA mode. **Note** Current_xxx should be set
  217. // to default value in HTInitializeHTInfo()
  218. //------------------------------------------------------------
  219. typedef struct _RT_HIGH_THROUGHPUT{
  220. u8 bEnableHT;
  221. u8 bCurrentHTSupport;
  222. u8 bRegBW40MHz; // Tx 40MHz channel capablity
  223. u8 bCurBW40MHz; // Tx 40MHz channel capability
  224. u8 bRegShortGI40MHz; // Tx Short GI for 40Mhz
  225. u8 bCurShortGI40MHz; // Tx Short GI for 40MHz
  226. u8 bRegShortGI20MHz; // Tx Short GI for 20MHz
  227. u8 bCurShortGI20MHz; // Tx Short GI for 20MHz
  228. u8 bRegSuppCCK; // Tx CCK rate capability
  229. u8 bCurSuppCCK; // Tx CCK rate capability
  230. // 802.11n spec version for "peer"
  231. HT_SPEC_VER ePeerHTSpecVer;
  232. // HT related information for "Self"
  233. HT_CAPABILITY_ELE SelfHTCap; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities.
  234. HT_INFORMATION_ELE SelfHTInfo; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities.
  235. // HT related information for "Peer"
  236. u8 PeerHTCapBuf[32];
  237. u8 PeerHTInfoBuf[32];
  238. // A-MSDU related
  239. u8 bAMSDU_Support; // This indicates Tx A-MSDU capability
  240. u16 nAMSDU_MaxSize; // This indicates Tx A-MSDU capability
  241. u8 bCurrent_AMSDU_Support; // This indicates Tx A-MSDU capability
  242. u16 nCurrent_AMSDU_MaxSize; // This indicates Tx A-MSDU capability
  243. // AMPDU related <2006.08.10 Emily>
  244. u8 bAMPDUEnable; // This indicate Tx A-MPDU capability
  245. u8 bCurrentAMPDUEnable; // This indicate Tx A-MPDU capability
  246. u8 AMPDU_Factor; // This indicate Tx A-MPDU capability
  247. u8 CurrentAMPDUFactor; // This indicate Tx A-MPDU capability
  248. u8 MPDU_Density; // This indicate Tx A-MPDU capability
  249. u8 CurrentMPDUDensity; // This indicate Tx A-MPDU capability
  250. // Forced A-MPDU enable
  251. HT_AGGRE_MODE_E ForcedAMPDUMode;
  252. u8 ForcedAMPDUFactor;
  253. u8 ForcedMPDUDensity;
  254. // Forced A-MSDU enable
  255. HT_AGGRE_MODE_E ForcedAMSDUMode;
  256. u16 ForcedAMSDUMaxSize;
  257. u8 bForcedShortGI;
  258. u8 CurrentOpMode;
  259. // MIMO PS related
  260. u8 SelfMimoPs;
  261. u8 PeerMimoPs;
  262. // 40MHz Channel Offset settings.
  263. HT_EXTCHNL_OFFSET CurSTAExtChnlOffset;
  264. u8 bCurTxBW40MHz; // If we use 40 MHz to Tx
  265. u8 PeerBandwidth;
  266. // For Bandwidth Switching
  267. u8 bSwBwInProgress;
  268. CHNLOP ChnlOp; // software switching channel in progress. By Bruce, 2008-02-15.
  269. u8 SwBwStep;
  270. //struct timer_list SwBwTimer; //moved to ieee80211_device. as timer_list need include some header file here.
  271. // For Realtek proprietary A-MPDU factor for aggregation
  272. u8 bRegRT2RTAggregation;
  273. u8 RT2RT_HT_Mode;
  274. u8 bCurrentRT2RTAggregation;
  275. u8 bCurrentRT2RTLongSlotTime;
  276. u8 szRT2RTAggBuffer[10];
  277. // Rx Reorder control
  278. u8 bRegRxReorderEnable;
  279. u8 bCurRxReorderEnable;
  280. u8 RxReorderWinSize;
  281. u8 RxReorderPendingTime;
  282. u16 RxReorderDropCounter;
  283. // Add for Broadcom(Linksys) IOT. Joseph
  284. u8 bIsPeerBcm;
  285. // For IOT issue.
  286. u8 IOTPeer;
  287. u32 IOTAction;
  288. u8 IOTRaFunc;
  289. } __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
  290. //------------------------------------------------------------
  291. // The Data structure is used to keep HT related variable for "each Sta"
  292. // when card is configured as "AP mode"
  293. //------------------------------------------------------------
  294. typedef struct _RT_HTINFO_STA_ENTRY{
  295. u8 bEnableHT;
  296. u8 bSupportCck;
  297. u16 AMSDU_MaxSize;
  298. u8 AMPDU_Factor;
  299. u8 MPDU_Density;
  300. u8 HTHighestOperaRate;
  301. u8 bBw40MHz;
  302. u8 MimoPs;
  303. u8 McsRateSet[16];
  304. }RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY;
  305. //------------------------------------------------------------
  306. // The Data structure is used to keep HT related variable for "each AP"
  307. // when card is configured as "STA mode"
  308. //------------------------------------------------------------
  309. typedef struct _BSS_HT{
  310. u8 bdSupportHT;
  311. // HT related elements
  312. u8 bdHTCapBuf[32];
  313. u16 bdHTCapLen;
  314. u8 bdHTInfoBuf[32];
  315. u16 bdHTInfoLen;
  316. HT_SPEC_VER bdHTSpecVer;
  317. HT_CHANNEL_WIDTH bdBandWidth;
  318. u8 bdRT2RTAggregation;
  319. u8 bdRT2RTLongSlotTime;
  320. u8 RT2RT_HT_Mode;
  321. bool bdHT1R;
  322. } __attribute__ ((packed)) BSS_HT, *PBSS_HT;
  323. typedef struct _MIMO_RSSI{
  324. u32 EnableAntenna;
  325. u32 AntennaA;
  326. u32 AntennaB;
  327. u32 AntennaC;
  328. u32 AntennaD;
  329. u32 Average;
  330. }MIMO_RSSI, *PMIMO_RSSI;
  331. typedef struct _MIMO_EVM{
  332. u32 EVM1;
  333. u32 EVM2;
  334. }MIMO_EVM, *PMIMO_EVM;
  335. typedef struct _FALSE_ALARM_STATISTICS{
  336. u32 Cnt_Parity_Fail;
  337. u32 Cnt_Rate_Illegal;
  338. u32 Cnt_Crc8_fail;
  339. u32 Cnt_all;
  340. }FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS;
  341. extern u8 MCS_FILTER_ALL[16];
  342. extern u8 MCS_FILTER_1SS[16];
  343. /* 2007/07/11 MH Modify the macro. Becaus STA may link with a N-AP. If we set
  344. STA in A/B/G mode and AP is still in N mode. The macro will be wrong. We have
  345. to add a macro to judge wireless mode. */
  346. #define PICK_RATE(_nLegacyRate, _nMcsRate) \
  347. (_nMcsRate==0)?(_nLegacyRate&0x7f):(_nMcsRate)
  348. /* 2007/07/12 MH We only define legacy and HT wireless mode now. */
  349. #define LEGACY_WIRELESS_MODE IEEE_MODE_MASK
  350. #define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \
  351. ((WirelessMode & (LEGACY_WIRELESS_MODE))!=0)?\
  352. (LegacyRate):\
  353. (PICK_RATE(LegacyRate, HTRate))
  354. // MCS Bw 40 {1~7, 12~15,32}
  355. #define RATE_ADPT_1SS_MASK 0xFF
  356. #define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
  357. #define RATE_ADPT_MCS32_MASK 0x01
  358. #define IS_11N_MCS_RATE(rate) (rate&0x80)
  359. typedef enum _HT_AGGRE_SIZE{
  360. HT_AGG_SIZE_8K = 0,
  361. HT_AGG_SIZE_16K = 1,
  362. HT_AGG_SIZE_32K = 2,
  363. HT_AGG_SIZE_64K = 3,
  364. }HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E;
  365. /* Indicate different AP vendor for IOT issue */
  366. typedef enum _HT_IOT_PEER
  367. {
  368. HT_IOT_PEER_UNKNOWN = 0,
  369. HT_IOT_PEER_REALTEK = 1,
  370. HT_IOT_PEER_REALTEK_92SE = 2,
  371. HT_IOT_PEER_BROADCOM = 3,
  372. HT_IOT_PEER_RALINK = 4,
  373. HT_IOT_PEER_ATHEROS = 5,
  374. HT_IOT_PEER_CISCO= 6,
  375. HT_IOT_PEER_MARVELL=7,
  376. HT_IOT_PEER_92U_SOFTAP = 8,
  377. HT_IOT_PEER_SELF_SOFTAP = 9,
  378. HT_IOT_PEER_MAX = 10,
  379. }HT_IOT_PEER_E, *PHTIOT_PEER_E;
  380. //
  381. // IOT Action for different AP
  382. //
  383. typedef enum _HT_IOT_ACTION{
  384. HT_IOT_ACT_TX_USE_AMSDU_4K = 0x00000001,
  385. HT_IOT_ACT_TX_USE_AMSDU_8K = 0x00000002,
  386. HT_IOT_ACT_DISABLE_MCS14 = 0x00000004,
  387. HT_IOT_ACT_DISABLE_MCS15 = 0x00000008,
  388. HT_IOT_ACT_DISABLE_ALL_2SS = 0x00000010,
  389. HT_IOT_ACT_DISABLE_EDCA_TURBO = 0x00000020,
  390. HT_IOT_ACT_MGNT_USE_CCK_6M = 0x00000040,
  391. HT_IOT_ACT_CDD_FSYNC = 0x00000080,
  392. HT_IOT_ACT_PURE_N_MODE = 0x00000100,
  393. HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200,
  394. HT_IOT_ACT_FORCED_RTS = 0x00000400,
  395. HT_IOT_ACT_AMSDU_ENABLE = 0x00000800,
  396. HT_IOT_ACT_REJECT_ADDBA_REQ = 0x00001000,
  397. HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT = 0x00002000,
  398. HT_IOT_ACT_EDCA_BIAS_ON_RX = 0x00004000,
  399. HT_IOT_ACT_HYBRID_AGGREGATION = 0x00010000,
  400. HT_IOT_ACT_DISABLE_SHORT_GI = 0x00020000,
  401. HT_IOT_ACT_DISABLE_HIGH_POWER = 0x00040000,
  402. HT_IOT_ACT_DISABLE_TX_40_MHZ = 0x00080000,
  403. HT_IOT_ACT_TX_NO_AGGREGATION = 0x00100000,
  404. HT_IOT_ACT_DISABLE_TX_2SS = 0x00200000,
  405. HT_IOT_ACT_MID_HIGHPOWER = 0x00400000,
  406. HT_IOT_ACT_NULL_DATA_POWER_SAVING = 0x00800000,
  407. HT_IOT_ACT_DISABLE_CCK_RATE = 0x01000000,
  408. HT_IOT_ACT_FORCED_ENABLE_BE_TXOP = 0x02000000,
  409. HT_IOT_ACT_WA_IOT_Broadcom = 0x04000000,
  410. }HT_IOT_ACTION_E, *PHT_IOT_ACTION_E;
  411. typedef enum _HT_IOT_RAFUNC{
  412. HT_IOT_RAFUNC_DISABLE_ALL = 0x00,
  413. HT_IOT_RAFUNC_PEER_1R = 0x01,
  414. HT_IOT_RAFUNC_TX_AMSDU = 0x02,
  415. }HT_IOT_RAFUNC, *PHT_IOT_RAFUNC;
  416. typedef enum _RT_HT_CAP{
  417. RT_HT_CAP_USE_TURBO_AGGR = 0x01,
  418. RT_HT_CAP_USE_LONG_PREAMBLE = 0x02,
  419. RT_HT_CAP_USE_AMPDU = 0x04,
  420. RT_HT_CAP_USE_WOW = 0x8,
  421. RT_HT_CAP_USE_SOFTAP = 0x10,
  422. RT_HT_CAP_USE_92SE = 0x20,
  423. }RT_HT_CAPBILITY, *PRT_HT_CAPBILITY;
  424. #endif