Commit c8b9eefb authored by Franco Fichtner's avatar Franco Fichtner

wireless: remove ancient ath(4) long distance helpers

The original script is from 2005 and most newer ath(4) drivers do not
even support it.  One can still set the sysctls individually anyway,
it's highly likely you know the hardware when you're trying to set
this up in the first place...

See also: https://wiki.freebsd.org/dev/ath(4)
parent f05b35d9
......@@ -2243,7 +2243,7 @@ function interface_sync_wireless_clones(&$ifcfg, $sync_changes = false)
global $config;
$shared_settings = array('standard', 'turbo', 'protmode', 'txpower', 'channel',
'diversity', 'txantenna', 'rxantenna', 'distance',
'diversity', 'txantenna', 'rxantenna',
'regdomain', 'regcountry', 'reglocation');
if (!is_interface_wireless($ifcfg['if'])) {
......@@ -2393,11 +2393,6 @@ function interface_wireless_configure($if, &$wl, &$wlcfg)
$wl_sysctl[] = "rxantenna=" . escapeshellarg($wlcfg['rxantenna']);
}
/* set Distance value */
if ($wlcfg['distance']) {
$distance = escapeshellarg($wlcfg['distance']);
}
/* Set wireless hostap mode */
if ($wlcfg['mode'] == "hostap") {
$wlcmd[] = "mediaopt hostap";
......@@ -2607,12 +2602,6 @@ EOD;
}
}
/* set ack timers according to users preference (if he/she has any) */
if ($distance) {
fwrite($fd_set, "# Enable ATH distance settings\n");
fwrite($fd_set, "/usr/local/sbin/athctrl -i {$baseif} -d {$distance}\n");
}
if (isset($wlcfg['wpa']['enable'])) {
if ($wlcfg['mode'] == "bss") {
fwrite($fd_set, "{$wpa_supplicant} -B -i {$if} -c /var/etc/wpa_supplicant_{$if}.conf\n");
......
#! /bin/sh
#
# Set the IFS parameters for an interface configured for
# point-to-point use at a specific distance. Based on a
# program by Gunter Burchardt.
#
# $FreeBSD$
#
DEV=ath0
d=0
usage()
{
echo "Usage: $0 [-i athX] [-d meters]"
exit 2
}
args=`getopt d:i: $*`
test $? -ne 0 && usage
set -- $args
for i; do
case "$i" in
-i) DEV="$2"; shift; shift;;
-d) d="$2"; shift; shift;;
--) shift; break;
esac
done
test $d -eq 0 && usage
slottime=`expr 9 + \( $d / 300 \)`
if expr \( $d % 300 \) != 0 >/dev/null 2>&1; then
slottime=`expr $slottime + 1`
fi
timeout=`expr $slottime \* 2 + 3`
printf "Setup IFS parameters on interface ${DEV} for %i meter p-2-p link\n" $d
ATHN=`echo $DEV | sed 's/ath//'`
sysctl dev.ath.$ATHN.slottime=$slottime
sysctl dev.ath.$ATHN.acktimeout=$timeout
sysctl dev.ath.$ATHN.ctstimeout=$timeout
......@@ -460,7 +460,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$wlanbaseif = interface_get_wireless_base($a_interfaces[$if]['if']);
$std_wl_copy_fieldnames = array(
'standard', 'mode','protmode', 'ssid', 'channel', 'txpower', 'diversity', 'txantenna', 'rxantenna', 'distance',
'standard', 'mode','protmode', 'ssid', 'channel', 'txpower', 'diversity', 'txantenna', 'rxantenna',
'regdomain', 'regcountry', 'reglocation', 'authmode', 'auth_server_addr', 'auth_server_port', 'auth_server_shared_secret',
'auth_server_addr2', 'auth_server_port2', 'auth_server_shared_secret2', 'mac_acl'
);
......@@ -1154,7 +1154,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$new_config['wireless']['channel'] = $pconfig['channel'];
$new_config['wireless']['authmode'] = $pconfig['authmode'];
$new_config['wireless']['txpower'] = $pconfig['txpower'];
$new_config['wireless']['distance'] = $pconfig['distance'];
$new_config['wireless']['regdomain'] = $pconfig['regdomain'];
$new_config['wireless']['regcountry'] = $pconfig['regcountry'];
$new_config['wireless']['reglocation'] = $pconfig['reglocation'];
......@@ -1310,8 +1309,7 @@ if (isset($a_interfaces[$if]['wireless'])) {
$wlanbaseif = interface_get_wireless_base($a_interfaces[$if]['if']);
preg_match("/^(.*?)([0-9]*)$/", $wlanbaseif, $wlanbaseif_split);
$wl_sysctl_prefix = 'dev.' . $wlanbaseif_split[1] . '.' . $wlanbaseif_split[2];
$wl_sysctl = get_sysctl(array("{$wl_sysctl_prefix}.diversity", "{$wl_sysctl_prefix}.txantenna", "{$wl_sysctl_prefix}.rxantenna",
"{$wl_sysctl_prefix}.slottime", "{$wl_sysctl_prefix}.acktimeout", "{$wl_sysctl_prefix}.ctstimeout"));
$wl_sysctl = get_sysctl(array("{$wl_sysctl_prefix}.diversity", "{$wl_sysctl_prefix}.txantenna", "{$wl_sysctl_prefix}.rxantenna"));
$wl_regdomain_xml_attr = array();
$wl_regdomain_xml = parse_xml_regdomain($wl_regdomain_xml_attr);
$wl_regdomains = &$wl_regdomain_xml['regulatory-domains']['rd'];
......@@ -2977,19 +2975,6 @@ include("head.inc");
</div>
</td>
</tr>
<?php
endif;
if (isset($wl_sysctl["{$wl_sysctl_prefix}.slottime"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.acktimeout"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.ctstimeout"])): ?>
<tr>
<td><a id="help_for_distance" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Distance setting"); ?></td>
<td>
<input name="distance" type="text" id="distance" size="5" value="<?=$pconfig['distance'];?>" />
<div class="hidden" for="help_for_distance">
<?=gettext("Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client"); ?><br />
<?=gettext("(measured in Meters and works only for Atheros based cards !)"); ?>
</div>
</td>
</tr>
<?php
endif; ?>
<tr>
......
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