vfs: fix nd->root leak in do_filp_open()
[zen-stable.git] / drivers / staging / rt2860 / spectrum.h
blob0a878ba81b48fe2bc8d5545500669fe43e903eac
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 struct PACKED
51 UINT8 Rev0:1;
52 UINT8 Enable:1;
53 UINT8 Request:1;
54 UINT8 Report:1;
55 UINT8 Rev1:4;
56 } field;
57 UINT8 word;
58 } MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
60 typedef struct PACKED _MEASURE_REQ
62 UINT8 ChNum;
63 UINT64 MeasureStartTime;
64 UINT16 MeasureDuration;
65 } MEASURE_REQ, *PMEASURE_REQ;
67 typedef struct PACKED _MEASURE_REQ_INFO
69 UINT8 Token;
70 MEASURE_REQ_MODE ReqMode;
71 UINT8 ReqType;
72 MEASURE_REQ MeasureReq;
73 } MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
75 typedef union PACKED _MEASURE_BASIC_REPORT_MAP
77 struct PACKED
79 UINT8 BSS:1;
80 UINT8 OfdmPreamble:1;
81 UINT8 UnidentifiedSignal:1;
82 UINT8 Radar:1;
83 UINT8 Unmeasure:1;
84 UINT8 Rev:3;
85 } field;
86 UINT8 word;
87 } MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
89 typedef struct PACKED _MEASURE_BASIC_REPORT
91 UINT8 ChNum;
92 UINT64 MeasureStartTime;
93 UINT16 MeasureDuration;
94 MEASURE_BASIC_REPORT_MAP Map;
95 } MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
97 typedef struct PACKED _MEASURE_CCA_REPORT
99 UINT8 ChNum;
100 UINT64 MeasureStartTime;
101 UINT16 MeasureDuration;
102 UINT8 CCA_Busy_Fraction;
103 } MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
105 typedef struct PACKED _MEASURE_RPI_REPORT
107 UINT8 ChNum;
108 UINT64 MeasureStartTime;
109 UINT16 MeasureDuration;
110 UINT8 RPI_Density[8];
111 } MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
113 typedef union PACKED _MEASURE_REPORT_MODE
115 struct PACKED
117 UINT8 Late:1;
118 UINT8 Incapable:1;
119 UINT8 Refused:1;
120 UINT8 Rev:5;
121 } field;
122 UINT8 word;
123 } MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
125 typedef struct PACKED _MEASURE_REPORT_INFO
127 UINT8 Token;
128 MEASURE_REPORT_MODE ReportMode;
129 UINT8 ReportType;
130 UINT8 Octect[0];
131 } MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
133 typedef struct PACKED _QUIET_INFO
135 UINT8 QuietCnt;
136 UINT8 QuietPeriod;
137 UINT8 QuietDuration;
138 UINT8 QuietOffset;
139 } QUIET_INFO, *PQUIET_INFO;
142 ==========================================================================
143 Description:
144 Prepare Measurement request action frame and enqueue it into
145 management queue waiting for transmition.
147 Parametrs:
148 1. the destination mac address of the frame.
150 Return : None.
151 ==========================================================================
153 VOID EnqueueMeasurementReq(
154 IN PRTMP_ADAPTER pAd,
155 IN PUCHAR pDA,
156 IN UINT8 MeasureToken,
157 IN UINT8 MeasureReqMode,
158 IN UINT8 MeasureReqType,
159 IN UINT8 MeasureCh,
160 IN UINT16 MeasureDuration);
163 ==========================================================================
164 Description:
165 Prepare Measurement report action frame and enqueue it into
166 management queue waiting for transmition.
168 Parametrs:
169 1. the destination mac address of the frame.
171 Return : None.
172 ==========================================================================
174 VOID EnqueueMeasurementRep(
175 IN PRTMP_ADAPTER pAd,
176 IN PUCHAR pDA,
177 IN UINT8 DialogToken,
178 IN UINT8 MeasureToken,
179 IN UINT8 MeasureReqMode,
180 IN UINT8 MeasureReqType,
181 IN UINT8 ReportInfoLen,
182 IN PUINT8 pReportInfo);
185 ==========================================================================
186 Description:
187 Prepare TPC Request action frame and enqueue it into
188 management queue waiting for transmition.
190 Parametrs:
191 1. the destination mac address of the frame.
193 Return : None.
194 ==========================================================================
196 VOID EnqueueTPCReq(
197 IN PRTMP_ADAPTER pAd,
198 IN PUCHAR pDA,
199 IN UCHAR DialogToken);
202 ==========================================================================
203 Description:
204 Prepare TPC Report action frame and enqueue it into
205 management queue waiting for transmition.
207 Parametrs:
208 1. the destination mac address of the frame.
210 Return : None.
211 ==========================================================================
213 VOID EnqueueTPCRep(
214 IN PRTMP_ADAPTER pAd,
215 IN PUCHAR pDA,
216 IN UINT8 DialogToken,
217 IN UINT8 TxPwr,
218 IN UINT8 LinkMargin);
221 ==========================================================================
222 Description:
223 Prepare Channel Switch Announcement action frame and enqueue it into
224 management queue waiting for transmition.
226 Parametrs:
227 1. the destination mac address of the frame.
228 2. Channel switch announcement mode.
229 2. a New selected channel.
231 Return : None.
232 ==========================================================================
234 VOID EnqueueChSwAnn(
235 IN PRTMP_ADAPTER pAd,
236 IN PUCHAR pDA,
237 IN UINT8 ChSwMode,
238 IN UINT8 NewCh);
241 ==========================================================================
242 Description:
243 Spectrun action frames Handler such as channel switch annoucement,
244 measurement report, measurement request actions frames.
246 Parametrs:
247 Elme - MLME message containing the received frame
249 Return : None.
250 ==========================================================================
252 VOID PeerSpectrumAction(
253 IN PRTMP_ADAPTER pAd,
254 IN MLME_QUEUE_ELEM *Elem);
257 ==========================================================================
258 Description:
260 Parametrs:
262 Return : None.
263 ==========================================================================
265 INT Set_MeasureReq_Proc(
266 IN PRTMP_ADAPTER pAd,
267 IN PUCHAR arg);
269 INT Set_TpcReq_Proc(
270 IN PRTMP_ADAPTER pAd,
271 IN PUCHAR arg);
273 VOID MeasureReqTabInit(
274 IN PRTMP_ADAPTER pAd);
276 VOID MeasureReqTabExit(
277 IN PRTMP_ADAPTER pAd);
279 VOID TpcReqTabInit(
280 IN PRTMP_ADAPTER pAd);
282 VOID TpcReqTabExit(
283 IN PRTMP_ADAPTER pAd);
285 VOID NotifyChSwAnnToPeerAPs(
286 IN PRTMP_ADAPTER pAd,
287 IN PUCHAR pRA,
288 IN PUCHAR pTA,
289 IN UINT8 ChSwMode,
290 IN UINT8 Channel);
291 #endif // __SPECTRUM_H__ //