summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-10-17 13:56:19 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-10-18 17:18:48 +0200
commitc4a9fafc77a5318f5ed26c509bbcddf03e18c201 (patch)
tree832d356c9d574e5fb678368b13ad521547184881 /net/wireless
parent3a40414f826a8f1096d9b94c4a53ef91b25ba28d (diff)
downloadblackbird-obmc-linux-c4a9fafc77a5318f5ed26c509bbcddf03e18c201.tar.gz
blackbird-obmc-linux-c4a9fafc77a5318f5ed26c509bbcddf03e18c201.zip
cfg80211: fix antenna gain handling
No driver initializes chan->max_antenna_gain to something sensible, and the only place where it is being used right now is inside ath9k. This leads to ath9k potentially using less tx power than it can use, which can decrease performance/range in some rare cases. Rather than going through every single driver, this patch initializes chan->orig_mag in wiphy_register(), ignoring whatever value the driver left in there. If a driver for some reason wishes to limit it independent from regulatory rulesets, it can do so internally. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 443d4d7deea2..3f7253052088 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -526,8 +526,7 @@ int wiphy_register(struct wiphy *wiphy)
for (i = 0; i < sband->n_channels; i++) {
sband->channels[i].orig_flags =
sband->channels[i].flags;
- sband->channels[i].orig_mag =
- sband->channels[i].max_antenna_gain;
+ sband->channels[i].orig_mag = INT_MAX;
sband->channels[i].orig_mpwr =
sband->channels[i].max_power;
sband->channels[i].band = band;
OpenPOWER on IntegriCloud