Date: Mon, 29 Aug 2005 10:08:09 -0700 From: Sam Leffler <sam@errno.com> To: dandee@volny.cz Cc: freebsd-current@freebsd.org, 'Milan Obuch' <current@dino.sk> Subject: Re: ATHCTRL for ATH Message-ID: <431340F9.4060407@errno.com> In-Reply-To: <20050824151056.40CCB4E704@pipa.profix.cz> References: <20050824151056.40CCB4E704@pipa.profix.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------060006050908010801070704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit [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 --------------060006050908010801070704 Content-Type: text/plain; name="athctrl.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="athctrl.sh" #! /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 --------------060006050908010801070704--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?431340F9.4060407>