Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2 3.7 1/2] cfg80211: fix antenna gain handling
@ 2012-10-06 12:40 Felix Fietkau
  2012-10-06 12:40 ` [PATCH v2 3.7 2/2] cfg80211: fix initialization of chan->max_reg_power Felix Fietkau
  2012-10-08 18:37 ` [PATCH v2 3.7 1/2] cfg80211: fix antenna gain handling Luis R. Rodriguez
  0 siblings, 2 replies; 10+ messages in thread
From: Felix Fietkau @ 2012-10-06 12:40 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, mcgrof, johannes, arend

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.

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
---
 net/wireless/core.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 443d4d7..3f72530 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;
-- 
1.7.9.6 (Apple Git-31.1)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-09 18:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-06 12:40 [PATCH v2 3.7 1/2] cfg80211: fix antenna gain handling Felix Fietkau
2012-10-06 12:40 ` [PATCH v2 3.7 2/2] cfg80211: fix initialization of chan->max_reg_power Felix Fietkau
2012-10-08 19:01   ` Luis R. Rodriguez
2012-10-08 21:01     ` Felix Fietkau
2012-10-09  0:12       ` Luis R. Rodriguez
2012-10-08 18:37 ` [PATCH v2 3.7 1/2] cfg80211: fix antenna gain handling Luis R. Rodriguez
2012-10-08 20:52   ` Felix Fietkau
2012-10-09  1:00     ` Luis R. Rodriguez
2012-10-09  9:49       ` Felix Fietkau
2012-10-09 18:43         ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox