rt2x00: Simplify rt2x00_check_rev
[linux/fpc-iii.git] / drivers / staging / rt2870 / spectrum.h
blob94cfa5b174fcc6a8e1b974f2c4bc77e11e9df57f
1 /*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
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 *************************************************************************
28 #ifndef __SPECTRUM_H__
29 #define __SPECTRUM_H__
31 #include "rtmp_type.h"
32 #include "spectrum_def.h"
34 typedef struct PACKED _TPC_REPORT_INFO
36 UINT8 TxPwr;
37 UINT8 LinkMargin;
38 } TPC_REPORT_INFO, *PTPC_REPORT_INFO;
40 typedef struct PACKED _CH_SW_ANN_INFO
42 UINT8 ChSwMode;
43 UINT8 Channel;
44 UINT8 ChSwCnt;
45 } CH_SW_ANN_INFO, *PCH_SW_ANN_INFO;
47 typedef union PACKED _MEASURE_REQ_MODE
49 #ifdef RT_BIG_ENDIAN
50 struct PACKED
52 UINT8 Rev1:4;
53 UINT8 Report:1;
54 UINT8 Request:1;
55 UINT8 Enable:1;
56 UINT8 Rev0:1;
57 } field;
58 #else
59 struct PACKED
61 UINT8 Rev0:1;
62 UINT8 Enable:1;
63 UINT8 Request:1;
64 UINT8 Report:1;
65 UINT8 Rev1:4;
66 } field;
67 #endif // RT_BIG_ENDIAN //
68 UINT8 word;
69 } MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
71 typedef struct PACKED _MEASURE_REQ
73 UINT8 ChNum;
74 UINT64 MeasureStartTime;
75 UINT16 MeasureDuration;
76 } MEASURE_REQ, *PMEASURE_REQ;
78 typedef struct PACKED _MEASURE_REQ_INFO
80 UINT8 Token;
81 MEASURE_REQ_MODE ReqMode;
82 UINT8 ReqType;
83 MEASURE_REQ MeasureReq;
84 } MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
86 typedef union PACKED _MEASURE_BASIC_REPORT_MAP
88 #ifdef RT_BIG_ENDIAN
89 struct PACKED
91 UINT8 Rev:3;
92 UINT8 Unmeasure:1;
93 UINT8 Radar:1;
94 UINT8 UnidentifiedSignal:1;
95 UINT8 OfdmPreamble:1;
96 UINT8 BSS:1;
97 } field;
98 #else
99 struct PACKED
101 UINT8 BSS:1;
102 UINT8 OfdmPreamble:1;
103 UINT8 UnidentifiedSignal:1;
104 UINT8 Radar:1;
105 UINT8 Unmeasure:1;
106 UINT8 Rev:3;
107 } field;
108 #endif // RT_BIG_ENDIAN //
109 UINT8 word;
110 } MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
112 typedef struct PACKED _MEASURE_BASIC_REPORT
114 UINT8 ChNum;
115 UINT64 MeasureStartTime;
116 UINT16 MeasureDuration;
117 MEASURE_BASIC_REPORT_MAP Map;
118 } MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
120 typedef struct PACKED _MEASURE_CCA_REPORT
122 UINT8 ChNum;
123 UINT64 MeasureStartTime;
124 UINT16 MeasureDuration;
125 UINT8 CCA_Busy_Fraction;
126 } MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
128 typedef struct PACKED _MEASURE_RPI_REPORT
130 UINT8 ChNum;
131 UINT64 MeasureStartTime;
132 UINT16 MeasureDuration;
133 UINT8 RPI_Density[8];
134 } MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
136 typedef union PACKED _MEASURE_REPORT_MODE
138 struct PACKED
140 #ifdef RT_BIG_ENDIAN
141 UINT8 Rev:5;
142 UINT8 Refused:1;
143 UINT8 Incapable:1;
144 UINT8 Late:1;
145 #else
146 UINT8 Late:1;
147 UINT8 Incapable:1;
148 UINT8 Refused:1;
149 UINT8 Rev:5;
150 #endif // RT_BIG_ENDIAN //
151 } field;
152 UINT8 word;
153 } MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
155 typedef struct PACKED _MEASURE_REPORT_INFO
157 UINT8 Token;
158 MEASURE_REPORT_MODE ReportMode;
159 UINT8 ReportType;
160 UINT8 Octect[0];
161 } MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
163 typedef struct PACKED _QUIET_INFO
165 UINT8 QuietCnt;
166 UINT8 QuietPeriod;
167 UINT8 QuietDuration;
168 UINT8 QuietOffset;
169 } QUIET_INFO, *PQUIET_INFO;
172 ==========================================================================
173 Description:
174 Prepare Measurement request action frame and enqueue it into
175 management queue waiting for transmition.
177 Parametrs:
178 1. the destination mac address of the frame.
180 Return : None.
181 ==========================================================================
183 VOID EnqueueMeasurementReq(
184 IN PRTMP_ADAPTER pAd,
185 IN PUCHAR pDA,
186 IN UINT8 MeasureToken,
187 IN UINT8 MeasureReqMode,
188 IN UINT8 MeasureReqType,
189 IN UINT8 MeasureCh,
190 IN UINT16 MeasureDuration);
193 ==========================================================================
194 Description:
195 Prepare Measurement report action frame and enqueue it into
196 management queue waiting for transmition.
198 Parametrs:
199 1. the destination mac address of the frame.
201 Return : None.
202 ==========================================================================
204 VOID EnqueueMeasurementRep(
205 IN PRTMP_ADAPTER pAd,
206 IN PUCHAR pDA,
207 IN UINT8 DialogToken,
208 IN UINT8 MeasureToken,
209 IN UINT8 MeasureReqMode,
210 IN UINT8 MeasureReqType,
211 IN UINT8 ReportInfoLen,
212 IN PUINT8 pReportInfo);
215 ==========================================================================
216 Description:
217 Prepare TPC Request action frame and enqueue it into
218 management queue waiting for transmition.
220 Parametrs:
221 1. the destination mac address of the frame.
223 Return : None.
224 ==========================================================================
226 VOID EnqueueTPCReq(
227 IN PRTMP_ADAPTER pAd,
228 IN PUCHAR pDA,
229 IN UCHAR DialogToken);
232 ==========================================================================
233 Description:
234 Prepare TPC Report action frame and enqueue it into
235 management queue waiting for transmition.
237 Parametrs:
238 1. the destination mac address of the frame.
240 Return : None.
241 ==========================================================================
243 VOID EnqueueTPCRep(
244 IN PRTMP_ADAPTER pAd,
245 IN PUCHAR pDA,
246 IN UINT8 DialogToken,
247 IN UINT8 TxPwr,
248 IN UINT8 LinkMargin);
251 ==========================================================================
252 Description:
253 Prepare Channel Switch Announcement action frame and enqueue it into
254 management queue waiting for transmition.
256 Parametrs:
257 1. the destination mac address of the frame.
258 2. Channel switch announcement mode.
259 2. a New selected channel.
261 Return : None.
262 ==========================================================================
264 VOID EnqueueChSwAnn(
265 IN PRTMP_ADAPTER pAd,
266 IN PUCHAR pDA,
267 IN UINT8 ChSwMode,
268 IN UINT8 NewCh);
271 ==========================================================================
272 Description:
273 Spectrun action frames Handler such as channel switch annoucement,
274 measurement report, measurement request actions frames.
276 Parametrs:
277 Elme - MLME message containing the received frame
279 Return : None.
280 ==========================================================================
282 VOID PeerSpectrumAction(
283 IN PRTMP_ADAPTER pAd,
284 IN MLME_QUEUE_ELEM *Elem);
287 ==========================================================================
288 Description:
290 Parametrs:
292 Return : None.
293 ==========================================================================
295 INT Set_MeasureReq_Proc(
296 IN PRTMP_ADAPTER pAd,
297 IN PUCHAR arg);
299 INT Set_TpcReq_Proc(
300 IN PRTMP_ADAPTER pAd,
301 IN PUCHAR arg);
303 VOID MeasureReqTabInit(
304 IN PRTMP_ADAPTER pAd);
306 VOID MeasureReqTabExit(
307 IN PRTMP_ADAPTER pAd);
309 VOID TpcReqTabInit(
310 IN PRTMP_ADAPTER pAd);
312 VOID TpcReqTabExit(
313 IN PRTMP_ADAPTER pAd);
315 VOID NotifyChSwAnnToPeerAPs(
316 IN PRTMP_ADAPTER pAd,
317 IN PUCHAR pRA,
318 IN PUCHAR pTA,
319 IN UINT8 ChSwMode,
320 IN UINT8 Channel);
321 #endif // __SPECTRUM_H__ //