提交 c4a9fafc 编写于 作者: F Felix Fietkau 提交者: Johannes Berg

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: NFelix Fietkau <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 3a40414f
...@@ -526,8 +526,7 @@ int wiphy_register(struct wiphy *wiphy) ...@@ -526,8 +526,7 @@ int wiphy_register(struct wiphy *wiphy)
for (i = 0; i < sband->n_channels; i++) { for (i = 0; i < sband->n_channels; i++) {
sband->channels[i].orig_flags = sband->channels[i].orig_flags =
sband->channels[i].flags; sband->channels[i].flags;
sband->channels[i].orig_mag = sband->channels[i].orig_mag = INT_MAX;
sband->channels[i].max_antenna_gain;
sband->channels[i].orig_mpwr = sband->channels[i].orig_mpwr =
sband->channels[i].max_power; sband->channels[i].max_power;
sband->channels[i].band = band; sband->channels[i].band = band;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册