|
@@ -1253,23 +1253,24 @@ static void dfs_apply_rules(struct wlan_dfs *dfs,
|
|
|
struct dfs_acs_info *acs_info)
|
|
|
{
|
|
|
struct dfs_channel *chan;
|
|
|
- uint16_t flag_no_weather = 0;
|
|
|
- uint16_t flag_no_lower_5g = 0;
|
|
|
- uint16_t flag_no_upper_5g = 0;
|
|
|
- uint16_t flag_no_dfs_chan = 0;
|
|
|
- uint16_t flag_no_2g_chan = 0;
|
|
|
- uint16_t flag_no_5g_chan = 0;
|
|
|
+ bool flag_no_weather = 0;
|
|
|
+ bool flag_no_lower_5g = 0;
|
|
|
+ bool flag_no_upper_5g = 0;
|
|
|
+ bool flag_no_dfs_chan = 0;
|
|
|
+ bool flag_no_2g_chan = 0;
|
|
|
+ bool flag_no_5g_chan = 0;
|
|
|
+ bool flag_no_japan_w53 = 0;
|
|
|
int i;
|
|
|
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, "flags %d", flags);
|
|
|
flag_no_weather = (dfs_region == DFS_ETSI_REGION_VAL) ?
|
|
|
flags & DFS_RANDOM_CH_FLAG_NO_WEATHER_CH : 0;
|
|
|
|
|
|
- flag_no_lower_5g = (dfs_region == DFS_MKK_REGION_VAL) ?
|
|
|
- flags & DFS_RANDOM_CH_FLAG_NO_LOWER_5G_CH : 0;
|
|
|
-
|
|
|
- flag_no_upper_5g = (dfs_region == DFS_MKK_REGION_VAL) ?
|
|
|
- flags & DFS_RANDOM_CH_FLAG_NO_UPEER_5G_CH : 0;
|
|
|
+ if (dfs_region == DFS_MKK_REGION_VAL) {
|
|
|
+ flag_no_lower_5g = flags & DFS_RANDOM_CH_FLAG_NO_LOWER_5G_CH;
|
|
|
+ flag_no_upper_5g = flags & DFS_RANDOM_CH_FLAG_NO_UPEER_5G_CH;
|
|
|
+ flag_no_japan_w53 = flags & DFS_RANDOM_CH_FLAG_NO_JAPAN_W53_CH;
|
|
|
+ }
|
|
|
|
|
|
flag_no_dfs_chan = flags & DFS_RANDOM_CH_FLAG_NO_DFS_CH;
|
|
|
flag_no_2g_chan = flags & DFS_RANDOM_CH_FLAG_NO_2GHZ_CH;
|
|
@@ -1281,8 +1282,7 @@ static void dfs_apply_rules(struct wlan_dfs *dfs,
|
|
|
if ((chan->dfs_ch_ieee == 0) ||
|
|
|
(chan->dfs_ch_ieee > MAX_CHANNEL_NUM)) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "invalid channel %d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "invalid channel %d", chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -1291,8 +1291,8 @@ static void dfs_apply_rules(struct wlan_dfs *dfs,
|
|
|
if (chan->dfs_ch_ieee ==
|
|
|
dfs->dfs_curchan->dfs_ch_ieee) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip %d current operating channel\n",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip %d current operating channel",
|
|
|
+ chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
@@ -1301,9 +1301,9 @@ static void dfs_apply_rules(struct wlan_dfs *dfs,
|
|
|
((chan->dfs_ch_ieee < acs_info->start_ch) ||
|
|
|
(chan->dfs_ch_ieee > acs_info->end_ch))) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip ch %d not in acs range (%d-%d)",
|
|
|
- chan->dfs_ch_ieee, acs_info->start_ch,
|
|
|
- acs_info->end_ch);
|
|
|
+ "skip ch %d not in acs range (%d-%d)",
|
|
|
+ chan->dfs_ch_ieee, acs_info->start_ch,
|
|
|
+ acs_info->end_ch);
|
|
|
continue;
|
|
|
|
|
|
}
|
|
@@ -1311,24 +1311,22 @@ static void dfs_apply_rules(struct wlan_dfs *dfs,
|
|
|
if (flag_no_2g_chan &&
|
|
|
chan->dfs_ch_ieee <= DFS_MAX_24GHZ_CHANNEL) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip 2.4 GHz channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip 2.4 GHz channel=%d", chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (flag_no_5g_chan &&
|
|
|
chan->dfs_ch_ieee > DFS_MAX_24GHZ_CHANNEL) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip 5 GHz channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip 5 GHz channel=%d", chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (flag_no_weather) {
|
|
|
if (DFS_IS_CHANNEL_WEATHER_RADAR(chan->dfs_ch_freq)) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip weather channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip weather channel=%d",
|
|
|
+ chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
@@ -1336,31 +1334,35 @@ static void dfs_apply_rules(struct wlan_dfs *dfs,
|
|
|
if (flag_no_lower_5g &&
|
|
|
DFS_IS_CHAN_JAPAN_INDOOR(chan->dfs_ch_ieee)) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip indoor channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip indoor channel=%d", chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (flag_no_upper_5g &&
|
|
|
DFS_IS_CHAN_JAPAN_OUTDOOR(chan->dfs_ch_ieee)) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip outdoor channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip outdoor channel=%d", chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (flag_no_dfs_chan &&
|
|
|
(chan->dfs_ch_flagext & WLAN_CHAN_DFS)) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip dfs channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip dfs channel=%d", chan->dfs_ch_ieee);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (flag_no_japan_w53 &&
|
|
|
+ DFS_IS_CHAN_JAPAN_W53(chan->dfs_ch_ieee)) {
|
|
|
+ dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
+ "skip japan W53 channel=%d",
|
|
|
+ chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (dfs_freq_is_in_nol(dfs, chan->dfs_ch_freq)) {
|
|
|
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
|
|
|
- "skip nol channel=%d",
|
|
|
- chan->dfs_ch_ieee);
|
|
|
+ "skip nol channel=%d", chan->dfs_ch_ieee);
|
|
|
continue;
|
|
|
}
|
|
|
|