Fix wifi being disabled after applying setting on non-chain devices

fixes BBHN->ticket:39
This commit is contained in:
Conrad Lara - KG6JEI 2014-04-18 08:30:50 -07:00
parent e36a2ffbf9
commit a93d48e849
1 changed files with 4 additions and 3 deletions

View File

@ -134,15 +134,16 @@ $parms{wifi_rxant} = $wifi_rxant;
if($parms{button_apply} or $parms{button_save})
{
$cmd = "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;";
$cmd = "";
if(wifi_useschains()){
$cmd .= "echo $wifi_rxant > /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask;";
$cmd .= "echo $wifi_txant > /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask;";
} else {
$cmd .= "ifconfig wlan0 down >/dev/null 2>&1;";
$cmd .= "ifdown wifi >/dev/null 2>&1;";
$cmd .= "iw phy phy0 set antenna $wifi_txantenna $wifi_rxantenna >/dev/null 2>&1;";
$cmd .= "ifconfig wlan0 up >/dev/null 2>&1;";
$cmd .= "ifup wifi >/dev/null 2>&1;";
}
$cmd .= "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;";
$cmd .= "iwconfig wlan0 txpower $wifi_txpower >/dev/null 2>&1;";
system $cmd;
}