Go to the documentation of this file. 1 #ifndef __NET_REGULATORY_H
2 #define __NET_REGULATORY_H
110 #define MHZ_TO_KHZ(freq) ((freq) * 1000)
111 #define KHZ_TO_MHZ(freq) ((freq) / 1000)
112 #define DBI_TO_MBI(gain) ((gain) * 100)
113 #define MBI_TO_DBI(gain) ((gain) / 100)
114 #define DBM_TO_MBM(gain) ((gain) * 100)
115 #define MBM_TO_DBM(gain) ((gain) / 100)
117 #define REG_RULE(start, end, bw, gain, eirp, reg_flags) \
119 .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \
120 .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \
121 .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \
122 .power_rule.max_antenna_gain = DBI_TO_MBI(gain),\
123 .power_rule.max_eirp = DBM_TO_MBM(eirp), \
124 .flags = reg_flags, \