Only subtract poweroffset when the value given by iwinfo has an offset applied

This commit is contained in:
Conrad Lara - KG6JEI 2014-05-04 14:28:03 -07:00
parent 207c0f738f
commit e549afa190
1 changed files with 4 additions and 1 deletions

View File

@ -95,7 +95,10 @@ $parms{dmz_dhcp_limit} = $dmz_dhcp_limit = $dmz_dhcp_end - $dmz_dhcp_start;
unless($parms{reload}) unless($parms{reload})
{ {
($wifi_txpower) = `iwinfo wlan0 info 2>/dev/null` =~ /Tx-Power: (\d+)/; ($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()){ if (wifi_useschains()){
$wifi_txant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask`; $wifi_txant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask`;
$wifi_rxant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask`; $wifi_rxant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask`;