ATHCTRL for ATH
Sam Leffler
sam at errno.com
Mon Aug 29 17:02:05 GMT 2005
[coming in late here...]
athctrl is a trivial program that should be a shell script at best. It
currently makes no sense to add this sort of support to ifconfig because
each device does things very differently (if at all) and trying to unify
the operation is likely to lead to more confusion than anything else.
Attached is an untested shell script I wrote for someone else. If you
can tell me it does the right thing for you then I'll commit it to
tools/tools/ath where I've stuck other similar things.
Sam
-------------- next part --------------
#! /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.
#
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
More information about the freebsd-current
mailing list