From owner-freebsd-current@FreeBSD.ORG Mon Aug 29 17:02:05 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 908F216A41F for ; Mon, 29 Aug 2005 17:02:05 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B9F943D48 for ; Mon, 29 Aug 2005 17:02:05 +0000 (GMT) (envelope-from sam@errno.com) Received: from [66.127.85.91] ([66.127.85.91]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id j7TH1HBd070243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Aug 2005 10:01:19 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <431340F9.4060407@errno.com> Date: Mon, 29 Aug 2005 10:08:09 -0700 From: Sam Leffler User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050327) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dandee@volny.cz References: <20050824151056.40CCB4E704@pipa.profix.cz> In-Reply-To: <20050824151056.40CCB4E704@pipa.profix.cz> Content-Type: multipart/mixed; boundary="------------060006050908010801070704" Cc: freebsd-current@freebsd.org, 'Milan Obuch' Subject: Re: ATHCTRL for ATH X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2005 17:02:05 -0000 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--