From owner-freebsd-current@FreeBSD.ORG Tue Aug 5 18:03:01 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDEBD1065674 for ; Tue, 5 Aug 2008 18:03:01 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6F08FC15 for ; Tue, 5 Aug 2008 18:03:01 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: by an-out-0708.google.com with SMTP id b33so1400790ana.13 for ; Tue, 05 Aug 2008 11:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:organization:to:subject :date:user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=eY8lGLrJ9irW1ZMPPu3bywhlM9OhEUS1ErpyGLGSAJI=; b=NAV2M7Hg1CREihJS55qdWWaHKhj1LcWqsI9kWUMtEUF7zFcxUQBN+BChN8/FgM8dqO sj1DGgaTy763DjE1Vim5c6Q6oy4b12wGaSbSTnnkO4Urxz5BXgVdhEwzjPI2kekeVHAe FRoCaUU1HnOjqOKGtxyOGW8lrbPSr57oXzemI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; b=q7bXaXavqCKM9QJdQkKy2t31PUAcxk2J4v8tWVW6t79hmI7OdDQhNQgAg9TBHo5f3+ E4c8Va44qRTubgUv+4uIiTtHDmLE6zGWrZB6mL/M/sqAO+E6ieOQd9kHsDHExNgh5fYN 0QkDw5bE41F5AN7mhnJogRo5zvWusQ5wmCSb0= Received: by 10.100.227.6 with SMTP id z6mr1853526ang.133.1217959380379; Tue, 05 Aug 2008 11:03:00 -0700 (PDT) Received: from ?0.0.0.0? ( [196.34.241.123]) by mx.google.com with ESMTPS id 31sm9531293wri.14.2008.08.05.11.00.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Aug 2008 11:02:59 -0700 (PDT) From: David Naylor Organization: Private To: Sam Leffler Date: Tue, 5 Aug 2008 19:59:48 +0200 User-Agent: KMail/1.9.7 References: <200808042213.19795.naylor.b.david@gmail.com> <48987A3A.3030506@freebsd.org> In-Reply-To: <48987A3A.3030506@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1332477.MVuACEzNBb"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200808051959.53073.naylor.b.david@gmail.com> X-Mailman-Approved-At: Tue, 05 Aug 2008 18:04:07 +0000 Cc: freebsd-current@freebsd.org Subject: Re: ral, rum and bi-antenna 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: Tue, 05 Aug 2008 18:03:02 -0000 --nextPart1332477.MVuACEzNBb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 05 August 2008 18:05:14 Sam Leffler wrote: > David Naylor wrote: > > Hi, > > > > I happen to have the good fortune of owning a RT2661S (ral driver) and a > > RT2601USB (rum driver) [manufactured by Canyon]. Both chipsets have the > > ability to handle two antenna. > > > > Now the good fortune, both chipsets default to the wrong antenna. When= I > > should be getting a stable connection at about -70dBm instead I am > > getting very poor connection (less than 50% connectivity, reported from > > ping) and about -90dBm. > > > > After looking at the FreeBSD driver code (and the [Open/Net]BSD) the > > antenna selection is marked as *TBD*. Does anyone know how to add > > antenna selection (the ralink linux drivers are a wild maze). I > > considered trying to do it myself but I do not know the first thing abo= ut > > kernel hacking (let alone chipset drivers) and have no idea where to > > start. > > > > I was thinking a stop-gap solution will be to have the antenna selectab= le > > using tunables/sysctl? > > > > Needless to say I am very willing to try any patches (and even attempt = to > > create one myself if someone could point me in the right direction...). > > So far as I know the hardware provides no help in this area; e.g. like > switching antenna ports on retry attempts or reporting which antenna was > used to tx/rx a frame. I don't even know if the h/w does rx diversity. > I believe the ralink drivers for these chips do some form of s/w > diversity or antenna switching. > > Otherwise you can certainly hookup a sysctl to fix the antenna; ath has > code to do this you can crib. At some point we'll get around to hooking > up ifconfig (I've delayed as MIMO makes this api slightly more involved > then pick one of auto, 0, 1). I have been reading through the rt2560 driver code and they do in-fact use= =20 sysctl although it is undocumented. It appears to me that a lot of the cod= e=20 is copied and could be refactored (with a bit of abstraction?) [where=20 templates from C++ will be handy?]. An idea for a project, should someone= =20 want some extra work :-> > But the bigger question is why you're seeing such a difference when > locking tx to one port or another; it sounds like the antenna design on > your card is highly directional. This is not unexpected for USB devices > where every penny is scrimped in design+manufacture but cardbus cards > typically are better. Cardbus cards often have U.FL connectors under > the sheath so if you're willing to canibalize your card you can remove > the sheath and attach good antennae to see if you get better behaviour. The card only has one slot available to connect an 'external' antenna and I= =20 think it defaults to the internal one. I think in this case the external=20 antenna does make a big difference. (I even have homemade parabolic=20 reflectors attached to the aerials, which does give some boost). I assume there will be no problem if I copied from the linux drivers provid= ed=20 by ralink (it looks like a BSD license to me) --nextPart1332477.MVuACEzNBb Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBImJUZUaaFgP9pFrIRAlxDAKCKcXQ/F0N6V/CCXfxUI+vWlF1BRgCbB6uQ CWNak0bkfjNOUiJNBrJKVSs= =ZBXg -----END PGP SIGNATURE----- --nextPart1332477.MVuACEzNBb--