When a channel is disabled there is no need to stuff it with more flags. Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx> --- net/wireless/reg.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index b7c6de1..499bbbe 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -867,7 +867,7 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, unsigned int chan_idx) { int r; - u32 flags; + u32 flags, rule_flags; u32 max_bandwidth = 0; const struct ieee80211_reg_rule *reg_rule = NULL; const struct ieee80211_power_rule *power_rule = NULL; @@ -913,15 +913,19 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, "Country IE\n", chan->center_freq, wiphy_name(wiphy)); #endif - flags |= IEEE80211_CHAN_DISABLED; - chan->flags = flags; + chan->flags = IEEE80211_CHAN_DISABLED; } return; } power_rule = ®_rule->power_rule; - chan->flags = flags | map_regdom_flags(reg_rule->flags); + rule_flags = map_regdom_flags(reg_rule->flags); + if (flags & IEEE80211_CHAN_DISABLED) + chan->flags = IEEE80211_CHAN_DISABLED; + else + chan->flags = flags | rule_flags; + chan->max_antenna_gain = min(chan->orig_mag, (int) MBI_TO_DBI(power_rule->max_antenna_gain)); chan->max_bandwidth = KHZ_TO_MHZ(max_bandwidth); -- 1.6.1.rc3.51.g5832d -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html