]>
Commit | Line | Data |
---|---|---|
91980990 GKH |
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 | ||
27 | Module Name: | |
28 | spectrum_def.h | |
29 | ||
30 | Abstract: | |
31 | Handle association related requests either from WSTA or from local MLME | |
32 | ||
33 | Revision History: | |
34 | Who When What | |
35 | --------- ---------- ---------------------------------------------- | |
36 | Fonchi Wu 2008 created for 802.11h | |
37 | */ | |
38 | ||
39 | #ifndef __SPECTRUM_DEF_H__ | |
40 | #define __SPECTRUM_DEF_H__ | |
41 | ||
ca97b838 BZ |
42 | |
43 | #define MAX_MEASURE_REQ_TAB_SIZE 32 | |
91980990 GKH |
44 | #define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE |
45 | ||
ca97b838 | 46 | #define MAX_TPC_REQ_TAB_SIZE 32 |
91980990 GKH |
47 | #define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE |
48 | ||
49 | #define MIN_RCV_PWR 100 /* Negative value ((dBm) */ | |
50 | ||
91980990 GKH |
51 | #define TPC_REQ_AGE_OUT 500 /* ms */ |
52 | #define MQ_REQ_AGE_OUT 500 /* ms */ | |
53 | ||
54 | #define TPC_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_HASH_TPC_REQ_TAB_SIZE) | |
55 | #define MQ_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_MEASURE_REQ_TAB_SIZE) | |
56 | ||
57 | typedef struct _MEASURE_REQ_ENTRY | |
58 | { | |
59 | struct _MEASURE_REQ_ENTRY *pNext; | |
60 | ULONG lastTime; | |
61 | BOOLEAN Valid; | |
62 | UINT8 DialogToken; | |
63 | UINT8 MeasureDialogToken[3]; // 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. | |
64 | } MEASURE_REQ_ENTRY, *PMEASURE_REQ_ENTRY; | |
65 | ||
66 | typedef struct _MEASURE_REQ_TAB | |
67 | { | |
68 | UCHAR Size; | |
69 | PMEASURE_REQ_ENTRY Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE]; | |
70 | MEASURE_REQ_ENTRY Content[MAX_MEASURE_REQ_TAB_SIZE]; | |
71 | } MEASURE_REQ_TAB, *PMEASURE_REQ_TAB; | |
72 | ||
73 | typedef struct _TPC_REQ_ENTRY | |
74 | { | |
75 | struct _TPC_REQ_ENTRY *pNext; | |
76 | ULONG lastTime; | |
77 | BOOLEAN Valid; | |
78 | UINT8 DialogToken; | |
79 | } TPC_REQ_ENTRY, *PTPC_REQ_ENTRY; | |
80 | ||
81 | typedef struct _TPC_REQ_TAB | |
82 | { | |
83 | UCHAR Size; | |
84 | PTPC_REQ_ENTRY Hash[MAX_HASH_TPC_REQ_TAB_SIZE]; | |
85 | TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE]; | |
86 | } TPC_REQ_TAB, *PTPC_REQ_TAB; | |
87 | ||
ca97b838 BZ |
88 | |
89 | /* The regulatory information */ | |
90 | typedef struct _DOT11_CHANNEL_SET | |
91 | { | |
92 | UCHAR NumberOfChannels; | |
93 | UINT8 MaxTxPwr; | |
94 | UCHAR ChannelList[16]; | |
95 | } DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET; | |
96 | ||
97 | typedef struct _DOT11_REGULATORY_INFORMATION | |
98 | { | |
99 | UCHAR RegulatoryClass; | |
100 | DOT11_CHANNEL_SET ChannelSet; | |
101 | } DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION; | |
102 | ||
103 | ||
104 | ||
105 | #define RM_TPC_REQ 0 | |
106 | #define RM_MEASURE_REQ 1 | |
107 | ||
108 | #define RM_BASIC 0 | |
109 | #define RM_CCA 1 | |
110 | #define RM_RPI_HISTOGRAM 2 | |
111 | #define RM_CH_LOAD 3 | |
112 | #define RM_NOISE_HISTOGRAM 4 | |
113 | ||
114 | ||
115 | typedef struct PACKED _TPC_REPORT_INFO | |
116 | { | |
117 | UINT8 TxPwr; | |
118 | UINT8 LinkMargin; | |
119 | } TPC_REPORT_INFO, *PTPC_REPORT_INFO; | |
120 | ||
121 | typedef struct PACKED _CH_SW_ANN_INFO | |
122 | { | |
123 | UINT8 ChSwMode; | |
124 | UINT8 Channel; | |
125 | UINT8 ChSwCnt; | |
126 | } CH_SW_ANN_INFO, *PCH_SW_ANN_INFO; | |
127 | ||
128 | typedef union PACKED _MEASURE_REQ_MODE | |
129 | { | |
130 | struct PACKED | |
131 | { | |
132 | UINT8 Parallel:1; | |
133 | UINT8 Enable:1; | |
134 | UINT8 Request:1; | |
135 | UINT8 Report:1; | |
136 | UINT8 DurationMandatory:1; | |
137 | UINT8 :3; | |
138 | } field; | |
139 | UINT8 word; | |
140 | } MEASURE_REQ_MODE, *PMEASURE_REQ_MODE; | |
141 | ||
142 | typedef struct PACKED _MEASURE_REQ | |
143 | { | |
144 | UINT8 ChNum; | |
145 | UINT64 MeasureStartTime; | |
146 | UINT16 MeasureDuration; | |
147 | } MEASURE_REQ, *PMEASURE_REQ; | |
148 | ||
149 | typedef struct PACKED _MEASURE_REQ_INFO | |
150 | { | |
151 | UINT8 Token; | |
152 | MEASURE_REQ_MODE ReqMode; | |
153 | UINT8 ReqType; | |
154 | UINT8 Oct[0]; | |
155 | } MEASURE_REQ_INFO, *PMEASURE_REQ_INFO; | |
156 | ||
157 | typedef union PACKED _MEASURE_BASIC_REPORT_MAP | |
158 | { | |
159 | struct PACKED | |
160 | { | |
161 | UINT8 BSS:1; | |
162 | ||
163 | UINT8 OfdmPreamble:1; | |
164 | UINT8 UnidentifiedSignal:1; | |
165 | UINT8 Radar:1; | |
166 | UINT8 Unmeasure:1; | |
167 | UINT8 Rev:3; | |
168 | } field; | |
169 | UINT8 word; | |
170 | } MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP; | |
171 | ||
172 | typedef struct PACKED _MEASURE_BASIC_REPORT | |
173 | { | |
174 | UINT8 ChNum; | |
175 | UINT64 MeasureStartTime; | |
176 | UINT16 MeasureDuration; | |
177 | MEASURE_BASIC_REPORT_MAP Map; | |
178 | } MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT; | |
179 | ||
180 | typedef struct PACKED _MEASURE_CCA_REPORT | |
181 | { | |
182 | UINT8 ChNum; | |
183 | UINT64 MeasureStartTime; | |
184 | UINT16 MeasureDuration; | |
185 | UINT8 CCA_Busy_Fraction; | |
186 | } MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT; | |
187 | ||
188 | typedef struct PACKED _MEASURE_RPI_REPORT | |
189 | { | |
190 | UINT8 ChNum; | |
191 | UINT64 MeasureStartTime; | |
192 | UINT16 MeasureDuration; | |
193 | UINT8 RPI_Density[8]; | |
194 | } MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT; | |
195 | ||
196 | typedef union PACKED _MEASURE_REPORT_MODE | |
197 | { | |
198 | struct PACKED | |
199 | { | |
200 | UINT8 Late:1; | |
201 | UINT8 Incapable:1; | |
202 | UINT8 Refused:1; | |
203 | UINT8 Rev:5; | |
204 | } field; | |
205 | UINT8 word; | |
206 | } MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE; | |
207 | ||
208 | typedef struct PACKED _MEASURE_REPORT_INFO | |
209 | { | |
210 | UINT8 Token; | |
211 | UINT8 ReportMode; | |
212 | UINT8 ReportType; | |
213 | UINT8 Octect[0]; | |
214 | } MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO; | |
215 | ||
216 | typedef struct PACKED _QUIET_INFO | |
217 | { | |
218 | UINT8 QuietCnt; | |
219 | UINT8 QuietPeriod; | |
220 | UINT16 QuietDuration; | |
221 | UINT16 QuietOffset; | |
222 | } QUIET_INFO, *PQUIET_INFO; | |
223 | ||
91980990 GKH |
224 | #endif // __SPECTRUM_DEF_H__ // |
225 |