|
@@ -748,21 +748,6 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
-static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range,
|
|
|
|
- u32 center_freq_khz, u32 bw_khz)
|
|
|
|
-{
|
|
|
|
- u32 start_freq_khz, end_freq_khz;
|
|
|
|
-
|
|
|
|
- start_freq_khz = center_freq_khz - (bw_khz/2);
|
|
|
|
- end_freq_khz = center_freq_khz + (bw_khz/2);
|
|
|
|
-
|
|
|
|
- if (start_freq_khz >= freq_range->start_freq_khz &&
|
|
|
|
- end_freq_khz <= freq_range->end_freq_khz)
|
|
|
|
- return true;
|
|
|
|
-
|
|
|
|
- return false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* freq_in_rule_band - tells us if a frequency is in a frequency band
|
|
* freq_in_rule_band - tells us if a frequency is in a frequency band
|
|
* @freq_range: frequency rule we want to query
|
|
* @freq_range: frequency rule we want to query
|
|
@@ -1070,7 +1055,7 @@ freq_reg_info_regd(u32 center_freq,
|
|
if (!band_rule_found)
|
|
if (!band_rule_found)
|
|
band_rule_found = freq_in_rule_band(fr, center_freq);
|
|
band_rule_found = freq_in_rule_band(fr, center_freq);
|
|
|
|
|
|
- bw_fits = reg_does_bw_fit(fr, center_freq, bw);
|
|
|
|
|
|
+ bw_fits = cfg80211_does_bw_fit_range(fr, center_freq, bw);
|
|
|
|
|
|
if (band_rule_found && bw_fits)
|
|
if (band_rule_found && bw_fits)
|
|
return rr;
|
|
return rr;
|
|
@@ -1138,11 +1123,13 @@ static uint32_t reg_rule_to_chan_bw_flags(const struct ieee80211_regdomain *regd
|
|
max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule);
|
|
max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule);
|
|
|
|
|
|
/* If we get a reg_rule we can assume that at least 5Mhz fit */
|
|
/* If we get a reg_rule we can assume that at least 5Mhz fit */
|
|
- if (!reg_does_bw_fit(freq_range, MHZ_TO_KHZ(chan->center_freq),
|
|
|
|
- MHZ_TO_KHZ(10)))
|
|
|
|
|
|
+ if (!cfg80211_does_bw_fit_range(freq_range,
|
|
|
|
+ MHZ_TO_KHZ(chan->center_freq),
|
|
|
|
+ MHZ_TO_KHZ(10)))
|
|
bw_flags |= IEEE80211_CHAN_NO_10MHZ;
|
|
bw_flags |= IEEE80211_CHAN_NO_10MHZ;
|
|
- if (!reg_does_bw_fit(freq_range, MHZ_TO_KHZ(chan->center_freq),
|
|
|
|
- MHZ_TO_KHZ(20)))
|
|
|
|
|
|
+ if (!cfg80211_does_bw_fit_range(freq_range,
|
|
|
|
+ MHZ_TO_KHZ(chan->center_freq),
|
|
|
|
+ MHZ_TO_KHZ(20)))
|
|
bw_flags |= IEEE80211_CHAN_NO_20MHZ;
|
|
bw_flags |= IEEE80211_CHAN_NO_20MHZ;
|
|
|
|
|
|
if (max_bandwidth_khz < MHZ_TO_KHZ(10))
|
|
if (max_bandwidth_khz < MHZ_TO_KHZ(10))
|