Search Linux Wireless

[PATCH] cfg80211: default to regulatory max power for channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the driver does not specify a maximum power output, default to the
regulatory max.

Signed-off-by: John W. Linville <linville@xxxxxxxxxxxxx>
---
Is this a worth alternative to Larry's b43legacy patch?  It looked like
ath5k wasn't setting max_power either -- how does it work?

 net/wireless/reg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 8cc6037..185488d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -136,7 +136,10 @@ static void handle_channel(struct ieee80211_channel *chan,
 	chan->flags = flags;
 	chan->max_antenna_gain = min(chan->orig_mag,
 					 rg->max_antenna_gain);
-	chan->max_power = min(chan->orig_mpwr, rg->max_power);
+	if (chan->orig_mpwr)
+		chan->max_power = min(chan->orig_mpwr, rg->max_power);
+	else
+		chan->max_power = rg->max_power;
 }
 
 static void handle_band(struct ieee80211_supported_band *sband,
-- 
1.5.3.3

--
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

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux