Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 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 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 42 | #define MAX_MEASURE_REQ_TAB_SIZE 32 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 43 | #define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE |
| 44 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 45 | #define MAX_TPC_REQ_TAB_SIZE 32 |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 46 | #define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE |
| 47 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 48 | #define MIN_RCV_PWR 100 /* Negative value ((dBm) */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 49 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 50 | #define TPC_REQ_AGE_OUT 500 /* ms */ |
| 51 | #define MQ_REQ_AGE_OUT 500 /* ms */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 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 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 56 | typedef struct _MEASURE_REQ_ENTRY { |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 57 | struct _MEASURE_REQ_ENTRY *pNext; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 58 | unsigned long lastTime; |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 59 | BOOLEAN Valid; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 60 | u8 DialogToken; |
| 61 | u8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */ |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 62 | } MEASURE_REQ_ENTRY, *PMEASURE_REQ_ENTRY; |
| 63 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 64 | typedef struct _MEASURE_REQ_TAB { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 65 | u8 Size; |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 66 | PMEASURE_REQ_ENTRY Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE]; |
| 67 | MEASURE_REQ_ENTRY Content[MAX_MEASURE_REQ_TAB_SIZE]; |
| 68 | } MEASURE_REQ_TAB, *PMEASURE_REQ_TAB; |
| 69 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 70 | typedef struct _TPC_REQ_ENTRY { |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 71 | struct _TPC_REQ_ENTRY *pNext; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 72 | unsigned long lastTime; |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 73 | BOOLEAN Valid; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 74 | u8 DialogToken; |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 75 | } TPC_REQ_ENTRY, *PTPC_REQ_ENTRY; |
| 76 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 77 | typedef struct _TPC_REQ_TAB { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 78 | u8 Size; |
Greg Kroah-Hartman | 9198099 | 2008-10-28 14:48:09 -0700 | [diff] [blame] | 79 | PTPC_REQ_ENTRY Hash[MAX_HASH_TPC_REQ_TAB_SIZE]; |
| 80 | TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE]; |
| 81 | } TPC_REQ_TAB, *PTPC_REQ_TAB; |
| 82 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 83 | /* The regulatory information */ |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 84 | typedef struct _DOT11_CHANNEL_SET { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 85 | u8 NumberOfChannels; |
| 86 | u8 MaxTxPwr; |
| 87 | u8 ChannelList[16]; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 88 | } DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET; |
| 89 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 90 | typedef struct _DOT11_REGULATORY_INFORMATION { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 91 | u8 RegulatoryClass; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 92 | DOT11_CHANNEL_SET ChannelSet; |
| 93 | } DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION; |
| 94 | |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 95 | #define RM_TPC_REQ 0 |
| 96 | #define RM_MEASURE_REQ 1 |
| 97 | |
| 98 | #define RM_BASIC 0 |
| 99 | #define RM_CCA 1 |
| 100 | #define RM_RPI_HISTOGRAM 2 |
| 101 | #define RM_CH_LOAD 3 |
| 102 | #define RM_NOISE_HISTOGRAM 4 |
| 103 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 104 | typedef struct PACKED _TPC_REPORT_INFO { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 105 | u8 TxPwr; |
| 106 | u8 LinkMargin; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 107 | } TPC_REPORT_INFO, *PTPC_REPORT_INFO; |
| 108 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 109 | typedef struct PACKED _CH_SW_ANN_INFO { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 110 | u8 ChSwMode; |
| 111 | u8 Channel; |
| 112 | u8 ChSwCnt; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 113 | } CH_SW_ANN_INFO, *PCH_SW_ANN_INFO; |
| 114 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 115 | typedef union PACKED _MEASURE_REQ_MODE { |
| 116 | struct PACKED { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 117 | u8 Parallel:1; |
| 118 | u8 Enable:1; |
| 119 | u8 Request:1; |
| 120 | u8 Report:1; |
| 121 | u8 DurationMandatory:1; |
| 122 | u8:3; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 123 | } field; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 124 | u8 word; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 125 | } MEASURE_REQ_MODE, *PMEASURE_REQ_MODE; |
| 126 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 127 | typedef struct PACKED _MEASURE_REQ { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 128 | u8 ChNum; |
| 129 | u64 MeasureStartTime; |
| 130 | u16 MeasureDuration; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 131 | } MEASURE_REQ, *PMEASURE_REQ; |
| 132 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 133 | typedef struct PACKED _MEASURE_REQ_INFO { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 134 | u8 Token; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 135 | MEASURE_REQ_MODE ReqMode; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 136 | u8 ReqType; |
| 137 | u8 Oct[0]; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 138 | } MEASURE_REQ_INFO, *PMEASURE_REQ_INFO; |
| 139 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 140 | typedef union PACKED _MEASURE_BASIC_REPORT_MAP { |
| 141 | struct PACKED { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 142 | u8 BSS:1; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 143 | |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 144 | u8 OfdmPreamble:1; |
| 145 | u8 UnidentifiedSignal:1; |
| 146 | u8 Radar:1; |
| 147 | u8 Unmeasure:1; |
| 148 | u8 Rev:3; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 149 | } field; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 150 | u8 word; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 151 | } MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP; |
| 152 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 153 | typedef struct PACKED _MEASURE_BASIC_REPORT { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 154 | u8 ChNum; |
| 155 | u64 MeasureStartTime; |
| 156 | u16 MeasureDuration; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 157 | MEASURE_BASIC_REPORT_MAP Map; |
| 158 | } MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT; |
| 159 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 160 | typedef struct PACKED _MEASURE_CCA_REPORT { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 161 | u8 ChNum; |
| 162 | u64 MeasureStartTime; |
| 163 | u16 MeasureDuration; |
| 164 | u8 CCA_Busy_Fraction; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 165 | } MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT; |
| 166 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 167 | typedef struct PACKED _MEASURE_RPI_REPORT { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 168 | u8 ChNum; |
| 169 | u64 MeasureStartTime; |
| 170 | u16 MeasureDuration; |
| 171 | u8 RPI_Density[8]; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 172 | } MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT; |
| 173 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 174 | typedef union PACKED _MEASURE_REPORT_MODE { |
| 175 | struct PACKED { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 176 | u8 Late:1; |
| 177 | u8 Incapable:1; |
| 178 | u8 Refused:1; |
| 179 | u8 Rev:5; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 180 | } field; |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 181 | u8 word; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 182 | } MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE; |
| 183 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 184 | typedef struct PACKED _MEASURE_REPORT_INFO { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 185 | u8 Token; |
| 186 | u8 ReportMode; |
| 187 | u8 ReportType; |
| 188 | u8 Octect[0]; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 189 | } MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO; |
| 190 | |
Bartlomiej Zolnierkiewicz | 52b81c8 | 2009-12-11 12:23:14 -0800 | [diff] [blame] | 191 | typedef struct PACKED _QUIET_INFO { |
Bartlomiej Zolnierkiewicz | 51126de | 2009-12-11 12:23:15 -0800 | [diff] [blame^] | 192 | u8 QuietCnt; |
| 193 | u8 QuietPeriod; |
| 194 | u16 QuietDuration; |
| 195 | u16 QuietOffset; |
Bartlomiej Zolnierkiewicz | ca97b83 | 2009-09-22 20:44:07 +0200 | [diff] [blame] | 196 | } QUIET_INFO, *PQUIET_INFO; |
| 197 | |
Bartlomiej Zolnierkiewicz | cc27706 | 2009-12-11 12:23:15 -0800 | [diff] [blame] | 198 | #endif /* __SPECTRUM_DEF_H__ // */ |