Search Linux Wireless

[PATCH 07/31] wl1271: fix tx power setting function

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

 



The wl1271 firmware supports maximun 25.5dBm, so the driver was returning
-EINVALID to anything above that.  The new mac80211 stack uses 27dBm as
default TX power, so we were never setting this correctly.

Signed-off-by: Luciano Coelho <luciano.coelho@xxxxxxxxx>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@xxxxxxxxx>
---
 drivers/net/wireless/wl12xx/wl1271_acx.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index 5cc89bb..59bb95b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -127,8 +127,14 @@ int wl1271_acx_tx_power(struct wl1271 *wl, int power)
 
 	wl1271_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr");
 
-	if (power < 0 || power > 25)
+	if (power < 0)
 		return -EINVAL;
+	else if (power > 25)
+		/*
+		 * The power is a uint8 in the firmware, so we can't have
+		 * anything higher than 25 (this value is multiplied by 10)
+		 */
+		power = 25;
 
 	acx = kzalloc(sizeof(*acx), GFP_KERNEL);
 	if (!acx) {
-- 
1.6.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