From 3da906b62436360561c241a9502eee61db40e98a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Aug 2016 08:39:21 +0200 Subject: [PATCH] interfaces: optionally allow to set txpower PR: https://forum.opnsense.org/index.php?topic=3462.0 --- src/etc/inc/interfaces.inc | 8 ++++---- src/www/interfaces.php | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index bc4f7422b..17705a18d 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -2293,10 +2293,6 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) $wlcmd[] = "-mediaopt turbo"; } - /* handle txpower setting */ - /* if($wlcfg['txpower'] <> "") - $wlcmd[] = "txpower " . escapeshellarg($wlcfg['txpower']); - */ /* handle wme option */ if (isset($wlcfg['wme']['enable'])) { $wlcmd[] = "wme"; @@ -2579,6 +2575,10 @@ EOD; mwexec("/sbin/ifconfig " . escapeshellarg($if) . " " . $wlcmd_args, false); unset($wlcmd_args, $wlcmd); + /* configure txpower setting (it has been known to fail so run it separately) */ + if (!empty($wlcfg['txpower'])) { + mwexecf('/sbin/ifconfig %s txpower %s', array($if, $wlcfg['txpower'])); + } sleep(1); /* execute hostapd and wpa_supplicant if required in shell */ diff --git a/src/www/interfaces.php b/src/www/interfaces.php index 99e5c73f4..414557a5a 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -2792,9 +2792,10 @@ include("head.inc");