blob: 8ffcfb0d04f8f6751b79b2e9635434d5d44705c7 [file] [log] [blame]
Greg Kroah-Hartman91980992008-10-28 14:48:09 -07001/*
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
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020042#define MAX_MEASURE_REQ_TAB_SIZE 32
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070043#define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE
44
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020045#define MAX_TPC_REQ_TAB_SIZE 32
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070046#define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE
47
Bartlomiej Zolnierkiewicz52b81c82009-12-11 12:23:14 -080048#define MIN_RCV_PWR 100 /* Negative value ((dBm) */
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070049
Bartlomiej Zolnierkiewicz52b81c82009-12-11 12:23:14 -080050#define TPC_REQ_AGE_OUT 500 /* ms */
51#define MQ_REQ_AGE_OUT 500 /* ms */
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070052
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
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080056struct rt_measure_req_entry;
57
58struct rt_measure_req_entry {
59 struct rt_measure_req_entry *pNext;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080060 unsigned long lastTime;
Bartlomiej Zolnierkiewicz52b81c82009-12-11 12:23:14 -080061 BOOLEAN Valid;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080062 u8 DialogToken;
63 u8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080064};
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070065
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080066struct rt_measure_req_tab {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080067 u8 Size;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080068 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};
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070071
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080072struct rt_tpc_req_entry;
73
74struct rt_tpc_req_entry {
75 struct rt_tpc_req_entry *pNext;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080076 unsigned long lastTime;
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070077 BOOLEAN Valid;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080078 u8 DialogToken;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080079};
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070080
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080081struct rt_tpc_req_tab {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080082 u8 Size;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080083 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};
Greg Kroah-Hartman91980992008-10-28 14:48:09 -070086
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020087/* The regulatory information */
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080088struct rt_dot11_channel_set {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080089 u8 NumberOfChannels;
90 u8 MaxTxPwr;
91 u8 ChannelList[16];
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080092};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020093
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080094struct rt_dot11_regulatory_information {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -080095 u8 RegulatoryClass;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -080096 struct rt_dot11_channel_set ChannelSet;
97};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020098
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +020099#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
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800108struct PACKED rt_tpc_report_info {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800109 u8 TxPwr;
110 u8 LinkMargin;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800111};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200112
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800113struct PACKED rt_ch_sw_ann_info {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800114 u8 ChSwMode;
115 u8 Channel;
116 u8 ChSwCnt;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800117};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200118
Bartlomiej Zolnierkiewicz52b81c82009-12-11 12:23:14 -0800119typedef union PACKED _MEASURE_REQ_MODE {
120 struct PACKED {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800121 u8 Parallel:1;
122 u8 Enable:1;
123 u8 Request:1;
124 u8 Report:1;
125 u8 DurationMandatory:1;
126 u8:3;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200127 } field;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800128 u8 word;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200129} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
130
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800131struct PACKED rt_measure_req {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800132 u8 ChNum;
133 u64 MeasureStartTime;
134 u16 MeasureDuration;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800135};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200136
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800137struct PACKED rt_measure_req_info {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800138 u8 Token;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200139 MEASURE_REQ_MODE ReqMode;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800140 u8 ReqType;
141 u8 Oct[0];
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800142};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200143
Bartlomiej Zolnierkiewicz52b81c82009-12-11 12:23:14 -0800144typedef union PACKED _MEASURE_BASIC_REPORT_MAP {
145 struct PACKED {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800146 u8 BSS:1;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200147
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800148 u8 OfdmPreamble:1;
149 u8 UnidentifiedSignal:1;
150 u8 Radar:1;
151 u8 Unmeasure:1;
152 u8 Rev:3;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200153 } field;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800154 u8 word;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200155} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
156
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800157struct PACKED rt_measure_basic_report {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800158 u8 ChNum;
159 u64 MeasureStartTime;
160 u16 MeasureDuration;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200161 MEASURE_BASIC_REPORT_MAP Map;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800162};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200163
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800164struct PACKED rt_measure_cca_report {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800165 u8 ChNum;
166 u64 MeasureStartTime;
167 u16 MeasureDuration;
168 u8 CCA_Busy_Fraction;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800169};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200170
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800171struct PACKED rt_measure_rpi_report {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800172 u8 ChNum;
173 u64 MeasureStartTime;
174 u16 MeasureDuration;
175 u8 RPI_Density[8];
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800176};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200177
Bartlomiej Zolnierkiewicz52b81c82009-12-11 12:23:14 -0800178typedef union PACKED _MEASURE_REPORT_MODE {
179 struct PACKED {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800180 u8 Late:1;
181 u8 Incapable:1;
182 u8 Refused:1;
183 u8 Rev:5;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200184 } field;
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800185 u8 word;
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200186} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
187
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800188struct PACKED rt_measure_report_info {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800189 u8 Token;
190 u8 ReportMode;
191 u8 ReportType;
192 u8 Octect[0];
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800193};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200194
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800195struct PACKED rt_quiet_info {
Bartlomiej Zolnierkiewicz51126de2009-12-11 12:23:15 -0800196 u8 QuietCnt;
197 u8 QuietPeriod;
198 u16 QuietDuration;
199 u16 QuietOffset;
Bartlomiej Zolnierkiewicz62eb7342009-12-11 12:23:16 -0800200};
Bartlomiej Zolnierkiewiczca97b832009-09-22 20:44:07 +0200201
Bartlomiej Zolnierkiewiczcc277062009-12-11 12:23:15 -0800202#endif /* __SPECTRUM_DEF_H__ // */