13a702e49SBob Copeland /* 23a702e49SBob Copeland * Copyright (c) 2008-2009 Atheros Communications Inc. 33a702e49SBob Copeland * 43a702e49SBob Copeland * Permission to use, copy, modify, and/or distribute this software for any 53a702e49SBob Copeland * purpose with or without fee is hereby granted, provided that the above 63a702e49SBob Copeland * copyright notice and this permission notice appear in all copies. 73a702e49SBob Copeland * 83a702e49SBob Copeland * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 93a702e49SBob Copeland * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 103a702e49SBob Copeland * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 113a702e49SBob Copeland * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 123a702e49SBob Copeland * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 133a702e49SBob Copeland * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 143a702e49SBob Copeland * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 153a702e49SBob Copeland */ 163a702e49SBob Copeland 173a702e49SBob Copeland #ifndef REGD_H 183a702e49SBob Copeland #define REGD_H 193a702e49SBob Copeland 203a702e49SBob Copeland #include <linux/nl80211.h> 213a702e49SBob Copeland #include <net/cfg80211.h> 223a702e49SBob Copeland 23608b88cbSLuis R. Rodriguez #include "ath.h" 24608b88cbSLuis R. Rodriguez 257f42c37aSJoerg Albert enum ctl_group { 267f42c37aSJoerg Albert CTL_FCC = 0x10, 277f42c37aSJoerg Albert CTL_MKK = 0x40, 287f42c37aSJoerg Albert CTL_ETSI = 0x30, 297f42c37aSJoerg Albert }; 307f42c37aSJoerg Albert 313a702e49SBob Copeland #define NO_CTL 0xff 323a702e49SBob Copeland #define SD_NO_CTL 0xE0 333a702e49SBob Copeland #define NO_CTL 0xff 343a702e49SBob Copeland #define CTL_11A 0 353a702e49SBob Copeland #define CTL_11B 1 363a702e49SBob Copeland #define CTL_11G 2 373a702e49SBob Copeland #define CTL_2GHT20 5 383a702e49SBob Copeland #define CTL_5GHT20 6 393a702e49SBob Copeland #define CTL_2GHT40 7 403a702e49SBob Copeland #define CTL_5GHT40 8 413a702e49SBob Copeland 423a702e49SBob Copeland #define CTRY_DEBUG 0x1ff 433a702e49SBob Copeland #define CTRY_DEFAULT 0 443a702e49SBob Copeland 453a702e49SBob Copeland #define COUNTRY_ERD_FLAG 0x8000 463a702e49SBob Copeland #define WORLDWIDE_ROAMING_FLAG 0x4000 473a702e49SBob Copeland 483a702e49SBob Copeland #define MULTI_DOMAIN_MASK 0xFF00 493a702e49SBob Copeland 503a702e49SBob Copeland #define WORLD_SKU_MASK 0x00F0 513a702e49SBob Copeland #define WORLD_SKU_PREFIX 0x0060 523a702e49SBob Copeland 533a702e49SBob Copeland #define CHANNEL_HALF_BW 10 543a702e49SBob Copeland #define CHANNEL_QUARTER_BW 5 553a702e49SBob Copeland 563a702e49SBob Copeland struct country_code_to_enum_rd { 573a702e49SBob Copeland u16 countryCode; 583a702e49SBob Copeland u16 regDmnEnum; 593a702e49SBob Copeland const char *isoName; 603a702e49SBob Copeland }; 613a702e49SBob Copeland 623a702e49SBob Copeland enum CountryCode { 633a702e49SBob Copeland CTRY_ALBANIA = 8, 643a702e49SBob Copeland CTRY_ALGERIA = 12, 653a702e49SBob Copeland CTRY_ARGENTINA = 32, 663a702e49SBob Copeland CTRY_ARMENIA = 51, 67bd6b4442SVivek Natarajan CTRY_ARUBA = 533, 683a702e49SBob Copeland CTRY_AUSTRALIA = 36, 693a702e49SBob Copeland CTRY_AUSTRIA = 40, 703a702e49SBob Copeland CTRY_AZERBAIJAN = 31, 713a702e49SBob Copeland CTRY_BAHRAIN = 48, 72bd6b4442SVivek Natarajan CTRY_BANGLADESH = 50, 73bd6b4442SVivek Natarajan CTRY_BARBADOS = 52, 743a702e49SBob Copeland CTRY_BELARUS = 112, 753a702e49SBob Copeland CTRY_BELGIUM = 56, 763a702e49SBob Copeland CTRY_BELIZE = 84, 773a702e49SBob Copeland CTRY_BOLIVIA = 68, 783a702e49SBob Copeland CTRY_BOSNIA_HERZ = 70, 793a702e49SBob Copeland CTRY_BRAZIL = 76, 803a702e49SBob Copeland CTRY_BRUNEI_DARUSSALAM = 96, 813a702e49SBob Copeland CTRY_BULGARIA = 100, 82bd6b4442SVivek Natarajan CTRY_CAMBODIA = 116, 833a702e49SBob Copeland CTRY_CANADA = 124, 843a702e49SBob Copeland CTRY_CHILE = 152, 853a702e49SBob Copeland CTRY_CHINA = 156, 863a702e49SBob Copeland CTRY_COLOMBIA = 170, 873a702e49SBob Copeland CTRY_COSTA_RICA = 188, 883a702e49SBob Copeland CTRY_CROATIA = 191, 893a702e49SBob Copeland CTRY_CYPRUS = 196, 903a702e49SBob Copeland CTRY_CZECH = 203, 913a702e49SBob Copeland CTRY_DENMARK = 208, 923a702e49SBob Copeland CTRY_DOMINICAN_REPUBLIC = 214, 933a702e49SBob Copeland CTRY_ECUADOR = 218, 943a702e49SBob Copeland CTRY_EGYPT = 818, 953a702e49SBob Copeland CTRY_EL_SALVADOR = 222, 963a702e49SBob Copeland CTRY_ESTONIA = 233, 973a702e49SBob Copeland CTRY_FAEROE_ISLANDS = 234, 983a702e49SBob Copeland CTRY_FINLAND = 246, 993a702e49SBob Copeland CTRY_FRANCE = 250, 1003a702e49SBob Copeland CTRY_GEORGIA = 268, 1013a702e49SBob Copeland CTRY_GERMANY = 276, 1023a702e49SBob Copeland CTRY_GREECE = 300, 103bd6b4442SVivek Natarajan CTRY_GREENLAND = 304, 104d601d9caSPavel Roskin CTRY_GRENADA = 308, 105bd6b4442SVivek Natarajan CTRY_GUAM = 316, 1063a702e49SBob Copeland CTRY_GUATEMALA = 320, 107bd6b4442SVivek Natarajan CTRY_HAITI = 332, 1083a702e49SBob Copeland CTRY_HONDURAS = 340, 1093a702e49SBob Copeland CTRY_HONG_KONG = 344, 1103a702e49SBob Copeland CTRY_HUNGARY = 348, 1113a702e49SBob Copeland CTRY_ICELAND = 352, 1123a702e49SBob Copeland CTRY_INDIA = 356, 1133a702e49SBob Copeland CTRY_INDONESIA = 360, 1143a702e49SBob Copeland CTRY_IRAN = 364, 1153a702e49SBob Copeland CTRY_IRAQ = 368, 1163a702e49SBob Copeland CTRY_IRELAND = 372, 1173a702e49SBob Copeland CTRY_ISRAEL = 376, 1183a702e49SBob Copeland CTRY_ITALY = 380, 1193a702e49SBob Copeland CTRY_JAMAICA = 388, 1203a702e49SBob Copeland CTRY_JAPAN = 392, 1213a702e49SBob Copeland CTRY_JORDAN = 400, 1223a702e49SBob Copeland CTRY_KAZAKHSTAN = 398, 1233a702e49SBob Copeland CTRY_KENYA = 404, 1243a702e49SBob Copeland CTRY_KOREA_NORTH = 408, 1253a702e49SBob Copeland CTRY_KOREA_ROC = 410, 1263a702e49SBob Copeland CTRY_KOREA_ROC2 = 411, 1273a702e49SBob Copeland CTRY_KOREA_ROC3 = 412, 1283a702e49SBob Copeland CTRY_KUWAIT = 414, 1293a702e49SBob Copeland CTRY_LATVIA = 428, 1303a702e49SBob Copeland CTRY_LEBANON = 422, 1313a702e49SBob Copeland CTRY_LIBYA = 434, 1323a702e49SBob Copeland CTRY_LIECHTENSTEIN = 438, 1333a702e49SBob Copeland CTRY_LITHUANIA = 440, 1343a702e49SBob Copeland CTRY_LUXEMBOURG = 442, 1353a702e49SBob Copeland CTRY_MACAU = 446, 1363a702e49SBob Copeland CTRY_MACEDONIA = 807, 1373a702e49SBob Copeland CTRY_MALAYSIA = 458, 1383a702e49SBob Copeland CTRY_MALTA = 470, 1393a702e49SBob Copeland CTRY_MEXICO = 484, 1403a702e49SBob Copeland CTRY_MONACO = 492, 1413a702e49SBob Copeland CTRY_MOROCCO = 504, 1423a702e49SBob Copeland CTRY_NEPAL = 524, 1433a702e49SBob Copeland CTRY_NETHERLANDS = 528, 1443a702e49SBob Copeland CTRY_NETHERLANDS_ANTILLES = 530, 1453a702e49SBob Copeland CTRY_NEW_ZEALAND = 554, 1463a702e49SBob Copeland CTRY_NICARAGUA = 558, 1473a702e49SBob Copeland CTRY_NORWAY = 578, 1483a702e49SBob Copeland CTRY_OMAN = 512, 1493a702e49SBob Copeland CTRY_PAKISTAN = 586, 1503a702e49SBob Copeland CTRY_PANAMA = 591, 1513a702e49SBob Copeland CTRY_PAPUA_NEW_GUINEA = 598, 1523a702e49SBob Copeland CTRY_PARAGUAY = 600, 1533a702e49SBob Copeland CTRY_PERU = 604, 1543a702e49SBob Copeland CTRY_PHILIPPINES = 608, 1553a702e49SBob Copeland CTRY_POLAND = 616, 1563a702e49SBob Copeland CTRY_PORTUGAL = 620, 1573a702e49SBob Copeland CTRY_PUERTO_RICO = 630, 1583a702e49SBob Copeland CTRY_QATAR = 634, 1593a702e49SBob Copeland CTRY_ROMANIA = 642, 1603a702e49SBob Copeland CTRY_RUSSIA = 643, 1613a702e49SBob Copeland CTRY_SAUDI_ARABIA = 682, 1623a702e49SBob Copeland CTRY_SERBIA_MONTENEGRO = 891, 1633a702e49SBob Copeland CTRY_SINGAPORE = 702, 1643a702e49SBob Copeland CTRY_SLOVAKIA = 703, 1653a702e49SBob Copeland CTRY_SLOVENIA = 705, 1663a702e49SBob Copeland CTRY_SOUTH_AFRICA = 710, 1673a702e49SBob Copeland CTRY_SPAIN = 724, 1683a702e49SBob Copeland CTRY_SRI_LANKA = 144, 1693a702e49SBob Copeland CTRY_SWEDEN = 752, 1703a702e49SBob Copeland CTRY_SWITZERLAND = 756, 1713a702e49SBob Copeland CTRY_SYRIA = 760, 1723a702e49SBob Copeland CTRY_TAIWAN = 158, 1733a702e49SBob Copeland CTRY_THAILAND = 764, 1743a702e49SBob Copeland CTRY_TRINIDAD_Y_TOBAGO = 780, 1753a702e49SBob Copeland CTRY_TUNISIA = 788, 1763a702e49SBob Copeland CTRY_TURKEY = 792, 1773a702e49SBob Copeland CTRY_UAE = 784, 1783a702e49SBob Copeland CTRY_UKRAINE = 804, 1793a702e49SBob Copeland CTRY_UNITED_KINGDOM = 826, 1803a702e49SBob Copeland CTRY_UNITED_STATES = 840, 1813a702e49SBob Copeland CTRY_UNITED_STATES_FCC49 = 842, 1823a702e49SBob Copeland CTRY_URUGUAY = 858, 1833a702e49SBob Copeland CTRY_UZBEKISTAN = 860, 1843a702e49SBob Copeland CTRY_VENEZUELA = 862, 1853a702e49SBob Copeland CTRY_VIET_NAM = 704, 1863a702e49SBob Copeland CTRY_YEMEN = 887, 1873a702e49SBob Copeland CTRY_ZIMBABWE = 716, 1883a702e49SBob Copeland CTRY_JAPAN1 = 393, 1893a702e49SBob Copeland CTRY_JAPAN2 = 394, 1903a702e49SBob Copeland CTRY_JAPAN3 = 395, 1913a702e49SBob Copeland CTRY_JAPAN4 = 396, 1923a702e49SBob Copeland CTRY_JAPAN5 = 397, 1933a702e49SBob Copeland CTRY_JAPAN6 = 4006, 1943a702e49SBob Copeland CTRY_JAPAN7 = 4007, 1953a702e49SBob Copeland CTRY_JAPAN8 = 4008, 1963a702e49SBob Copeland CTRY_JAPAN9 = 4009, 1973a702e49SBob Copeland CTRY_JAPAN10 = 4010, 1983a702e49SBob Copeland CTRY_JAPAN11 = 4011, 1993a702e49SBob Copeland CTRY_JAPAN12 = 4012, 2003a702e49SBob Copeland CTRY_JAPAN13 = 4013, 2013a702e49SBob Copeland CTRY_JAPAN14 = 4014, 2023a702e49SBob Copeland CTRY_JAPAN15 = 4015, 2033a702e49SBob Copeland CTRY_JAPAN16 = 4016, 2043a702e49SBob Copeland CTRY_JAPAN17 = 4017, 2053a702e49SBob Copeland CTRY_JAPAN18 = 4018, 2063a702e49SBob Copeland CTRY_JAPAN19 = 4019, 2073a702e49SBob Copeland CTRY_JAPAN20 = 4020, 2083a702e49SBob Copeland CTRY_JAPAN21 = 4021, 2093a702e49SBob Copeland CTRY_JAPAN22 = 4022, 2103a702e49SBob Copeland CTRY_JAPAN23 = 4023, 2113a702e49SBob Copeland CTRY_JAPAN24 = 4024, 2123a702e49SBob Copeland CTRY_JAPAN25 = 4025, 2133a702e49SBob Copeland CTRY_JAPAN26 = 4026, 2143a702e49SBob Copeland CTRY_JAPAN27 = 4027, 2153a702e49SBob Copeland CTRY_JAPAN28 = 4028, 2163a702e49SBob Copeland CTRY_JAPAN29 = 4029, 2173a702e49SBob Copeland CTRY_JAPAN30 = 4030, 2183a702e49SBob Copeland CTRY_JAPAN31 = 4031, 2193a702e49SBob Copeland CTRY_JAPAN32 = 4032, 2203a702e49SBob Copeland CTRY_JAPAN33 = 4033, 2213a702e49SBob Copeland CTRY_JAPAN34 = 4034, 2223a702e49SBob Copeland CTRY_JAPAN35 = 4035, 2233a702e49SBob Copeland CTRY_JAPAN36 = 4036, 2243a702e49SBob Copeland CTRY_JAPAN37 = 4037, 2253a702e49SBob Copeland CTRY_JAPAN38 = 4038, 2263a702e49SBob Copeland CTRY_JAPAN39 = 4039, 2273a702e49SBob Copeland CTRY_JAPAN40 = 4040, 2283a702e49SBob Copeland CTRY_JAPAN41 = 4041, 2293a702e49SBob Copeland CTRY_JAPAN42 = 4042, 2303a702e49SBob Copeland CTRY_JAPAN43 = 4043, 2313a702e49SBob Copeland CTRY_JAPAN44 = 4044, 2323a702e49SBob Copeland CTRY_JAPAN45 = 4045, 2333a702e49SBob Copeland CTRY_JAPAN46 = 4046, 2343a702e49SBob Copeland CTRY_JAPAN47 = 4047, 2353a702e49SBob Copeland CTRY_JAPAN48 = 4048, 2363a702e49SBob Copeland CTRY_JAPAN49 = 4049, 2373a702e49SBob Copeland CTRY_JAPAN50 = 4050, 2383a702e49SBob Copeland CTRY_JAPAN51 = 4051, 2393a702e49SBob Copeland CTRY_JAPAN52 = 4052, 2403a702e49SBob Copeland CTRY_JAPAN53 = 4053, 2413a702e49SBob Copeland CTRY_JAPAN54 = 4054, 2423a702e49SBob Copeland CTRY_JAPAN55 = 4055, 2433a702e49SBob Copeland CTRY_JAPAN56 = 4056, 2443a702e49SBob Copeland CTRY_JAPAN57 = 4057, 2453a702e49SBob Copeland CTRY_JAPAN58 = 4058, 2463a702e49SBob Copeland CTRY_JAPAN59 = 4059, 2473a702e49SBob Copeland CTRY_AUSTRALIA2 = 5000, 2483a702e49SBob Copeland CTRY_CANADA2 = 5001, 2493a702e49SBob Copeland CTRY_BELGIUM2 = 5002 2503a702e49SBob Copeland }; 2513a702e49SBob Copeland 2523a702e49SBob Copeland bool ath_is_world_regd(struct ath_regulatory *reg); 2535719efddSBruno Randolf bool ath_is_49ghz_allowed(u16 redomain); 254e3bb249bSBob Copeland int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy, 2550c0280bdSLuis R. Rodriguez void (*reg_notifier)(struct wiphy *wiphy, 256e3bb249bSBob Copeland struct regulatory_request *request)); 2573a702e49SBob Copeland u32 ath_regd_get_band_ctl(struct ath_regulatory *reg, 2583a702e49SBob Copeland enum ieee80211_band band); 2590c0280bdSLuis R. Rodriguez void ath_reg_notifier_apply(struct wiphy *wiphy, 2603a702e49SBob Copeland struct regulatory_request *request, 2613a702e49SBob Copeland struct ath_regulatory *reg); 2623a702e49SBob Copeland 2633a702e49SBob Copeland #endif 264