Re: ral, rum and bi-antenna

From: David Naylor <naylor.b.david_at_gmail.com>
Date: Tue, 5 Aug 2008 19:59:48 +0200
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 about
> > 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 selectable
> > 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 
sysctl although it is undocumented.  It appears to me that a lot of the code 
is copied and could be refactored (with a bit of abstraction?) [where 
templates from C++ will be handy?].  An idea for a project, should someone 
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 
think it defaults to the internal one.  I think in this case the external 
antenna does make a big difference.  (I even have homemade parabolic 
reflectors attached to the aerials, which does give some boost).

I assume there will be no problem if I copied from the linux drivers provided 
by ralink (it looks like a BSD license to me)

Received on Tue Aug 05 2008 - 16:03:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:33 UTC