aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 448023193e55..1d57835d73f2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -336,19 +336,19 @@ struct ieee80211_regdomain {
336 struct ieee80211_reg_rule reg_rules[]; 336 struct ieee80211_reg_rule reg_rules[];
337}; 337};
338 338
339#define MHZ_TO_KHZ(freq) (freq * 1000) 339#define MHZ_TO_KHZ(freq) ((freq) * 1000)
340#define KHZ_TO_MHZ(freq) (freq / 1000) 340#define KHZ_TO_MHZ(freq) ((freq) / 1000)
341#define DBI_TO_MBI(gain) (gain * 100) 341#define DBI_TO_MBI(gain) ((gain) * 100)
342#define MBI_TO_DBI(gain) (gain / 100) 342#define MBI_TO_DBI(gain) ((gain) / 100)
343#define DBM_TO_MBM(gain) (gain * 100) 343#define DBM_TO_MBM(gain) ((gain) * 100)
344#define MBM_TO_DBM(gain) (gain / 100) 344#define MBM_TO_DBM(gain) ((gain) / 100)
345 345
346#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ 346#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
347 .freq_range.start_freq_khz = (start) * 1000, \ 347 .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \
348 .freq_range.end_freq_khz = (end) * 1000, \ 348 .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \
349 .freq_range.max_bandwidth_khz = (bw) * 1000, \ 349 .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \
350 .power_rule.max_antenna_gain = (gain) * 100, \ 350 .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \
351 .power_rule.max_eirp = (eirp) * 100, \ 351 .power_rule.max_eirp = DBM_TO_MBM(eirp), \
352 .flags = reg_flags, \ 352 .flags = reg_flags, \
353 } 353 }
354 354