iPXE
regd.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2009 Atheros Communications Inc.
00003  *
00004  * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
00005  * Original from Linux kernel 3.0.1
00006  *
00007  * Permission to use, copy, modify, and/or distribute this software for any
00008  * purpose with or without fee is hereby granted, provided that the above
00009  * copyright notice and this permission notice appear in all copies.
00010  *
00011  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00012  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00013  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00014  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00015  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00016  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00017  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00018  */
00019 
00020 #ifndef REGD_H
00021 #define REGD_H
00022 
00023 FILE_LICENCE ( BSD2 );
00024 
00025 #include "ath.h"
00026 
00027 enum ctl_group {
00028         CTL_FCC = 0x10,
00029         CTL_MKK = 0x40,
00030         CTL_ETSI = 0x30,
00031 };
00032 
00033 #define NO_CTL 0xff
00034 #define SD_NO_CTL               0xE0
00035 #define NO_CTL                  0xff
00036 #define CTL_11A                 0
00037 #define CTL_11B                 1
00038 #define CTL_11G                 2
00039 #define CTL_2GHT20              5
00040 #define CTL_5GHT20              6
00041 #define CTL_2GHT40              7
00042 #define CTL_5GHT40              8
00043 
00044 #define CTRY_DEBUG 0x1ff
00045 #define CTRY_DEFAULT 0
00046 
00047 #define COUNTRY_ERD_FLAG        0x8000
00048 #define WORLDWIDE_ROAMING_FLAG  0x4000
00049 
00050 #define MULTI_DOMAIN_MASK 0xFF00
00051 
00052 #define WORLD_SKU_MASK          0x00F0
00053 #define WORLD_SKU_PREFIX        0x0060
00054 
00055 #define CHANNEL_HALF_BW         10
00056 #define CHANNEL_QUARTER_BW      5
00057 
00058 struct country_code_to_enum_rd {
00059         u16 countryCode;
00060         u16 regDmnEnum;
00061         const char *isoName;
00062 };
00063 
00064 enum CountryCode {
00065         CTRY_ALBANIA = 8,
00066         CTRY_ALGERIA = 12,
00067         CTRY_ARGENTINA = 32,
00068         CTRY_ARMENIA = 51,
00069         CTRY_ARUBA = 533,
00070         CTRY_AUSTRALIA = 36,
00071         CTRY_AUSTRIA = 40,
00072         CTRY_AZERBAIJAN = 31,
00073         CTRY_BAHRAIN = 48,
00074         CTRY_BANGLADESH = 50,
00075         CTRY_BARBADOS = 52,
00076         CTRY_BELARUS = 112,
00077         CTRY_BELGIUM = 56,
00078         CTRY_BELIZE = 84,
00079         CTRY_BOLIVIA = 68,
00080         CTRY_BOSNIA_HERZ = 70,
00081         CTRY_BRAZIL = 76,
00082         CTRY_BRUNEI_DARUSSALAM = 96,
00083         CTRY_BULGARIA = 100,
00084         CTRY_CAMBODIA = 116,
00085         CTRY_CANADA = 124,
00086         CTRY_CHILE = 152,
00087         CTRY_CHINA = 156,
00088         CTRY_COLOMBIA = 170,
00089         CTRY_COSTA_RICA = 188,
00090         CTRY_CROATIA = 191,
00091         CTRY_CYPRUS = 196,
00092         CTRY_CZECH = 203,
00093         CTRY_DENMARK = 208,
00094         CTRY_DOMINICAN_REPUBLIC = 214,
00095         CTRY_ECUADOR = 218,
00096         CTRY_EGYPT = 818,
00097         CTRY_EL_SALVADOR = 222,
00098         CTRY_ESTONIA = 233,
00099         CTRY_FAEROE_ISLANDS = 234,
00100         CTRY_FINLAND = 246,
00101         CTRY_FRANCE = 250,
00102         CTRY_GEORGIA = 268,
00103         CTRY_GERMANY = 276,
00104         CTRY_GREECE = 300,
00105         CTRY_GREENLAND = 304,
00106         CTRY_GRENEDA = 308,
00107         CTRY_GUAM = 316,
00108         CTRY_GUATEMALA = 320,
00109         CTRY_HAITI = 332,
00110         CTRY_HONDURAS = 340,
00111         CTRY_HONG_KONG = 344,
00112         CTRY_HUNGARY = 348,
00113         CTRY_ICELAND = 352,
00114         CTRY_INDIA = 356,
00115         CTRY_INDONESIA = 360,
00116         CTRY_IRAN = 364,
00117         CTRY_IRAQ = 368,
00118         CTRY_IRELAND = 372,
00119         CTRY_ISRAEL = 376,
00120         CTRY_ITALY = 380,
00121         CTRY_JAMAICA = 388,
00122         CTRY_JAPAN = 392,
00123         CTRY_JORDAN = 400,
00124         CTRY_KAZAKHSTAN = 398,
00125         CTRY_KENYA = 404,
00126         CTRY_KOREA_NORTH = 408,
00127         CTRY_KOREA_ROC = 410,
00128         CTRY_KOREA_ROC2 = 411,
00129         CTRY_KOREA_ROC3 = 412,
00130         CTRY_KUWAIT = 414,
00131         CTRY_LATVIA = 428,
00132         CTRY_LEBANON = 422,
00133         CTRY_LIBYA = 434,
00134         CTRY_LIECHTENSTEIN = 438,
00135         CTRY_LITHUANIA = 440,
00136         CTRY_LUXEMBOURG = 442,
00137         CTRY_MACAU = 446,
00138         CTRY_MACEDONIA = 807,
00139         CTRY_MALAYSIA = 458,
00140         CTRY_MALTA = 470,
00141         CTRY_MEXICO = 484,
00142         CTRY_MONACO = 492,
00143         CTRY_MOROCCO = 504,
00144         CTRY_NEPAL = 524,
00145         CTRY_NETHERLANDS = 528,
00146         CTRY_NETHERLANDS_ANTILLES = 530,
00147         CTRY_NEW_ZEALAND = 554,
00148         CTRY_NICARAGUA = 558,
00149         CTRY_NORWAY = 578,
00150         CTRY_OMAN = 512,
00151         CTRY_PAKISTAN = 586,
00152         CTRY_PANAMA = 591,
00153         CTRY_PAPUA_NEW_GUINEA = 598,
00154         CTRY_PARAGUAY = 600,
00155         CTRY_PERU = 604,
00156         CTRY_PHILIPPINES = 608,
00157         CTRY_POLAND = 616,
00158         CTRY_PORTUGAL = 620,
00159         CTRY_PUERTO_RICO = 630,
00160         CTRY_QATAR = 634,
00161         CTRY_ROMANIA = 642,
00162         CTRY_RUSSIA = 643,
00163         CTRY_SAUDI_ARABIA = 682,
00164         CTRY_SERBIA_MONTENEGRO = 891,
00165         CTRY_SINGAPORE = 702,
00166         CTRY_SLOVAKIA = 703,
00167         CTRY_SLOVENIA = 705,
00168         CTRY_SOUTH_AFRICA = 710,
00169         CTRY_SPAIN = 724,
00170         CTRY_SRI_LANKA = 144,
00171         CTRY_SWEDEN = 752,
00172         CTRY_SWITZERLAND = 756,
00173         CTRY_SYRIA = 760,
00174         CTRY_TAIWAN = 158,
00175         CTRY_THAILAND = 764,
00176         CTRY_TRINIDAD_Y_TOBAGO = 780,
00177         CTRY_TUNISIA = 788,
00178         CTRY_TURKEY = 792,
00179         CTRY_UAE = 784,
00180         CTRY_UKRAINE = 804,
00181         CTRY_UNITED_KINGDOM = 826,
00182         CTRY_UNITED_STATES = 840,
00183         CTRY_UNITED_STATES_FCC49 = 842,
00184         CTRY_URUGUAY = 858,
00185         CTRY_UZBEKISTAN = 860,
00186         CTRY_VENEZUELA = 862,
00187         CTRY_VIET_NAM = 704,
00188         CTRY_YEMEN = 887,
00189         CTRY_ZIMBABWE = 716,
00190         CTRY_JAPAN1 = 393,
00191         CTRY_JAPAN2 = 394,
00192         CTRY_JAPAN3 = 395,
00193         CTRY_JAPAN4 = 396,
00194         CTRY_JAPAN5 = 397,
00195         CTRY_JAPAN6 = 4006,
00196         CTRY_JAPAN7 = 4007,
00197         CTRY_JAPAN8 = 4008,
00198         CTRY_JAPAN9 = 4009,
00199         CTRY_JAPAN10 = 4010,
00200         CTRY_JAPAN11 = 4011,
00201         CTRY_JAPAN12 = 4012,
00202         CTRY_JAPAN13 = 4013,
00203         CTRY_JAPAN14 = 4014,
00204         CTRY_JAPAN15 = 4015,
00205         CTRY_JAPAN16 = 4016,
00206         CTRY_JAPAN17 = 4017,
00207         CTRY_JAPAN18 = 4018,
00208         CTRY_JAPAN19 = 4019,
00209         CTRY_JAPAN20 = 4020,
00210         CTRY_JAPAN21 = 4021,
00211         CTRY_JAPAN22 = 4022,
00212         CTRY_JAPAN23 = 4023,
00213         CTRY_JAPAN24 = 4024,
00214         CTRY_JAPAN25 = 4025,
00215         CTRY_JAPAN26 = 4026,
00216         CTRY_JAPAN27 = 4027,
00217         CTRY_JAPAN28 = 4028,
00218         CTRY_JAPAN29 = 4029,
00219         CTRY_JAPAN30 = 4030,
00220         CTRY_JAPAN31 = 4031,
00221         CTRY_JAPAN32 = 4032,
00222         CTRY_JAPAN33 = 4033,
00223         CTRY_JAPAN34 = 4034,
00224         CTRY_JAPAN35 = 4035,
00225         CTRY_JAPAN36 = 4036,
00226         CTRY_JAPAN37 = 4037,
00227         CTRY_JAPAN38 = 4038,
00228         CTRY_JAPAN39 = 4039,
00229         CTRY_JAPAN40 = 4040,
00230         CTRY_JAPAN41 = 4041,
00231         CTRY_JAPAN42 = 4042,
00232         CTRY_JAPAN43 = 4043,
00233         CTRY_JAPAN44 = 4044,
00234         CTRY_JAPAN45 = 4045,
00235         CTRY_JAPAN46 = 4046,
00236         CTRY_JAPAN47 = 4047,
00237         CTRY_JAPAN48 = 4048,
00238         CTRY_JAPAN49 = 4049,
00239         CTRY_JAPAN50 = 4050,
00240         CTRY_JAPAN51 = 4051,
00241         CTRY_JAPAN52 = 4052,
00242         CTRY_JAPAN53 = 4053,
00243         CTRY_JAPAN54 = 4054,
00244         CTRY_JAPAN55 = 4055,
00245         CTRY_JAPAN56 = 4056,
00246         CTRY_JAPAN57 = 4057,
00247         CTRY_JAPAN58 = 4058,
00248         CTRY_JAPAN59 = 4059,
00249         CTRY_AUSTRALIA2 = 5000,
00250         CTRY_CANADA2 = 5001,
00251         CTRY_BELGIUM2 = 5002
00252 };
00253 
00254 int ath_is_world_regd(struct ath_regulatory *reg);
00255 int ath_is_49ghz_allowed(u16 redomain);
00256 //int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
00257 //                int (*reg_notifier)(struct wiphy *wiphy,
00258 //                struct regulatory_request *request));
00259 u32 ath_regd_get_band_ctl(struct ath_regulatory *reg,
00260                           int band);
00261 //int ath_reg_notifier_apply(struct wiphy *wiphy,
00262 //                         struct regulatory_request *request,
00263 //                         struct ath_regulatory *reg);
00264 
00265 #endif