]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/staging/rt2860/spectrum_def.h
Staging: rt28x0: remove typedefs (part three)
[net-next-2.6.git] / drivers / staging / rt2860 / spectrum_def.h
CommitLineData
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 42#define MAX_MEASURE_REQ_TAB_SIZE 32
91980990
GKH
43#define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE
44
ca97b838 45#define MAX_TPC_REQ_TAB_SIZE 32
91980990
GKH
46#define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE
47
52b81c89 48#define MIN_RCV_PWR 100 /* Negative value ((dBm) */
91980990 49
52b81c89
BZ
50#define TPC_REQ_AGE_OUT 500 /* ms */
51#define MQ_REQ_AGE_OUT 500 /* ms */
91980990
GKH
52
53#define TPC_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_HASH_TPC_REQ_TAB_SIZE)
54#define MQ_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_MEASURE_REQ_TAB_SIZE)
55
62eb734b
BZ
56struct rt_measure_req_entry;
57
58struct rt_measure_req_entry {
59 struct rt_measure_req_entry *pNext;
51126deb 60 unsigned long lastTime;
52b81c89 61 BOOLEAN Valid;
51126deb
BZ
62 u8 DialogToken;
63 u8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */
62eb734b 64};
91980990 65
62eb734b 66struct rt_measure_req_tab {
51126deb 67 u8 Size;
62eb734b
BZ
68 struct rt_measure_req_entry *Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE];
69 struct rt_measure_req_entry Content[MAX_MEASURE_REQ_TAB_SIZE];
70};
71
72struct rt_tpc_req_entry;
91980990 73
62eb734b
BZ
74struct rt_tpc_req_entry {
75 struct rt_tpc_req_entry *pNext;
51126deb 76 unsigned long lastTime;
91980990 77 BOOLEAN Valid;
51126deb 78 u8 DialogToken;
62eb734b 79};
91980990 80
62eb734b 81struct rt_tpc_req_tab {
51126deb 82 u8 Size;
62eb734b
BZ
83 struct rt_tpc_req_entry *Hash[MAX_HASH_TPC_REQ_TAB_SIZE];
84 struct rt_tpc_req_entry Content[MAX_TPC_REQ_TAB_SIZE];
85};
91980990 86
ca97b838 87/* The regulatory information */
62eb734b 88struct rt_dot11_channel_set {
51126deb
BZ
89 u8 NumberOfChannels;
90 u8 MaxTxPwr;
91 u8 ChannelList[16];
62eb734b 92};
ca97b838 93
62eb734b 94struct rt_dot11_regulatory_information {
51126deb 95 u8 RegulatoryClass;
62eb734b
BZ
96 struct rt_dot11_channel_set ChannelSet;
97};
ca97b838 98
ca97b838
BZ
99#define RM_TPC_REQ 0
100#define RM_MEASURE_REQ 1
101
102#define RM_BASIC 0
103#define RM_CCA 1
104#define RM_RPI_HISTOGRAM 2
105#define RM_CH_LOAD 3
106#define RM_NOISE_HISTOGRAM 4
107
62eb734b 108struct PACKED rt_tpc_report_info {
51126deb
BZ
109 u8 TxPwr;
110 u8 LinkMargin;
62eb734b 111};
ca97b838 112
62eb734b 113struct PACKED rt_ch_sw_ann_info {
51126deb
BZ
114 u8 ChSwMode;
115 u8 Channel;
116 u8 ChSwCnt;
62eb734b 117};
ca97b838 118
52b81c89
BZ
119typedef union PACKED _MEASURE_REQ_MODE {
120 struct PACKED {
51126deb
BZ
121 u8 Parallel:1;
122 u8 Enable:1;
123 u8 Request:1;
124 u8 Report:1;
125 u8 DurationMandatory:1;
126 u8:3;
ca97b838 127 } field;
51126deb 128 u8 word;
ca97b838
BZ
129} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
130
62eb734b 131struct PACKED rt_measure_req {
51126deb
BZ
132 u8 ChNum;
133 u64 MeasureStartTime;
134 u16 MeasureDuration;
62eb734b 135};
ca97b838 136
62eb734b 137struct PACKED rt_measure_req_info {
51126deb 138 u8 Token;
ca97b838 139 MEASURE_REQ_MODE ReqMode;
51126deb
BZ
140 u8 ReqType;
141 u8 Oct[0];
62eb734b 142};
ca97b838 143
52b81c89
BZ
144typedef union PACKED _MEASURE_BASIC_REPORT_MAP {
145 struct PACKED {
51126deb 146 u8 BSS:1;
ca97b838 147
51126deb
BZ
148 u8 OfdmPreamble:1;
149 u8 UnidentifiedSignal:1;
150 u8 Radar:1;
151 u8 Unmeasure:1;
152 u8 Rev:3;
ca97b838 153 } field;
51126deb 154 u8 word;
ca97b838
BZ
155} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
156
62eb734b 157struct PACKED rt_measure_basic_report {
51126deb
BZ
158 u8 ChNum;
159 u64 MeasureStartTime;
160 u16 MeasureDuration;
ca97b838 161 MEASURE_BASIC_REPORT_MAP Map;
62eb734b 162};
ca97b838 163
62eb734b 164struct PACKED rt_measure_cca_report {
51126deb
BZ
165 u8 ChNum;
166 u64 MeasureStartTime;
167 u16 MeasureDuration;
168 u8 CCA_Busy_Fraction;
62eb734b 169};
ca97b838 170
62eb734b 171struct PACKED rt_measure_rpi_report {
51126deb
BZ
172 u8 ChNum;
173 u64 MeasureStartTime;
174 u16 MeasureDuration;
175 u8 RPI_Density[8];
62eb734b 176};
ca97b838 177
52b81c89
BZ
178typedef union PACKED _MEASURE_REPORT_MODE {
179 struct PACKED {
51126deb
BZ
180 u8 Late:1;
181 u8 Incapable:1;
182 u8 Refused:1;
183 u8 Rev:5;
ca97b838 184 } field;
51126deb 185 u8 word;
ca97b838
BZ
186} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
187
62eb734b 188struct PACKED rt_measure_report_info {
51126deb
BZ
189 u8 Token;
190 u8 ReportMode;
191 u8 ReportType;
192 u8 Octect[0];
62eb734b 193};
ca97b838 194
62eb734b 195struct PACKED rt_quiet_info {
51126deb
BZ
196 u8 QuietCnt;
197 u8 QuietPeriod;
198 u16 QuietDuration;
199 u16 QuietOffset;
62eb734b 200};
ca97b838 201
cc277069 202#endif /* __SPECTRUM_DEF_H__ // */