Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
regd.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2009 Atheros Communications Inc.
3  *
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.
7  *
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.
15  */
16 
17 #ifndef REGD_H
18 #define REGD_H
19 
20 #include <linux/nl80211.h>
21 #include <net/cfg80211.h>
22 
23 #include "ath.h"
24 
25 enum ctl_group {
26  CTL_FCC = 0x10,
27  CTL_MKK = 0x40,
28  CTL_ETSI = 0x30,
29 };
30 
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
41 
42 #define CTRY_DEBUG 0x1ff
43 #define CTRY_DEFAULT 0
44 
45 #define COUNTRY_ERD_FLAG 0x8000
46 #define WORLDWIDE_ROAMING_FLAG 0x4000
47 
48 #define MULTI_DOMAIN_MASK 0xFF00
49 
50 #define WORLD_SKU_MASK 0x00F0
51 #define WORLD_SKU_PREFIX 0x0060
52 
53 #define CHANNEL_HALF_BW 10
54 #define CHANNEL_QUARTER_BW 5
55 
59  const char *isoName;
60 };
61 
67  CTRY_ARUBA = 533,
74  CTRY_BELARUS = 112,
83  CTRY_CANADA = 124,
84  CTRY_CHILE = 152,
85  CTRY_CHINA = 156,
88  CTRY_CROATIA = 191,
89  CTRY_CYPRUS = 196,
90  CTRY_CZECH = 203,
91  CTRY_DENMARK = 208,
93  CTRY_ECUADOR = 218,
94  CTRY_EGYPT = 818,
96  CTRY_ESTONIA = 233,
98  CTRY_FINLAND = 246,
99  CTRY_FRANCE = 250,
102  CTRY_GREECE = 300,
105  CTRY_GUAM = 316,
107  CTRY_HAITI = 332,
112  CTRY_INDIA = 356,
114  CTRY_IRAN = 364,
115  CTRY_IRAQ = 368,
117  CTRY_ISRAEL = 376,
118  CTRY_ITALY = 380,
120  CTRY_JAPAN = 392,
121  CTRY_JORDAN = 400,
123  CTRY_KENYA = 404,
128  CTRY_KUWAIT = 414,
129  CTRY_LATVIA = 428,
131  CTRY_LIBYA = 434,
135  CTRY_MACAU = 446,
138  CTRY_MALTA = 470,
139  CTRY_MEXICO = 484,
140  CTRY_MONACO = 492,
142  CTRY_NEPAL = 524,
147  CTRY_NORWAY = 578,
148  CTRY_OMAN = 512,
150  CTRY_PANAMA = 591,
153  CTRY_PERU = 604,
155  CTRY_POLAND = 616,
158  CTRY_QATAR = 634,
160  CTRY_RUSSIA = 643,
167  CTRY_SPAIN = 724,
169  CTRY_SWEDEN = 752,
171  CTRY_SYRIA = 760,
172  CTRY_TAIWAN = 158,
176  CTRY_TURKEY = 792,
177  CTRY_UAE = 784,
186  CTRY_YEMEN = 887,
188  CTRY_JAPAN1 = 393,
189  CTRY_JAPAN2 = 394,
190  CTRY_JAPAN3 = 395,
191  CTRY_JAPAN4 = 396,
192  CTRY_JAPAN5 = 397,
193  CTRY_JAPAN6 = 4006,
194  CTRY_JAPAN7 = 4007,
195  CTRY_JAPAN8 = 4008,
196  CTRY_JAPAN9 = 4009,
197  CTRY_JAPAN10 = 4010,
198  CTRY_JAPAN11 = 4011,
199  CTRY_JAPAN12 = 4012,
200  CTRY_JAPAN13 = 4013,
201  CTRY_JAPAN14 = 4014,
202  CTRY_JAPAN15 = 4015,
203  CTRY_JAPAN16 = 4016,
204  CTRY_JAPAN17 = 4017,
205  CTRY_JAPAN18 = 4018,
206  CTRY_JAPAN19 = 4019,
207  CTRY_JAPAN20 = 4020,
208  CTRY_JAPAN21 = 4021,
209  CTRY_JAPAN22 = 4022,
210  CTRY_JAPAN23 = 4023,
211  CTRY_JAPAN24 = 4024,
212  CTRY_JAPAN25 = 4025,
213  CTRY_JAPAN26 = 4026,
214  CTRY_JAPAN27 = 4027,
215  CTRY_JAPAN28 = 4028,
216  CTRY_JAPAN29 = 4029,
217  CTRY_JAPAN30 = 4030,
218  CTRY_JAPAN31 = 4031,
219  CTRY_JAPAN32 = 4032,
220  CTRY_JAPAN33 = 4033,
221  CTRY_JAPAN34 = 4034,
222  CTRY_JAPAN35 = 4035,
223  CTRY_JAPAN36 = 4036,
224  CTRY_JAPAN37 = 4037,
225  CTRY_JAPAN38 = 4038,
226  CTRY_JAPAN39 = 4039,
227  CTRY_JAPAN40 = 4040,
228  CTRY_JAPAN41 = 4041,
229  CTRY_JAPAN42 = 4042,
230  CTRY_JAPAN43 = 4043,
231  CTRY_JAPAN44 = 4044,
232  CTRY_JAPAN45 = 4045,
233  CTRY_JAPAN46 = 4046,
234  CTRY_JAPAN47 = 4047,
235  CTRY_JAPAN48 = 4048,
236  CTRY_JAPAN49 = 4049,
237  CTRY_JAPAN50 = 4050,
238  CTRY_JAPAN51 = 4051,
239  CTRY_JAPAN52 = 4052,
240  CTRY_JAPAN53 = 4053,
241  CTRY_JAPAN54 = 4054,
242  CTRY_JAPAN55 = 4055,
243  CTRY_JAPAN56 = 4056,
244  CTRY_JAPAN57 = 4057,
245  CTRY_JAPAN58 = 4058,
246  CTRY_JAPAN59 = 4059,
248  CTRY_CANADA2 = 5001,
250 };
251 
252 bool ath_is_world_regd(struct ath_regulatory *reg);
253 bool ath_is_49ghz_allowed(u16 redomain);
254 int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
255  int (*reg_notifier)(struct wiphy *wiphy,
256  struct regulatory_request *request));
258  enum ieee80211_band band);
259 int ath_reg_notifier_apply(struct wiphy *wiphy,
260  struct regulatory_request *request,
261  struct ath_regulatory *reg);
262 
263 #endif