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.
154 DEBUG_REG_DMN = 0x01ff,
163 /* Regpair to CTL band mapping */
164 static struct reg_dmn_pair_mapping regDomainPairs[] = {
165 /* regpair, 5 GHz CTL, 2 GHz CTL */
166 {NO_ENUMRD, DEBUG_REG_DMN, DEBUG_REG_DMN},
167 {NULL1_WORLD, NO_CTL, CTL_ETSI},
168 {NULL1_ETSIB, NO_CTL, CTL_ETSI},
169 {NULL1_ETSIC, NO_CTL, CTL_ETSI},
171 {FCC2_FCCA, CTL_FCC, CTL_FCC},
172 {FCC2_WORLD, CTL_FCC, CTL_ETSI},
173 {FCC2_ETSIC, CTL_FCC, CTL_ETSI},
174 {FCC3_FCCA, CTL_FCC, CTL_FCC},
175 {FCC3_WORLD, CTL_FCC, CTL_ETSI},
176 {FCC4_FCCA, CTL_FCC, CTL_FCC},
177 {FCC5_FCCA, CTL_FCC, CTL_FCC},
178 {FCC6_FCCA, CTL_FCC, CTL_FCC},
179 {FCC6_WORLD, CTL_FCC, CTL_ETSI},
181 {ETSI1_WORLD, CTL_ETSI, CTL_ETSI},
182 {ETSI2_WORLD, CTL_ETSI, CTL_ETSI},
183 {ETSI3_WORLD, CTL_ETSI, CTL_ETSI},
184 {ETSI4_WORLD, CTL_ETSI, CTL_ETSI},
185 {ETSI5_WORLD, CTL_ETSI, CTL_ETSI},
186 {ETSI6_WORLD, CTL_ETSI, CTL_ETSI},
188 /* XXX: For ETSI3_ETSIA, Was NO_CTL meant for the 2 GHz band ? */
189 {ETSI3_ETSIA, CTL_ETSI, CTL_ETSI},
190 {FRANCE_RES, CTL_ETSI, CTL_ETSI},
192 {FCC1_WORLD, CTL_FCC, CTL_ETSI},
193 {FCC1_FCCA, CTL_FCC, CTL_FCC},
194 {APL1_WORLD, CTL_FCC, CTL_ETSI},
195 {APL2_WORLD, CTL_FCC, CTL_ETSI},
196 {APL3_WORLD, CTL_FCC, CTL_ETSI},
197 {APL4_WORLD, CTL_FCC, CTL_ETSI},
198 {APL5_WORLD, CTL_FCC, CTL_ETSI},
199 {APL6_WORLD, CTL_ETSI, CTL_ETSI},
200 {APL8_WORLD, CTL_ETSI, CTL_ETSI},
201 {APL9_WORLD, CTL_ETSI, CTL_ETSI},
203 {APL3_FCCA, CTL_FCC, CTL_FCC},
204 {APL1_ETSIC, CTL_FCC, CTL_ETSI},
205 {APL2_ETSIC, CTL_FCC, CTL_ETSI},
206 {APL2_APLD, CTL_FCC, NO_CTL},
208 {MKK1_MKKA, CTL_MKK, CTL_MKK},
209 {MKK1_MKKB, CTL_MKK, CTL_MKK},
210 {MKK1_FCCA, CTL_MKK, CTL_FCC},
211 {MKK1_MKKA1, CTL_MKK, CTL_MKK},
212 {MKK1_MKKA2, CTL_MKK, CTL_MKK},
213 {MKK1_MKKC, CTL_MKK, CTL_MKK},
215 {MKK2_MKKA, CTL_MKK, CTL_MKK},
216 {MKK3_MKKA, CTL_MKK, CTL_MKK},
217 {MKK3_MKKB, CTL_MKK, CTL_MKK},
218 {MKK3_MKKA1, CTL_MKK, CTL_MKK},
219 {MKK3_MKKA2, CTL_MKK, CTL_MKK},
220 {MKK3_MKKC, CTL_MKK, CTL_MKK},
221 {MKK3_FCCA, CTL_MKK, CTL_FCC},
223 {MKK4_MKKA, CTL_MKK, CTL_MKK},
224 {MKK4_MKKB, CTL_MKK, CTL_MKK},
225 {MKK4_MKKA1, CTL_MKK, CTL_MKK},
226 {MKK4_MKKA2, CTL_MKK, CTL_MKK},
227 {MKK4_MKKC, CTL_MKK, CTL_MKK},
228 {MKK4_FCCA, CTL_MKK, CTL_FCC},
230 {MKK5_MKKB, CTL_MKK, CTL_MKK},
231 {MKK5_MKKA2, CTL_MKK, CTL_MKK},
232 {MKK5_MKKC, CTL_MKK, CTL_MKK},
234 {MKK6_MKKB, CTL_MKK, CTL_MKK},
235 {MKK6_MKKA1, CTL_MKK, CTL_MKK},
236 {MKK6_MKKA2, CTL_MKK, CTL_MKK},
237 {MKK6_MKKC, CTL_MKK, CTL_MKK},
238 {MKK6_FCCA, CTL_MKK, CTL_FCC},
240 {MKK7_MKKB, CTL_MKK, CTL_MKK},
241 {MKK7_MKKA1, CTL_MKK, CTL_MKK},
242 {MKK7_MKKA2, CTL_MKK, CTL_MKK},
243 {MKK7_MKKC, CTL_MKK, CTL_MKK},
244 {MKK7_FCCA, CTL_MKK, CTL_FCC},
246 {MKK8_MKKB, CTL_MKK, CTL_MKK},
247 {MKK8_MKKA2, CTL_MKK, CTL_MKK},
248 {MKK8_MKKC, CTL_MKK, CTL_MKK},
250 {MKK9_MKKA, CTL_MKK, CTL_MKK},
251 {MKK9_FCCA, CTL_MKK, CTL_FCC},
252 {MKK9_MKKA1, CTL_MKK, CTL_MKK},
253 {MKK9_MKKA2, CTL_MKK, CTL_MKK},
254 {MKK9_MKKC, CTL_MKK, CTL_MKK},
256 {MKK10_MKKA, CTL_MKK, CTL_MKK},
257 {MKK10_FCCA, CTL_MKK, CTL_FCC},
258 {MKK10_MKKA1, CTL_MKK, CTL_MKK},
259 {MKK10_MKKA2, CTL_MKK, CTL_MKK},
260 {MKK10_MKKC, CTL_MKK, CTL_MKK},
262 {MKK11_MKKA, CTL_MKK, CTL_MKK},
263 {MKK11_FCCA, CTL_MKK, CTL_FCC},
264 {MKK11_MKKA1, CTL_MKK, CTL_MKK},
265 {MKK11_MKKA2, CTL_MKK, CTL_MKK},
266 {MKK11_MKKC, CTL_MKK, CTL_MKK},
268 {MKK12_MKKA, CTL_MKK, CTL_MKK},
269 {MKK12_FCCA, CTL_MKK, CTL_FCC},
270 {MKK12_MKKA1, CTL_MKK, CTL_MKK},
271 {MKK12_MKKA2, CTL_MKK, CTL_MKK},
272 {MKK12_MKKC, CTL_MKK, CTL_MKK},
274 {MKK13_MKKB, CTL_MKK, CTL_MKK},
275 {MKK14_MKKA1, CTL_MKK, CTL_MKK},
276 {MKK15_MKKA1, CTL_MKK, CTL_MKK},
278 {WOR0_WORLD, NO_CTL, NO_CTL},
279 {WOR1_WORLD, NO_CTL, NO_CTL},
280 {WOR2_WORLD, NO_CTL, NO_CTL},
281 {WOR3_WORLD, NO_CTL, NO_CTL},
282 {WOR4_WORLD, NO_CTL, NO_CTL},
283 {WOR5_ETSIC, NO_CTL, NO_CTL},
284 {WOR01_WORLD, NO_CTL, NO_CTL},
285 {WOR02_WORLD, NO_CTL, NO_CTL},
286 {EU1_WORLD, NO_CTL, NO_CTL},
287 {WOR9_WORLD, NO_CTL, NO_CTL},
288 {WORA_WORLD, NO_CTL, NO_CTL},
289 {WORB_WORLD, NO_CTL, NO_CTL},
292 static struct country_code_to_enum_rd allCountries[] = {
293 {CTRY_DEBUG, NO_ENUMRD, "DB"},
294 {CTRY_DEFAULT, FCC1_FCCA, "CO"},
295 {CTRY_ALBANIA, NULL1_WORLD, "AL"},
296 {CTRY_ALGERIA, NULL1_WORLD, "DZ"},
297 {CTRY_ARGENTINA, APL3_WORLD, "AR"},
298 {CTRY_ARMENIA, ETSI4_WORLD, "AM"},
299 {CTRY_AUSTRALIA, FCC2_WORLD, "AU"},
300 {CTRY_AUSTRALIA2, FCC6_WORLD, "AU"},
301 {CTRY_AUSTRIA, ETSI1_WORLD, "AT"},
302 {CTRY_AZERBAIJAN, ETSI4_WORLD, "AZ"},
303 {CTRY_BAHRAIN, APL6_WORLD, "BH"},
304 {CTRY_BELARUS, ETSI1_WORLD, "BY"},
305 {CTRY_BELGIUM, ETSI1_WORLD, "BE"},
306 {CTRY_BELGIUM2, ETSI4_WORLD, "BL"},
307 {CTRY_BELIZE, APL1_ETSIC, "BZ"},
308 {CTRY_BOLIVIA, APL1_ETSIC, "BO"},
309 {CTRY_BOSNIA_HERZ, ETSI1_WORLD, "BA"},
310 {CTRY_BRAZIL, FCC3_WORLD, "BR"},
311 {CTRY_BRUNEI_DARUSSALAM, APL1_WORLD, "BN"},
312 {CTRY_BULGARIA, ETSI6_WORLD, "BG"},
313 {CTRY_CANADA, FCC2_FCCA, "CA"},
314 {CTRY_CANADA2, FCC6_FCCA, "CA"},
315 {CTRY_CHILE, APL6_WORLD, "CL"},
316 {CTRY_CHINA, APL1_WORLD, "CN"},
317 {CTRY_COLOMBIA, FCC1_FCCA, "CO"},
318 {CTRY_COSTA_RICA, FCC1_WORLD, "CR"},
319 {CTRY_CROATIA, ETSI3_WORLD, "HR"},
320 {CTRY_CYPRUS, ETSI1_WORLD, "CY"},
321 {CTRY_CZECH, ETSI3_WORLD, "CZ"},
322 {CTRY_DENMARK, ETSI1_WORLD, "DK"},
323 {CTRY_DOMINICAN_REPUBLIC, FCC1_FCCA, "DO"},
324 {CTRY_ECUADOR, FCC1_WORLD, "EC"},
325 {CTRY_EGYPT, ETSI3_WORLD, "EG"},
326 {CTRY_EL_SALVADOR, FCC1_WORLD, "SV"},
327 {CTRY_ESTONIA, ETSI1_WORLD, "EE"},
328 {CTRY_FINLAND, ETSI1_WORLD, "FI"},
329 {CTRY_FRANCE, ETSI1_WORLD, "FR"},
330 {CTRY_GEORGIA, ETSI4_WORLD, "GE"},
331 {CTRY_GERMANY, ETSI1_WORLD, "DE"},
332 {CTRY_GREECE, ETSI1_WORLD, "GR"},
333 {CTRY_GUATEMALA, FCC1_FCCA, "GT"},
334 {CTRY_HONDURAS, NULL1_WORLD, "HN"},
335 {CTRY_HONG_KONG, FCC2_WORLD, "HK"},
336 {CTRY_HUNGARY, ETSI1_WORLD, "HU"},
337 {CTRY_ICELAND, ETSI1_WORLD, "IS"},
338 {CTRY_INDIA, APL6_WORLD, "IN"},
339 {CTRY_INDONESIA, APL1_WORLD, "ID"},
340 {CTRY_IRAN, APL1_WORLD, "IR"},
341 {CTRY_IRELAND, ETSI1_WORLD, "IE"},
342 {CTRY_ISRAEL, NULL1_WORLD, "IL"},
343 {CTRY_ITALY, ETSI1_WORLD, "IT"},
344 {CTRY_JAMAICA, ETSI1_WORLD, "JM"},
346 {CTRY_JAPAN, MKK1_MKKA, "JP"},
347 {CTRY_JAPAN1, MKK1_MKKB, "JP"},
348 {CTRY_JAPAN2, MKK1_FCCA, "JP"},
349 {CTRY_JAPAN3, MKK2_MKKA, "JP"},
350 {CTRY_JAPAN4, MKK1_MKKA1, "JP"},
351 {CTRY_JAPAN5, MKK1_MKKA2, "JP"},
352 {CTRY_JAPAN6, MKK1_MKKC, "JP"},
353 {CTRY_JAPAN7, MKK3_MKKB, "JP"},
354 {CTRY_JAPAN8, MKK3_MKKA2, "JP"},
355 {CTRY_JAPAN9, MKK3_MKKC, "JP"},
356 {CTRY_JAPAN10, MKK4_MKKB, "JP"},
357 {CTRY_JAPAN11, MKK4_MKKA2, "JP"},
358 {CTRY_JAPAN12, MKK4_MKKC, "JP"},
359 {CTRY_JAPAN13, MKK5_MKKB, "JP"},
360 {CTRY_JAPAN14, MKK5_MKKA2, "JP"},
361 {CTRY_JAPAN15, MKK5_MKKC, "JP"},
362 {CTRY_JAPAN16, MKK6_MKKB, "JP"},
363 {CTRY_JAPAN17, MKK6_MKKA2, "JP"},
364 {CTRY_JAPAN18, MKK6_MKKC, "JP"},
365 {CTRY_JAPAN19, MKK7_MKKB, "JP"},
366 {CTRY_JAPAN20, MKK7_MKKA2, "JP"},
367 {CTRY_JAPAN21, MKK7_MKKC, "JP"},
368 {CTRY_JAPAN22, MKK8_MKKB, "JP"},
369 {CTRY_JAPAN23, MKK8_MKKA2, "JP"},
370 {CTRY_JAPAN24, MKK8_MKKC, "JP"},
371 {CTRY_JAPAN25, MKK3_MKKA, "JP"},
372 {CTRY_JAPAN26, MKK3_MKKA1, "JP"},
373 {CTRY_JAPAN27, MKK3_FCCA, "JP"},
374 {CTRY_JAPAN28, MKK4_MKKA1, "JP"},
375 {CTRY_JAPAN29, MKK4_FCCA, "JP"},
376 {CTRY_JAPAN30, MKK6_MKKA1, "JP"},
377 {CTRY_JAPAN31, MKK6_FCCA, "JP"},
378 {CTRY_JAPAN32, MKK7_MKKA1, "JP"},
379 {CTRY_JAPAN33, MKK7_FCCA, "JP"},
380 {CTRY_JAPAN34, MKK9_MKKA, "JP"},
381 {CTRY_JAPAN35, MKK10_MKKA, "JP"},
382 {CTRY_JAPAN36, MKK4_MKKA, "JP"},
383 {CTRY_JAPAN37, MKK9_FCCA, "JP"},
384 {CTRY_JAPAN38, MKK9_MKKA1, "JP"},
385 {CTRY_JAPAN39, MKK9_MKKC, "JP"},
386 {CTRY_JAPAN40, MKK9_MKKA2, "JP"},
387 {CTRY_JAPAN41, MKK10_FCCA, "JP"},
388 {CTRY_JAPAN42, MKK10_MKKA1, "JP"},
389 {CTRY_JAPAN43, MKK10_MKKC, "JP"},
390 {CTRY_JAPAN44, MKK10_MKKA2, "JP"},
391 {CTRY_JAPAN45, MKK11_MKKA, "JP"},
392 {CTRY_JAPAN46, MKK11_FCCA, "JP"},
393 {CTRY_JAPAN47, MKK11_MKKA1, "JP"},
394 {CTRY_JAPAN48, MKK11_MKKC, "JP"},
395 {CTRY_JAPAN49, MKK11_MKKA2, "JP"},
396 {CTRY_JAPAN50, MKK12_MKKA, "JP"},
397 {CTRY_JAPAN51, MKK12_FCCA, "JP"},
398 {CTRY_JAPAN52, MKK12_MKKA1, "JP"},
399 {CTRY_JAPAN53, MKK12_MKKC, "JP"},
400 {CTRY_JAPAN54, MKK12_MKKA2, "JP"},
401 {CTRY_JAPAN57, MKK13_MKKB, "JP"},
402 {CTRY_JAPAN58, MKK14_MKKA1, "JP"},
403 {CTRY_JAPAN59, MKK15_MKKA1, "JP"},
405 {CTRY_JORDAN, ETSI2_WORLD, "JO"},
406 {CTRY_KAZAKHSTAN, NULL1_WORLD, "KZ"},
407 {CTRY_KOREA_NORTH, APL9_WORLD, "KP"},
408 {CTRY_KOREA_ROC, APL9_WORLD, "KR"},
409 {CTRY_KOREA_ROC2, APL2_WORLD, "K2"},
410 {CTRY_KOREA_ROC3, APL9_WORLD, "K3"},
411 {CTRY_KUWAIT, NULL1_WORLD, "KW"},
412 {CTRY_LATVIA, ETSI1_WORLD, "LV"},
413 {CTRY_LEBANON, NULL1_WORLD, "LB"},
414 {CTRY_LIECHTENSTEIN, ETSI1_WORLD, "LI"},
415 {CTRY_LITHUANIA, ETSI1_WORLD, "LT"},
416 {CTRY_LUXEMBOURG, ETSI1_WORLD, "LU"},
417 {CTRY_MACAU, FCC2_WORLD, "MO"},
418 {CTRY_MACEDONIA, NULL1_WORLD, "MK"},
419 {CTRY_MALAYSIA, APL8_WORLD, "MY"},
420 {CTRY_MALTA, ETSI1_WORLD, "MT"},
421 {CTRY_MEXICO, FCC1_FCCA, "MX"},
422 {CTRY_MONACO, ETSI4_WORLD, "MC"},
423 {CTRY_MOROCCO, NULL1_WORLD, "MA"},
424 {CTRY_NEPAL, APL1_WORLD, "NP"},
425 {CTRY_NETHERLANDS, ETSI1_WORLD, "NL"},
426 {CTRY_NETHERLANDS_ANTILLES, ETSI1_WORLD, "AN"},
427 {CTRY_NEW_ZEALAND, FCC2_ETSIC, "NZ"},
428 {CTRY_NORWAY, ETSI1_WORLD, "NO"},
429 {CTRY_OMAN, APL6_WORLD, "OM"},
430 {CTRY_PAKISTAN, NULL1_WORLD, "PK"},
431 {CTRY_PANAMA, FCC1_FCCA, "PA"},
432 {CTRY_PAPUA_NEW_GUINEA, FCC1_WORLD, "PG"},
433 {CTRY_PERU, APL1_WORLD, "PE"},
434 {CTRY_PHILIPPINES, APL1_WORLD, "PH"},
435 {CTRY_POLAND, ETSI1_WORLD, "PL"},
436 {CTRY_PORTUGAL, ETSI1_WORLD, "PT"},
437 {CTRY_PUERTO_RICO, FCC1_FCCA, "PR"},
438 {CTRY_QATAR, NULL1_WORLD, "QA"},
439 {CTRY_ROMANIA, NULL1_WORLD, "RO"},
440 {CTRY_RUSSIA, NULL1_WORLD, "RU"},
441 {CTRY_SAUDI_ARABIA, NULL1_WORLD, "SA"},
442 {CTRY_SERBIA_MONTENEGRO, ETSI1_WORLD, "CS"},
443 {CTRY_SINGAPORE, APL6_WORLD, "SG"},
444 {CTRY_SLOVAKIA, ETSI1_WORLD, "SK"},
445 {CTRY_SLOVENIA, ETSI1_WORLD, "SI"},
446 {CTRY_SOUTH_AFRICA, FCC3_WORLD, "ZA"},
447 {CTRY_SPAIN, ETSI1_WORLD, "ES"},
448 {CTRY_SRI_LANKA, FCC3_WORLD, "LK"},
449 {CTRY_SWEDEN, ETSI1_WORLD, "SE"},
450 {CTRY_SWITZERLAND, ETSI1_WORLD, "CH"},
451 {CTRY_SYRIA, NULL1_WORLD, "SY"},
452 {CTRY_TAIWAN, APL3_FCCA, "TW"},
453 {CTRY_THAILAND, NULL1_WORLD, "TH"},
454 {CTRY_TRINIDAD_Y_TOBAGO, ETSI4_WORLD, "TT"},
455 {CTRY_TUNISIA, ETSI3_WORLD, "TN"},
456 {CTRY_TURKEY, ETSI3_WORLD, "TR"},
457 {CTRY_UKRAINE, NULL1_WORLD, "UA"},
458 {CTRY_UAE, NULL1_WORLD, "AE"},
459 {CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
460 {CTRY_UNITED_STATES, FCC3_FCCA, "US"},
461 /* This "PS" is for US public safety actually... to support this we
462 * would need to assign new special alpha2 to CRDA db as with the world
463 * regdomain and use another alpha2 */
464 {CTRY_UNITED_STATES_FCC49, FCC4_FCCA, "PS"},
465 {CTRY_URUGUAY, APL2_WORLD, "UY"},
466 {CTRY_UZBEKISTAN, FCC3_FCCA, "UZ"},
467 {CTRY_VENEZUELA, APL2_ETSIC, "VE"},
468 {CTRY_VIET_NAM, NULL1_WORLD, "VN"},
469 {CTRY_YEMEN, NULL1_WORLD, "YE"},
470 {CTRY_ZIMBABWE, NULL1_WORLD, "ZW"},