Skip to content

Commit

Permalink
cfg80211: fix initialization of chan->max_reg_power
Browse files Browse the repository at this point in the history
A few places touch chan->max_power based on updated tx power rules, but
forget to do the same to chan->max_reg_power.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Felix Fietkau authored and Johannes Berg committed Oct 18, 2012
1 parent c4a9faf commit 279f0f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ static void handle_channel(struct wiphy *wiphy,
map_regdom_flags(reg_rule->flags) | bw_flags;
chan->max_antenna_gain = chan->orig_mag =
(int) MBI_TO_DBI(power_rule->max_antenna_gain);
chan->max_power = chan->orig_mpwr =
chan->max_reg_power = chan->max_power = chan->orig_mpwr =
(int) MBM_TO_DBM(power_rule->max_eirp);
return;
}
Expand Down Expand Up @@ -1331,7 +1331,8 @@ static void handle_channel_custom(struct wiphy *wiphy,

chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags;
chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp);
chan->max_reg_power = chan->max_power =
(int) MBM_TO_DBM(power_rule->max_eirp);
}

static void handle_band_custom(struct wiphy *wiphy, enum ieee80211_band band,
Expand Down

0 comments on commit 279f0f5

Please sign in to comment.