From owner-freebsd-current@FreeBSD.ORG Sun Aug 21 15:16:15 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 256E616A41F for ; Sun, 21 Aug 2005 15:16:15 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from mx1.h3q.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7627343D45 for ; Sun, 21 Aug 2005 15:16:14 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mx1.h3q.net (Postfix) with ESMTP id DB05F1A741; Sun, 21 Aug 2005 17:16:09 +0200 (CEST) Received: from mx1.h3q.net ([127.0.0.1]) by localhost (manticore.shapeshifter.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 87433-13; Sun, 21 Aug 2005 17:16:07 +0200 (CEST) Received: from [192.168.0.97] (h4n2fls31o270.telia.com [217.208.199.4]) by mx1.h3q.net (Postfix) with ESMTP id 07D121A714; Sun, 21 Aug 2005 17:16:06 +0200 (CEST) Message-ID: <43089AB6.1000602@shapeshifter.se> Date: Sun, 21 Aug 2005 17:16:06 +0200 From: Fredrik Lindberg User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050816) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dandee@volny.cz References: <20050821124521.744364E704@pipa.profix.cz> In-Reply-To: <20050821124521.744364E704@pipa.profix.cz> Content-Type: multipart/mixed; boundary="------------040308030109050506010404" X-Virus-Scanned: at mail.hamnpolare.net Cc: freebsd-current@freebsd.org 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: Sun, 21 Aug 2005 15:16:15 -0000 This is a multi-part message in MIME format. --------------040308030109050506010404 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit Daniel Dvořák wrote: > No, ifconfig doesn´t support. > > You have to do all manually: > > roztyly# sysctl dev.ath.0.slottime=9 > roztyly# sysctl dev.ath.0.ctstimeout=180 > roztyly# sysctl dev.ath.0.acktimeout=180 > > Unlike Linux: > > lsd:/# uname -a > Linux lsd 2.6.11x2 #1 Tue Jul 12 00:37:52 CEST 2005 i686 GNU/Linux > lsd:/# athctrl -i aht0 -d 1000 > Setting distance on interface aht0 to 1000 meters > lsd:/# athctrl -i aht1 -d 2500 > Setting distance on interface aht1 to 2500 meters > > lsd:/# cat /proc/sys/dev/ath0/acktimeout > 29 > lsd:/# cat /proc/sys/dev/ath0/ctstimeout > 29 > lsd:/# cat /proc/sys/dev/ath0/slottime > 13 > > lsd:/# cat /proc/sys/dev/ath1/slottime > 18 > lsd:/# cat /proc/sys/dev/ath1/acktimeout > 39 > lsd:/# cat /proc/sys/dev/ath1/ctstimeout > 39 > > Dan Ok, I hacked up a small patch. It's a bit crude since the only interface I could find to these settings were through sysctl(3). Put ifath.c in src/sbin/ifconfig and patch src/sbin/ifconfig/Makefile with the attached patch and re-compile ifconfig. > ifconfig ath0 distance 1000 > sysctl dev.ath.0.slottime dev.ath.0.acktimeout dev.ath.0.ctstimeout dev.ath.0.slottime: 13 dev.ath.0.acktimeout: 29 dev.ath.0.ctstimeout: 29 > ifconfig ath0 distance 2500 > sysctl dev.ath.0.slottime dev.ath.0.acktimeout dev.ath.0.ctstimeout dev.ath.0.slottime: 18 dev.ath.0.acktimeout: 39 dev.ath.0.ctstimeout: 39 Fredrik Lindberg > -----Original Message----- > From: owner-freebsd-current@freebsd.org > [mailto:owner-freebsd-current@freebsd.org] On Behalf Of Fredrik Lindberg > Sent: Sunday, August 21, 2005 2:13 PM > To: dandee@volny.cz > Cc: freebsd-current@freebsd.org > Subject: Re: ATHCTRL for ATH > > Daniel Dvořák wrote: > >>I am sorry but I don´t understand about modular ifconfig and about "to > > phase > >>out those sorts of programs out". But I am agree about that would be a >>question for Sam. >> >>So we have to wait now. >> > > > It's quite simple, there is (and have been) numerous programs to > configure different types of network interfaces (wicontrol, gifconfig, > raycontrol, etc...). > The goal is to phase out all these small programs and allow ifconfig to > do their job instead. > A modular ifconfig allows this without turning the ifconfig code into a > bloated, un-maintainable pile of junk. > > In essence, if those "ack+cts" settings you ask for were to be > comitted into the source tree, I guess they would be added to > ifconfig(8) and not as a separate tool. > (Maybe ifconfig already supports this...) > > Fredrik Lindberg > > >>-----Original Message----- >>From: owner-freebsd-current@freebsd.org >>[mailto:owner-freebsd-current@freebsd.org] On Behalf Of Brooks Davis >>Sent: Sunday, August 21, 2005 3:51 AM >>To: dandee@volny.cz >>Cc: freebsd-current@freebsd.org >>Subject: Re: ATHCTRL for ATH >> >>On Sun, Aug 21, 2005 at 03:32:15AM +0200, Daniel Dvorak wrote: >> >> >>>Hi all, >>> >>>I have one question for you. My friend use Linux Debian and he use atheros >>>cards with madwifi drivers. Sam work together with others developers and I >>>found out that he committed interesting tool for linux users. >>> >>>This tool is athctrl, which you know "athctrl program that sets the >> >>ack+cts >> >> >>>timeouts based on the distance between two stations". And I think that >> >>this >> >> >>>feature is useful not only for linux users but of course for users of >> >>others >> >> >>>os like FreeBSD etc. >>> >>>So, I do not know why the tool is not in main tree fbsd, maybe there is >>>reason for this and I do not know. Which it is my mistake, so if it is >> >>true, >> >> >>>I am sorry. Of course, I could not imagine how much work somebody has to >> >>do >> >> >>>for this, but I would like to only ask if possible now before final >> >>release >> >> >>>6.0 or in the future. >>> >>>Does somebody think somebody could commit this tool for FreeBSD users ? >> >> >>It's unlikely athctrl will be commited because we're attempting to phase >>those sorts of programs out in favor of a modular ifconfig. It's not >>clear to me if we the support or not at this point. That would be a >>question for Sam, but he's on vacation at the moment. >> >>-- Brooks >> > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > --------------040308030109050506010404 Content-Type: text/plain; name="ifath.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ifath.c" /*- * Copyright (c) 2005 Fredrik Lindberg * Copyright (c) 2002-2004 Gunter Burchardt, Local-Web AG * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ifconfig.h" DECL_CMD_FUNC(setath_distance, val, d); DECL_CMD_FUNC(setath_distance, val, d) { int slottime, acktout, ctstout, len; size_t newlen; char *base = NULL, *buf; #define SLOTTIME(distance) (9 + (distance / 300) + ((distance % 300) ? 1: 0)) slottime = SLOTTIME(atoi(val)); acktout = (slottime * 2) + 3; ctstout = (slottime * 2) + 3; #undef SLOTTIME /* * The only interface to these functions are through sysctl(3). */ if ((len = asprintf(&base, "dev.%s.", name)) == -1) errx(1, "%s", strerror(errno)); buf = (base + len - 1); while (!isnumber(*buf)) { char c = *buf; *buf = *(buf - 1); *(buf - 1) = c; } buf = NULL; if ((newlen = asprintf(&buf, "%s.slottime", base)) == -1) errx(1, "%s", strerror(errno)); if (sysctlbyname(buf, NULL, NULL, (void *)&slottime, sizeof(slottime)) != 0) errx(1, "unable to set slottime"); if ((newlen = asprintf(&buf, "%s.acktimeout", base)) == -1) errx(1, "%s", strerror(errno)); if (sysctlbyname(buf, NULL, NULL, (void *)&acktout, sizeof(acktout)) != 0) errx(1, "unable to set acktimeout"); if ((newlen = asprintf(&buf, "%s.ctstimeout", base)) == -1) errx(1, "%s", strerror(errno)); if (sysctlbyname(buf, NULL, NULL, (void *)&ctstout, sizeof(ctstout)) != 0) errx(1, "unable to set ctstimeout"); free(buf); free(base); } static struct cmd ath_cmds[] = { DEF_CMD_ARG("distance", setath_distance), }; static struct afswtch af_ath = { .af_name = "af_ath", .af_af = AF_UNSPEC, .af_status = NULL, }; static __constructor void ieee80211_ctor(void) { #define N(a) (sizeof(a) / sizeof(a[0])) int i; for (i = 0; i < N(ath_cmds); i++) cmd_register(&ath_cmds[i]); af_register(&af_ath); #undef N } --------------040308030109050506010404 Content-Type: text/plain; name="ifconfig-Makefile.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ifconfig-Makefile.patch" Index: Makefile =================================================================== RCS file: /home/ncvs/src/sbin/ifconfig/Makefile,v retrieving revision 1.29 diff -u -r1.29 Makefile --- Makefile 5 Jun 2005 03:32:51 -0000 1.29 +++ Makefile 21 Aug 2005 15:11:58 -0000 @@ -28,6 +28,8 @@ SRCS+= ifbridge.c # bridge support +SRCS+= ifath.c # Special ath(4) commands + .if !defined(RELEASE_CRUNCH) SRCS+= af_ipx.c # IPX support DPADD= ${LIBIPX} --------------040308030109050506010404--