/drivers/staging/rtl8192u/r819xU_HTType.h

https://bitbucket.org/slukk/jb-tsm-kernel-4.2 · C Header · 391 lines · 228 code · 93 blank · 70 comment · 0 complexity · 46885f49c3e32cfc01ab82b657bb5689 MD5 · raw file

  1. #ifndef _R819XU_HTTYPE_H_
  2. #define _R819XU_HTTYPE_H_
  3. //------------------------------------------------------------
  4. // The HT Capability element is present in beacons, association request,
  5. // reassociation request and probe response frames
  6. //------------------------------------------------------------
  7. //
  8. // Operation mode value
  9. //
  10. #define HT_OPMODE_NO_PROTECT 0
  11. #define HT_OPMODE_OPTIONAL 1
  12. #define HT_OPMODE_40MHZ_PROTECT 2
  13. #define HT_OPMODE_MIXED 3
  14. //
  15. // MIMO Power Save Setings
  16. //
  17. #define MIMO_PS_STATIC 0
  18. #define MIMO_PS_DYNAMIC 1
  19. #define MIMO_PS_NOLIMIT 3
  20. //
  21. // There should be 128 bits to cover all of the MCS rates. However, since
  22. // 8190 does not support too much rates, one integer is quite enough.
  23. //
  24. #define sHTCLng 4
  25. #define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff
  26. #define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00
  27. #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP
  28. typedef enum _HT_MCS_RATE{
  29. HT_MCS0 = 0x00000001,
  30. HT_MCS1 = 0x00000002,
  31. HT_MCS2 = 0x00000004,
  32. HT_MCS3 = 0x00000008,
  33. HT_MCS4 = 0x00000010,
  34. HT_MCS5 = 0x00000020,
  35. HT_MCS6 = 0x00000040,
  36. HT_MCS7 = 0x00000080,
  37. HT_MCS8 = 0x00000100,
  38. HT_MCS9 = 0x00000200,
  39. HT_MCS10 = 0x00000400,
  40. HT_MCS11 = 0x00000800,
  41. HT_MCS12 = 0x00001000,
  42. HT_MCS13 = 0x00002000,
  43. HT_MCS14 = 0x00004000,
  44. HT_MCS15 = 0x00008000,
  45. // Do not define MCS32 here although 8190 support MCS32
  46. }HT_MCS_RATE,*PHT_MCS_RATE;
  47. //
  48. // Represent Channel Width in HT Capabilities
  49. //
  50. typedef enum _HT_CHANNEL_WIDTH{
  51. HT_CHANNEL_WIDTH_20 = 0,
  52. HT_CHANNEL_WIDTH_20_40 = 1,
  53. }HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH;
  54. //
  55. // Represent Extension Channel Offset in HT Capabilities
  56. // This is available only in 40Mhz mode.
  57. //
  58. typedef enum _HT_EXTCHNL_OFFSET{
  59. HT_EXTCHNL_OFFSET_NO_EXT = 0,
  60. HT_EXTCHNL_OFFSET_UPPER = 1,
  61. HT_EXTCHNL_OFFSET_NO_DEF = 2,
  62. HT_EXTCHNL_OFFSET_LOWER = 3,
  63. }HT_EXTCHNL_OFFSET, *PHT_EXTCHNL_OFFSET;
  64. typedef enum _CHNLOP{
  65. CHNLOP_NONE = 0, // No Action now
  66. CHNLOP_SCAN = 1, // Scan in progress
  67. CHNLOP_SWBW = 2, // Bandwidth switching in progress
  68. CHNLOP_SWCHNL = 3, // Software Channel switching in progress
  69. } CHNLOP, *PCHNLOP;
  70. // Determine if the Channel Operation is in progress
  71. #define CHHLOP_IN_PROGRESS(_pHTInfo) \
  72. ((_pHTInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE
  73. typedef enum _HT_ACTION{
  74. ACT_RECOMMAND_WIDTH = 0,
  75. ACT_MIMO_PWR_SAVE = 1,
  76. ACT_PSMP = 2,
  77. ACT_SET_PCO_PHASE = 3,
  78. ACT_MIMO_CHL_MEASURE = 4,
  79. ACT_RECIPROCITY_CORRECT = 5,
  80. ACT_MIMO_CSI_MATRICS = 6,
  81. ACT_MIMO_NOCOMPR_STEER = 7,
  82. ACT_MIMO_COMPR_STEER = 8,
  83. ACT_ANTENNA_SELECT = 9,
  84. } HT_ACTION, *PHT_ACTION;
  85. /* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */
  86. typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier{
  87. SC_MODE_DUPLICATE = 0,
  88. SC_MODE_LOWER = 1,
  89. SC_MODE_UPPER = 2,
  90. SC_MODE_FULL40MHZ = 3,
  91. }HT_BW40_SC_E;
  92. typedef struct _HT_CAPABILITY_ELE{
  93. //HT capability info
  94. u8 AdvCoding:1;
  95. u8 ChlWidth:1;
  96. u8 MimoPwrSave:2;
  97. u8 GreenField:1;
  98. u8 ShortGI20Mhz:1;
  99. u8 ShortGI40Mhz:1;
  100. u8 TxSTBC:1;
  101. u8 RxSTBC:2;
  102. u8 DelayBA:1;
  103. u8 MaxAMSDUSize:1;
  104. u8 DssCCk:1;
  105. u8 PSMP:1;
  106. u8 Rsvd1:1;
  107. u8 LSigTxopProtect:1;
  108. //MAC HT parameters info
  109. u8 MaxRxAMPDUFactor:2;
  110. u8 MPDUDensity:3;
  111. u8 Rsvd2:3;
  112. //Supported MCS set
  113. u8 MCS[16];
  114. //Extended HT Capability Info
  115. u16 ExtHTCapInfo;
  116. //TXBF Capabilities
  117. u8 TxBFCap[4];
  118. //Antenna Selection Capabilities
  119. u8 ASCap;
  120. }__attribute__((packed)) HT_CAPABILITY_ELE, *PHT_CAPABILITY_ELE;
  121. //------------------------------------------------------------
  122. // The HT Information element is present in beacons
  123. // Only AP is required to include this element
  124. //------------------------------------------------------------
  125. typedef struct _HT_INFORMATION_ELE{
  126. u8 ControlChl;
  127. u8 ExtChlOffset:2;
  128. u8 RecommemdedTxWidth:1;
  129. u8 RIFS:1;
  130. u8 PSMPAccessOnly:1;
  131. u8 SrvIntGranularity:3;
  132. u8 OptMode:2;
  133. u8 NonGFDevPresent:1;
  134. u8 Revd1:5;
  135. u8 Revd2:8;
  136. u8 Rsvd3:6;
  137. u8 DualBeacon:1;
  138. u8 DualCTSProtect:1;
  139. u8 SecondaryBeacon:1;
  140. u8 LSigTxopProtectFull:1;
  141. u8 PcoActive:1;
  142. u8 PcoPhase:1;
  143. u8 Rsvd4:4;
  144. u8 BasicMSC[16];
  145. }__attribute__((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
  146. //
  147. // MIMO Power Save control field.
  148. // This is appear in MIMO Power Save Action Frame
  149. //
  150. typedef struct _MIMOPS_CTRL{
  151. u8 MimoPsEnable:1;
  152. u8 MimoPsMode:1;
  153. u8 Reserved:6;
  154. } MIMOPS_CTRL, *PMIMOPS_CTRL;
  155. typedef enum _HT_SPEC_VER{
  156. HT_SPEC_VER_IEEE = 0,
  157. HT_SPEC_VER_EWC = 1,
  158. }HT_SPEC_VER, *PHT_SPEC_VER;
  159. typedef enum _HT_AGGRE_MODE_E{
  160. HT_AGG_AUTO = 0,
  161. HT_AGG_FORCE_ENABLE = 1,
  162. HT_AGG_FORCE_DISABLE = 2,
  163. }HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E;
  164. //------------------------------------------------------------
  165. // The Data structure is used to keep HT related variables when card is
  166. // configured as non-AP STA mode. **Note** Current_xxx should be set
  167. // to default value in HTInitializeHTInfo()
  168. //------------------------------------------------------------
  169. typedef struct _RT_HIGH_THROUGHPUT{
  170. // DECLARE_RT_OBJECT(_RT_HIGH_THROUGHPUT);
  171. u8 bEnableHT;
  172. u8 bCurrentHTSupport;
  173. u8 bRegBW40MHz; // Tx 40MHz channel capablity
  174. u8 bCurBW40MHz; // Tx 40MHz channel capability
  175. u8 bRegShortGI40MHz; // Tx Short GI for 40Mhz
  176. u8 bCurShortGI40MHz; // Tx Short GI for 40MHz
  177. u8 bRegShortGI20MHz; // Tx Short GI for 20MHz
  178. u8 bCurShortGI20MHz; // Tx Short GI for 20MHz
  179. u8 bRegSuppCCK; // Tx CCK rate capability
  180. u8 bCurSuppCCK; // Tx CCK rate capability
  181. // 802.11n spec version for "peer"
  182. HT_SPEC_VER ePeerHTSpecVer;
  183. // HT related information for "Self"
  184. HT_CAPABILITY_ELE SelfHTCap; // This is HT cap element sent to peer STA, which also indicate HT Rx capabilities.
  185. HT_INFORMATION_ELE SelfHTInfo; // This is HT info element sent to peer STA, which also indicate HT Rx capabilities.
  186. // HT related information for "Peer"
  187. u8 PeerHTCapBuf[32];
  188. u8 PeerHTInfoBuf[32];
  189. // A-MSDU related
  190. u8 bAMSDU_Support; // This indicates Tx A-MSDU capability
  191. u16 nAMSDU_MaxSize; // This indicates Tx A-MSDU capability
  192. u8 bCurrent_AMSDU_Support; // This indicates Tx A-MSDU capability
  193. u16 nCurrent_AMSDU_MaxSize; // This indicates Tx A-MSDU capability
  194. // AMPDU related <2006.08.10 Emily>
  195. u8 bAMPDUEnable; // This indicate Tx A-MPDU capability
  196. u8 bCurrentAMPDUEnable; // This indicate Tx A-MPDU capability
  197. u8 AMPDU_Factor; // This indicate Tx A-MPDU capability
  198. u8 CurrentAMPDUFactor; // This indicate Tx A-MPDU capability
  199. u8 MPDU_Density; // This indicate Tx A-MPDU capability
  200. u8 CurrentMPDUDensity; // This indicate Tx A-MPDU capability
  201. // Forced A-MPDU enable
  202. HT_AGGRE_MODE_E ForcedAMPDUMode;
  203. u8 ForcedAMPDUFactor;
  204. u8 ForcedMPDUDensity;
  205. // Forced A-MSDU enable
  206. HT_AGGRE_MODE_E ForcedAMSDUMode;
  207. u16 ForcedAMSDUMaxSize;
  208. u8 bForcedShortGI;
  209. u8 CurrentOpMode;
  210. // MIMO PS related
  211. u8 SelfMimoPs;
  212. u8 PeerMimoPs;
  213. // 40MHz Channel Offset settings.
  214. HT_EXTCHNL_OFFSET CurSTAExtChnlOffset;
  215. u8 bCurTxBW40MHz; // If we use 40 MHz to Tx
  216. u8 PeerBandwidth;
  217. // For Bandwidth Switching
  218. u8 bSwBwInProgress;
  219. CHNLOP ChnlOp; // software switching channel in progress. By Bruce, 2008-02-15.
  220. u8 SwBwStep;
  221. //RT_TIMER SwBwTimer;
  222. struct timer_list SwBwTimer;
  223. // For Realtek proprietary A-MPDU factor for aggregation
  224. u8 bRegRT2RTAggregation;
  225. u8 bCurrentRT2RTAggregation;
  226. u8 bCurrentRT2RTLongSlotTime;
  227. u8 szRT2RTAggBuffer[10];
  228. // Rx Reorder control
  229. u8 bRegRxReorderEnable;
  230. u8 bCurRxReorderEnable;
  231. u8 RxReorderWinSize;
  232. u8 RxReorderPendingTime;
  233. u16 RxReorderDropCounter;
  234. #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
  235. u8 UsbTxAggrNum;
  236. #endif
  237. #ifdef USB_RX_AGGREGATION_SUPPORT
  238. u8 UsbRxFwAggrEn;
  239. u8 UsbRxFwAggrPageNum;
  240. u8 UsbRxFwAggrPacketNum;
  241. u8 UsbRxFwAggrTimeout;
  242. #endif
  243. // Add for Broadcom(Linksys) IOT. Joseph
  244. u8 bIsPeerBcm;
  245. // For IOT issue.
  246. u32 IOTAction;
  247. }RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
  248. //------------------------------------------------------------
  249. // The Data structure is used to keep HT related variable for "each Sta"
  250. // when card is configured as "AP mode"
  251. //------------------------------------------------------------
  252. typedef struct _RT_HTINFO_STA_ENTRY{
  253. u8 bEnableHT;
  254. u8 bSupportCck;
  255. u16 AMSDU_MaxSize;
  256. u8 AMPDU_Factor;
  257. u8 MPDU_Density;
  258. u8 HTHighestOperaRate;
  259. u8 bBw40MHz;
  260. u8 MimoPs;
  261. u8 McsRateSet[16];
  262. }RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY;
  263. //------------------------------------------------------------
  264. // The Data structure is used to keep HT related variable for "each AP"
  265. // when card is configured as "STA mode"
  266. //------------------------------------------------------------
  267. typedef struct _BSS_HT{
  268. u8 bdSupportHT;
  269. // HT related elements
  270. u8 bdHTCapBuf[32];
  271. u16 bdHTCapLen;
  272. u8 bdHTInfoBuf[32];
  273. u16 bdHTInfoLen;
  274. HT_SPEC_VER bdHTSpecVer;
  275. //HT_CAPABILITY_ELE bdHTCapEle;
  276. //HT_INFORMATION_ELE bdHTInfoEle;
  277. u8 bdRT2RTAggregation;
  278. u8 bdRT2RTLongSlotTime;
  279. }BSS_HT, *PBSS_HT;
  280. typedef struct _MIMO_RSSI{
  281. u32 EnableAntenna;
  282. u32 AntennaA;
  283. u32 AntennaB;
  284. u32 AntennaC;
  285. u32 AntennaD;
  286. u32 Average;
  287. }MIMO_RSSI, *PMIMO_RSSI;
  288. typedef struct _MIMO_EVM{
  289. u32 EVM1;
  290. u32 EVM2;
  291. }MIMO_EVM, *PMIMO_EVM;
  292. typedef struct _FALSE_ALARM_STATISTICS{
  293. u32 Cnt_Parity_Fail;
  294. u32 Cnt_Rate_Illegal;
  295. u32 Cnt_Crc8_fail;
  296. u32 Cnt_all;
  297. }FALSE_ALARM_STATISTICS, *PFALSE_ALARM_STATISTICS;
  298. #endif //__INC_HTTYPE_H