aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0a72d1e3d3ab..9f40c4d417d7 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -287,6 +287,66 @@ struct bss_parameters {
287 int use_short_slot_time; 287 int use_short_slot_time;
288}; 288};
289 289
290/**
291 * enum reg_set_by - Indicates who is trying to set the regulatory domain
292 * @REGDOM_SET_BY_INIT: regulatory domain was set by initialization. We will be
293 * using a static world regulatory domain by default.
294 * @REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world regulatory domain.
295 * @REGDOM_SET_BY_USER: User asked the wireless core to set the
296 * regulatory domain.
297 * @REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the wireless core
298 * it thinks its knows the regulatory domain we should be in.
299 * @REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an 802.11 country
300 * information element with regulatory information it thinks we
301 * should consider.
302 */
303enum reg_set_by {
304 REGDOM_SET_BY_INIT,
305 REGDOM_SET_BY_CORE,
306 REGDOM_SET_BY_USER,
307 REGDOM_SET_BY_DRIVER,
308 REGDOM_SET_BY_COUNTRY_IE,
309};
310
311struct ieee80211_freq_range {
312 u32 start_freq_khz;
313 u32 end_freq_khz;
314 u32 max_bandwidth_khz;
315};
316
317struct ieee80211_power_rule {
318 u32 max_antenna_gain;
319 u32 max_eirp;
320};
321
322struct ieee80211_reg_rule {
323 struct ieee80211_freq_range freq_range;
324 struct ieee80211_power_rule power_rule;
325 u32 flags;
326};
327
328struct ieee80211_regdomain {
329 u32 n_reg_rules;
330 char alpha2[2];
331 struct ieee80211_reg_rule reg_rules[];
332};
333
334#define MHZ_TO_KHZ(freq) (freq * 1000)
335#define KHZ_TO_MHZ(freq) (freq / 1000)
336#define DBI_TO_MBI(gain) (gain * 100)
337#define MBI_TO_DBI(gain) (gain / 100)
338#define DBM_TO_MBM(gain) (gain * 100)
339#define MBM_TO_DBM(gain) (gain / 100)
340
341#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
342 .freq_range.start_freq_khz = (start) * 1000, \
343 .freq_range.end_freq_khz = (end) * 1000, \
344 .freq_range.max_bandwidth_khz = (bw) * 1000, \
345 .power_rule.max_antenna_gain = (gain) * 100, \
346 .power_rule.max_eirp = (eirp) * 100, \
347 .flags = reg_flags, \
348 }
349
290/* from net/wireless.h */ 350/* from net/wireless.h */
291struct wiphy; 351struct wiphy;
292 352