code style scripts/checkpatch.pl (linux-3.9-rc1) formatting
[linux-2.6.32.60-moxart.git] / drivers / net / wireless / ath / regd.h
blob21cf5215f6f60e7273fcfb5f1814aaaf9d743e92
1 /*
2 * Copyright (c) 2008-2009 Atheros Communications Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef REGD_H
18 #define REGD_H
20 #include <linux/nl80211.h>
21 #include <net/cfg80211.h>
23 #include "ath.h"
25 enum ctl_group {
26 CTL_FCC = 0x10,
27 CTL_MKK = 0x40,
28 CTL_ETSI = 0x30,
31 #define NO_CTL 0xff
32 #define SD_NO_CTL 0xE0
33 #define NO_CTL 0xff
34 #define CTL_11A 0
35 #define CTL_11B 1
36 #define CTL_11G 2
37 #define CTL_2GHT20 5
38 #define CTL_5GHT20 6
39 #define CTL_2GHT40 7
40 #define CTL_5GHT40 8
42 #define CTRY_DEBUG 0x1ff
43 #define CTRY_DEFAULT 0
45 #define COUNTRY_ERD_FLAG 0x8000
46 #define WORLDWIDE_ROAMING_FLAG 0x4000
48 #define MULTI_DOMAIN_MASK 0xFF00
50 #define WORLD_SKU_MASK 0x00F0
51 #define WORLD_SKU_PREFIX 0x0060
53 #define CHANNEL_HALF_BW 10
54 #define CHANNEL_QUARTER_BW 5
56 struct country_code_to_enum_rd {
57 u16 countryCode;
58 u16 regDmnEnum;
59 const char *isoName;
62 enum CountryCode {
63 CTRY_ALBANIA = 8,
64 CTRY_ALGERIA = 12,
65 CTRY_ARGENTINA = 32,
66 CTRY_ARMENIA = 51,
67 CTRY_AUSTRALIA = 36,
68 CTRY_AUSTRIA = 40,
69 CTRY_AZERBAIJAN = 31,
70 CTRY_BAHRAIN = 48,
71 CTRY_BELARUS = 112,
72 CTRY_BELGIUM = 56,
73 CTRY_BELIZE = 84,
74 CTRY_BOLIVIA = 68,
75 CTRY_BOSNIA_HERZ = 70,
76 CTRY_BRAZIL = 76,
77 CTRY_BRUNEI_DARUSSALAM = 96,
78 CTRY_BULGARIA = 100,
79 CTRY_CANADA = 124,
80 CTRY_CHILE = 152,
81 CTRY_CHINA = 156,
82 CTRY_COLOMBIA = 170,
83 CTRY_COSTA_RICA = 188,
84 CTRY_CROATIA = 191,
85 CTRY_CYPRUS = 196,
86 CTRY_CZECH = 203,
87 CTRY_DENMARK = 208,
88 CTRY_DOMINICAN_REPUBLIC = 214,
89 CTRY_ECUADOR = 218,
90 CTRY_EGYPT = 818,
91 CTRY_EL_SALVADOR = 222,
92 CTRY_ESTONIA = 233,
93 CTRY_FAEROE_ISLANDS = 234,
94 CTRY_FINLAND = 246,
95 CTRY_FRANCE = 250,
96 CTRY_GEORGIA = 268,
97 CTRY_GERMANY = 276,
98 CTRY_GREECE = 300,
99 CTRY_GUATEMALA = 320,
100 CTRY_HONDURAS = 340,
101 CTRY_HONG_KONG = 344,
102 CTRY_HUNGARY = 348,
103 CTRY_ICELAND = 352,
104 CTRY_INDIA = 356,
105 CTRY_INDONESIA = 360,
106 CTRY_IRAN = 364,
107 CTRY_IRAQ = 368,
108 CTRY_IRELAND = 372,
109 CTRY_ISRAEL = 376,
110 CTRY_ITALY = 380,
111 CTRY_JAMAICA = 388,
112 CTRY_JAPAN = 392,
113 CTRY_JORDAN = 400,
114 CTRY_KAZAKHSTAN = 398,
115 CTRY_KENYA = 404,
116 CTRY_KOREA_NORTH = 408,
117 CTRY_KOREA_ROC = 410,
118 CTRY_KOREA_ROC2 = 411,
119 CTRY_KOREA_ROC3 = 412,
120 CTRY_KUWAIT = 414,
121 CTRY_LATVIA = 428,
122 CTRY_LEBANON = 422,
123 CTRY_LIBYA = 434,
124 CTRY_LIECHTENSTEIN = 438,
125 CTRY_LITHUANIA = 440,
126 CTRY_LUXEMBOURG = 442,
127 CTRY_MACAU = 446,
128 CTRY_MACEDONIA = 807,
129 CTRY_MALAYSIA = 458,
130 CTRY_MALTA = 470,
131 CTRY_MEXICO = 484,
132 CTRY_MONACO = 492,
133 CTRY_MOROCCO = 504,
134 CTRY_NEPAL = 524,
135 CTRY_NETHERLANDS = 528,
136 CTRY_NETHERLANDS_ANTILLES = 530,
137 CTRY_NEW_ZEALAND = 554,
138 CTRY_NICARAGUA = 558,
139 CTRY_NORWAY = 578,
140 CTRY_OMAN = 512,
141 CTRY_PAKISTAN = 586,
142 CTRY_PANAMA = 591,
143 CTRY_PAPUA_NEW_GUINEA = 598,
144 CTRY_PARAGUAY = 600,
145 CTRY_PERU = 604,
146 CTRY_PHILIPPINES = 608,
147 CTRY_POLAND = 616,
148 CTRY_PORTUGAL = 620,
149 CTRY_PUERTO_RICO = 630,
150 CTRY_QATAR = 634,
151 CTRY_ROMANIA = 642,
152 CTRY_RUSSIA = 643,
153 CTRY_SAUDI_ARABIA = 682,
154 CTRY_SERBIA_MONTENEGRO = 891,
155 CTRY_SINGAPORE = 702,
156 CTRY_SLOVAKIA = 703,
157 CTRY_SLOVENIA = 705,
158 CTRY_SOUTH_AFRICA = 710,
159 CTRY_SPAIN = 724,
160 CTRY_SRI_LANKA = 144,
161 CTRY_SWEDEN = 752,
162 CTRY_SWITZERLAND = 756,
163 CTRY_SYRIA = 760,
164 CTRY_TAIWAN = 158,
165 CTRY_THAILAND = 764,
166 CTRY_TRINIDAD_Y_TOBAGO = 780,
167 CTRY_TUNISIA = 788,
168 CTRY_TURKEY = 792,
169 CTRY_UAE = 784,
170 CTRY_UKRAINE = 804,
171 CTRY_UNITED_KINGDOM = 826,
172 CTRY_UNITED_STATES = 840,
173 CTRY_UNITED_STATES_FCC49 = 842,
174 CTRY_URUGUAY = 858,
175 CTRY_UZBEKISTAN = 860,
176 CTRY_VENEZUELA = 862,
177 CTRY_VIET_NAM = 704,
178 CTRY_YEMEN = 887,
179 CTRY_ZIMBABWE = 716,
180 CTRY_JAPAN1 = 393,
181 CTRY_JAPAN2 = 394,
182 CTRY_JAPAN3 = 395,
183 CTRY_JAPAN4 = 396,
184 CTRY_JAPAN5 = 397,
185 CTRY_JAPAN6 = 4006,
186 CTRY_JAPAN7 = 4007,
187 CTRY_JAPAN8 = 4008,
188 CTRY_JAPAN9 = 4009,
189 CTRY_JAPAN10 = 4010,
190 CTRY_JAPAN11 = 4011,
191 CTRY_JAPAN12 = 4012,
192 CTRY_JAPAN13 = 4013,
193 CTRY_JAPAN14 = 4014,
194 CTRY_JAPAN15 = 4015,
195 CTRY_JAPAN16 = 4016,
196 CTRY_JAPAN17 = 4017,
197 CTRY_JAPAN18 = 4018,
198 CTRY_JAPAN19 = 4019,
199 CTRY_JAPAN20 = 4020,
200 CTRY_JAPAN21 = 4021,
201 CTRY_JAPAN22 = 4022,
202 CTRY_JAPAN23 = 4023,
203 CTRY_JAPAN24 = 4024,
204 CTRY_JAPAN25 = 4025,
205 CTRY_JAPAN26 = 4026,
206 CTRY_JAPAN27 = 4027,
207 CTRY_JAPAN28 = 4028,
208 CTRY_JAPAN29 = 4029,
209 CTRY_JAPAN30 = 4030,
210 CTRY_JAPAN31 = 4031,
211 CTRY_JAPAN32 = 4032,
212 CTRY_JAPAN33 = 4033,
213 CTRY_JAPAN34 = 4034,
214 CTRY_JAPAN35 = 4035,
215 CTRY_JAPAN36 = 4036,
216 CTRY_JAPAN37 = 4037,
217 CTRY_JAPAN38 = 4038,
218 CTRY_JAPAN39 = 4039,
219 CTRY_JAPAN40 = 4040,
220 CTRY_JAPAN41 = 4041,
221 CTRY_JAPAN42 = 4042,
222 CTRY_JAPAN43 = 4043,
223 CTRY_JAPAN44 = 4044,
224 CTRY_JAPAN45 = 4045,
225 CTRY_JAPAN46 = 4046,
226 CTRY_JAPAN47 = 4047,
227 CTRY_JAPAN48 = 4048,
228 CTRY_JAPAN49 = 4049,
229 CTRY_JAPAN50 = 4050,
230 CTRY_JAPAN51 = 4051,
231 CTRY_JAPAN52 = 4052,
232 CTRY_JAPAN53 = 4053,
233 CTRY_JAPAN54 = 4054,
234 CTRY_JAPAN55 = 4055,
235 CTRY_JAPAN56 = 4056,
236 CTRY_JAPAN57 = 4057,
237 CTRY_JAPAN58 = 4058,
238 CTRY_JAPAN59 = 4059,
239 CTRY_AUSTRALIA2 = 5000,
240 CTRY_CANADA2 = 5001,
241 CTRY_BELGIUM2 = 5002
244 bool ath_is_world_regd(struct ath_regulatory *reg);
245 int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
246 int (*reg_notifier)(struct wiphy *wiphy,
247 struct regulatory_request *request));
248 u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
249 enum ieee80211_band band);
250 int ath_reg_notifier_apply(struct wiphy *wiphy,
251 struct regulatory_request *request,
252 struct ath_regulatory *reg);
254 #endif