Commit 58189a6a authored by Franco Fichtner's avatar Franco Fichtner

interfaces: optionally allow to set txpower

PR: https://forum.opnsense.org/index.php?topic=3462.0
(cherry picked from commit 3da906b6)
parent f1841369
......@@ -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 */
......
......@@ -2792,9 +2792,10 @@ include("head.inc");
<td><a id="help_for_txpower" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Transmit power"); ?></td>
<td>
<select name="txpower" class="selectpicker" data-size="10" data-style="btn-default" id="txpower">
<option value=""><?= gettext('default') ?></option>
<?php
for($x = 99; $x > 0; $x--):?>
<option value="<?=$x;?>" <?=$pconfig["txpower"] == $x ? "selected=\"selected\"" : "";?> ><?=$x;?></option>
<option value="<?=$x;?>" <?=$pconfig['txpower'] == $x ? 'selected="selected"' : '';?>><?=$x;?></option>
<?php
endfor;?>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment