From e549afa190be1815b3de940305b39660315bdfa7 Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Sun, 4 May 2014 14:28:03 -0700 Subject: [PATCH] Only subtract poweroffset when the value given by iwinfo has an offset applied --- files/www/cgi-bin/setup | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index b220c607..6138c3c6 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -95,7 +95,10 @@ $parms{dmz_dhcp_limit} = $dmz_dhcp_limit = $dmz_dhcp_end - $dmz_dhcp_start; unless($parms{reload}) { ($wifi_txpower) = `iwinfo wlan0 info 2>/dev/null` =~ /Tx-Power: (\d+)/; - $wifi_txpower -= wifi_txpoweroffset(); + (my $iwoffset) = `iwinfo wlan0 info 2>/dev/null` =~ /TX power offset: (\d+)/; + if ( $iwoffset ) { + $wifi_txpower -= $iwoffset; + } if (wifi_useschains()){ $wifi_txant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask`; $wifi_rxant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask`;