PageRenderTime 94ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/staging/rt2860/spectrum_def.h

https://github.com/Dabary/linux_gt-i9000
C Header | 202 lines | 134 code | 30 blank | 38 comment | 0 complexity | 567e964d163d30c7d199598f63ff6558 MD5 | raw file
  1. /*
  2. *************************************************************************
  3. * Ralink Tech Inc.
  4. * 5F., No.36, Taiyuan St., Jhubei City,
  5. * Hsinchu County 302,
  6. * Taiwan, R.O.C.
  7. *
  8. * (c) Copyright 2002-2007, Ralink Technology, Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. * This program is distributed in the hope that it will be useful, *
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  18. * GNU General Public License for more details. *
  19. * *
  20. * You should have received a copy of the GNU General Public License *
  21. * along with this program; if not, write to the *
  22. * Free Software Foundation, Inc., *
  23. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  24. * *
  25. *************************************************************************
  26. Module Name:
  27. spectrum_def.h
  28. Abstract:
  29. Handle association related requests either from WSTA or from local MLME
  30. Revision History:
  31. Who When What
  32. --------- ---------- ----------------------------------------------
  33. Fonchi Wu 2008 created for 802.11h
  34. */
  35. #ifndef __SPECTRUM_DEF_H__
  36. #define __SPECTRUM_DEF_H__
  37. #define MAX_MEASURE_REQ_TAB_SIZE 32
  38. #define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE
  39. #define MAX_TPC_REQ_TAB_SIZE 32
  40. #define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE
  41. #define MIN_RCV_PWR 100 /* Negative value ((dBm) */
  42. #define TPC_REQ_AGE_OUT 500 /* ms */
  43. #define MQ_REQ_AGE_OUT 500 /* ms */
  44. #define TPC_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_HASH_TPC_REQ_TAB_SIZE)
  45. #define MQ_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_MEASURE_REQ_TAB_SIZE)
  46. struct rt_measure_req_entry;
  47. struct rt_measure_req_entry {
  48. struct rt_measure_req_entry *pNext;
  49. unsigned long lastTime;
  50. BOOLEAN Valid;
  51. u8 DialogToken;
  52. u8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */
  53. };
  54. struct rt_measure_req_tab {
  55. u8 Size;
  56. struct rt_measure_req_entry *Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE];
  57. struct rt_measure_req_entry Content[MAX_MEASURE_REQ_TAB_SIZE];
  58. };
  59. struct rt_tpc_req_entry;
  60. struct rt_tpc_req_entry {
  61. struct rt_tpc_req_entry *pNext;
  62. unsigned long lastTime;
  63. BOOLEAN Valid;
  64. u8 DialogToken;
  65. };
  66. struct rt_tpc_req_tab {
  67. u8 Size;
  68. struct rt_tpc_req_entry *Hash[MAX_HASH_TPC_REQ_TAB_SIZE];
  69. struct rt_tpc_req_entry Content[MAX_TPC_REQ_TAB_SIZE];
  70. };
  71. /* The regulatory information */
  72. struct rt_dot11_channel_set {
  73. u8 NumberOfChannels;
  74. u8 MaxTxPwr;
  75. u8 ChannelList[16];
  76. };
  77. struct rt_dot11_regulatory_information {
  78. u8 RegulatoryClass;
  79. struct rt_dot11_channel_set ChannelSet;
  80. };
  81. #define RM_TPC_REQ 0
  82. #define RM_MEASURE_REQ 1
  83. #define RM_BASIC 0
  84. #define RM_CCA 1
  85. #define RM_RPI_HISTOGRAM 2
  86. #define RM_CH_LOAD 3
  87. #define RM_NOISE_HISTOGRAM 4
  88. struct PACKED rt_tpc_report_info {
  89. u8 TxPwr;
  90. u8 LinkMargin;
  91. };
  92. struct PACKED rt_ch_sw_ann_info {
  93. u8 ChSwMode;
  94. u8 Channel;
  95. u8 ChSwCnt;
  96. };
  97. typedef union PACKED _MEASURE_REQ_MODE {
  98. struct PACKED {
  99. u8 Parallel:1;
  100. u8 Enable:1;
  101. u8 Request:1;
  102. u8 Report:1;
  103. u8 DurationMandatory:1;
  104. u8:3;
  105. } field;
  106. u8 word;
  107. } MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
  108. struct PACKED rt_measure_req {
  109. u8 ChNum;
  110. u64 MeasureStartTime;
  111. u16 MeasureDuration;
  112. };
  113. struct PACKED rt_measure_req_info {
  114. u8 Token;
  115. MEASURE_REQ_MODE ReqMode;
  116. u8 ReqType;
  117. u8 Oct[0];
  118. };
  119. typedef union PACKED _MEASURE_BASIC_REPORT_MAP {
  120. struct PACKED {
  121. u8 BSS:1;
  122. u8 OfdmPreamble:1;
  123. u8 UnidentifiedSignal:1;
  124. u8 Radar:1;
  125. u8 Unmeasure:1;
  126. u8 Rev:3;
  127. } field;
  128. u8 word;
  129. } MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
  130. struct PACKED rt_measure_basic_report {
  131. u8 ChNum;
  132. u64 MeasureStartTime;
  133. u16 MeasureDuration;
  134. MEASURE_BASIC_REPORT_MAP Map;
  135. };
  136. struct PACKED rt_measure_cca_report {
  137. u8 ChNum;
  138. u64 MeasureStartTime;
  139. u16 MeasureDuration;
  140. u8 CCA_Busy_Fraction;
  141. };
  142. struct PACKED rt_measure_rpi_report {
  143. u8 ChNum;
  144. u64 MeasureStartTime;
  145. u16 MeasureDuration;
  146. u8 RPI_Density[8];
  147. };
  148. typedef union PACKED _MEASURE_REPORT_MODE {
  149. struct PACKED {
  150. u8 Late:1;
  151. u8 Incapable:1;
  152. u8 Refused:1;
  153. u8 Rev:5;
  154. } field;
  155. u8 word;
  156. } MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
  157. struct PACKED rt_measure_report_info {
  158. u8 Token;
  159. u8 ReportMode;
  160. u8 ReportType;
  161. u8 Octect[0];
  162. };
  163. struct PACKED rt_quiet_info {
  164. u8 QuietCnt;
  165. u8 QuietPeriod;
  166. u16 QuietDuration;
  167. u16 QuietOffset;
  168. };
  169. #endif /* __SPECTRUM_DEF_H__ // */