summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-24 18:53:36 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-24 18:53:36 +0000
commit50cb1fb0c2e7701c5175d5911cc524b3ee4c5d44 (patch)
treef59ee10ef8004c3ef1f4cc47af0f45a74d7b9973
parent58d797bf4da13ac9cf95dae524a447474af89ff1 (diff)
downloadpfsense-50cb1fb0c2e7701c5175d5911cc524b3ee4c5d44.zip
pfsense-50cb1fb0c2e7701c5175d5911cc524b3ee4c5d44.tar.gz
Add transmit power settings
Ticket #246
-rw-r--r--etc/inc/interfaces.inc5
-rwxr-xr-xusr/local/www/interfaces_wlan.inc24
2 files changed, 27 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 4945da5..634c4e3 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -416,7 +416,10 @@ function interfaces_wireless_configure($if, $wlcfg) {
$fd = fopen("{$g['tmp_path']}/ifconfig_wireless", "w");
fwrite($fd, "/sbin/ifconfig {$ifcargs}");
fclose($fd);
-
+
+ if($wlcfg['txpower'] <> "")
+ mwexec("/sbin/ifconfig {$ifcargs} txpower {$wlcfg['txpower']}");
+
return 0;
}
diff --git a/usr/local/www/interfaces_wlan.inc b/usr/local/www/interfaces_wlan.inc
index d042e20..f6d4e6a 100755
--- a/usr/local/www/interfaces_wlan.inc
+++ b/usr/local/www/interfaces_wlan.inc
@@ -39,6 +39,7 @@ function wireless_config_init() {
$pconfig['ssid'] = $optcfg['wireless']['ssid'];
$pconfig['stationname'] = $optcfg['wireless']['stationname'];
$pconfig['channel'] = $optcfg['wireless']['channel'];
+ $pconfig['txpower'] = $optcfg['wireless']['txpower'];
$pconfig['wep_enable'] = isset($optcfg['wireless']['wep']['enable']);
if (is_array($optcfg['wireless']['wep']['key'])) {
@@ -79,6 +80,7 @@ function wireless_config_post() {
$optcfg['wireless']['ssid'] = $_POST['ssid'];
$optcfg['wireless']['stationname'] = $_POST['stationname'];
$optcfg['wireless']['channel'] = $_POST['channel'];
+ $optcfg['wireless']['txpower'] = $_POST['txpower'];
$optcfg['wireless']['wep']['enable'] = $_POST['wep_enable'] ? true : false;
$optcfg['wireless']['wep']['key'] = array();
@@ -107,7 +109,7 @@ function wireless_config_print() {
</tr>
<?php if (stristr($optcfg['if'], "ath") == true): ?>
- <tr>
+ <tr>
<td valign="top" class="vncellreq">Standard</td>
<td class="vtable"><select name="standard" class="formfld" id="standard">
<?php
@@ -145,6 +147,26 @@ function wireless_config_print() {
<td class="vtable"><?=$mandfldhtml;?><input name="ssid" type="text" class="formfld" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']);?>">
</td>
</tr>
+
+ <tr>
+ <td valign="top" class="vncellreq">Transmit power</td>
+ <td class="vtable">
+ <select name="txpower">
+ <?php
+ for($x=100; $x<1; $x--) {
+ if($pconfig["txpower"] == $x)
+ $SELECTED = " SELECTED";
+ else
+ $SELECTED = "";
+ if($x == $pconfig["txpower"]) {
+ echo "<option {$SELECTED}>{$x}</option>";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+
<tr>
<td valign="top" class="vncellreq">Channel</td>
<td class="vtable"><select name="channel" class="formfld" id="channel">
OpenPOWER on IntegriCloud