2009-04-16 12:05:01

by Hans Maes

[permalink] [raw]
Subject: how to set antenna iw + ath5k

Hello,

I'm not sure this is the correct place to ask my question, but I've been
searching on google for ages now and can't seem to find an answer so I'm
asking it here.
If not, please yell at me and tell me where to go whine instead ;-)

I'm using CM11 a/b/g cards with the Atheros AR5414A Chip, which have 2
antenna connectors.
I only have 1 antenna connected to the MAIN connector.
Running a self compiled 2.6.29 kernel on a few debian lenny boxes with
ath5k module for the wireless cards, set up in mesh mode.
Seems to work fine on the test bench, but behaves rather poorly in
production environment.
Everything related to the mesh network setup seems to work, but I have
about 40% - 60% packet loss on the entire netwerk (about 15 nodes)

I'm guessing this has something to do with the antenna diversity setting.

Can anybody tell me how to tell the ath5k module to disable antenna
diversity and only use the MAIN antenna ?

If this is a RTFM thingie, then I apologize, I just can't seem to find
it anywhere.

Please reply to my personal e-mail address as well, I'm not subscribed
to the list.

Thanks for your help.

Regards,

Hans


2009-04-16 13:11:44

by Nick Kossifidis

[permalink] [raw]
Subject: Re: how to set antenna iw + ath5k

2009/4/16 Hans Maes <[email protected]>:
> Hello,
>
> I'm not sure this is the correct place to ask my question, but I've been
> searching on google for ages now and can't seem to find an answer so I'm
> asking it here.
> If not, please yell at me and tell me where to go whine instead ;-)
>
> I'm using CM11 a/b/g cards with the Atheros AR5414A Chip, which have 2
> antenna connectors.
> I only have 1 antenna connected to the MAIN connector.
> Running a self compiled 2.6.29 kernel on a few debian lenny boxes with ath5k
> module for the wireless cards, set up in mesh mode.
> Seems to work fine on the test bench, but behaves rather poorly in
> production environment.
> Everything related to the mesh network setup seems to work, but I have about
> 40% - 60% packet loss on the entire netwerk (about 15 nodes)
>
> I'm guessing this has something to do with the antenna diversity setting.
>
> Can anybody tell me how to tell the ath5k module to disable antenna
> diversity and only use the MAIN antenna ?
>
> If this is a RTFM thingie, then I apologize, I just can't seem to find it
> anywhere.
>
> Please reply to my personal e-mail address as well, I'm not subscribed to
> the list.
>
> Thanks for your help.
>
> Regards,
>
> Hans

After this patch...
https://lists.ath5k.org/pipermail/ath5k-devel/2009-April/002264.html

It's possible to tell the driver to use one fixed antenna (in your
case its fixed antenna A). Just change...
ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);

with
ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);

we will have a better way to change this in the future ;-)



--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2009-04-21 11:56:10

by Hans Maes

[permalink] [raw]
Subject: Re: how to set antenna iw + ath5k


Nick Kossifidis wrote:
> 2009/4/16 Hans Maes <[email protected]>:
>
>> Hello,
>>
>> I'm not sure this is the correct place to ask my question, but I've been
>> searching on google for ages now and can't seem to find an answer so I'm
>> asking it here.
>> If not, please yell at me and tell me where to go whine instead ;-)
>>
>> I'm using CM11 a/b/g cards with the Atheros AR5414A Chip, which have 2
>> antenna connectors.
>> I only have 1 antenna connected to the MAIN connector.
>> Running a self compiled 2.6.29 kernel on a few debian lenny boxes with ath5k
>> module for the wireless cards, set up in mesh mode.
>> Seems to work fine on the test bench, but behaves rather poorly in
>> production environment.
>> Everything related to the mesh network setup seems to work, but I have about
>> 40% - 60% packet loss on the entire netwerk (about 15 nodes)
>>
>> I'm guessing this has something to do with the antenna diversity setting.
>>
>> Can anybody tell me how to tell the ath5k module to disable antenna
>> diversity and only use the MAIN antenna ?
>>
>> If this is a RTFM thingie, then I apologize, I just can't seem to find it
>> anywhere.
>>
>> Please reply to my personal e-mail address as well, I'm not subscribed to
>> the list.
>>
>> Thanks for your help.
>>
>> Regards,
>>
>> Hans
>>
>
> After this patch...
> https://lists.ath5k.org/pipermail/ath5k-devel/2009-April/002264.html
>
> It's possible to tell the driver to use one fixed antenna (in your
> case its fixed antenna A). Just change...
> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
>
> with
> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);
>
Seems like a quite recent patch ;-)

I've been reading up on how to patch the source myself, but I'm not sure
I'll succeed without breaking things.
I can manage pulling the git repository and compiling the ath5k module,
but I'm no expert at patching stuff.

Any pointers where to look for a simple howto on 'the proper way' to
apply these patches ?
Any idea when this patch would make it into the git repository ?
> we will have a better way to change this in the future ;-)
>
That would be nice, I know most users don't need to change this and can
live with default settings, but there are so many possible scenarios
where one would want more specific control over antenna settings.


Thanks for the help!

Hans

2009-04-16 15:45:58

by Nick Kossifidis

[permalink] [raw]
Subject: Re: how to set antenna iw + ath5k

2009/4/16 Arnd Hannemann <[email protected]>:
> G=C3=A1bor Stefanik wrote:
>> On Thu, Apr 16, 2009 at 3:11 PM, Nick Kossifidis <[email protected]=
m> wrote:
>>
>>> 2009/4/16 Hans Maes <[email protected]>:
>>>
>>>> Hello,
>>>>
>>>> I'm not sure this is the correct place to ask my question, but I'v=
e been
>>>> searching on google for ages now and can't seem to find an answer =
so I'm
>>>> asking it here.
>>>> If not, please yell at me and tell me where to go whine instead ;-=
)
>>>>
>>>> I'm using CM11 a/b/g cards with the Atheros AR5414A Chip, which ha=
ve 2
>>>> antenna connectors.
>>>> I only have 1 antenna connected to the MAIN connector.
>>>> Running a self compiled 2.6.29 kernel on a few debian lenny boxes =
with ath5k
>>>> module for the wireless cards, set up in mesh mode.
>>>> Seems to work fine on the test bench, but behaves rather poorly in
>>>> production environment.
>>>> Everything related to the mesh network setup seems to work, but I =
have about
>>>> 40% - 60% packet loss on the entire netwerk (about 15 nodes)
>>>>
>>>> I'm guessing this has something to do with the antenna diversity s=
etting.
>>>>
>>>> Can anybody tell me how to tell the ath5k module to disable antenn=
a
>>>> diversity and only use the MAIN antenna ?
>>>>
>>>> If this is a RTFM thingie, then I apologize, I just can't seem to =
find it
>>>> anywhere.
>>>>
>>>> Please reply to my personal e-mail address as well, I'm not subscr=
ibed to
>>>> the list.
>>>>
>>>> Thanks for your help.
>>>>
>>>> Regards,
>>>>
>>>> Hans
>>>>
>>> After this patch...
>>> https://lists.ath5k.org/pipermail/ath5k-devel/2009-April/002264.htm=
l
>>>
>>> It's possible to tell the driver to use one fixed antenna (in your
>>> case its fixed antenna A). Just change...
>>> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
>>>
>>> with
>>> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);
>>>
>>> we will have a better way to change this in the future ;-)
>>>
>>
>> I wonder if just exporting that as a modparam is a good-enough
>> choice... though perhaps the best solution would be something like "=
iw
>> phy phy0 antenna 1 up/down". Or perhaps we should make antenna
>> diversity depend on the PCI ID, defaulting to 1 antenna when diversi=
ty
>> support cannot be determined.
>>
>>
> modparam seems somewhat broken, thinking of multiple wireless cards..=
=2E
> My feature request would be to allow setup fixed txantenna only for
> broadcast/multicast frames.

Well such frames should be sent on all antennas i believe (i did some
experiments and it seems we can force this by writing 0xf on antenna
field of tx descriptor).

> I think it would work for almost all setups, even if only
> one antenna connector is used, as diversity logic
> will naturally handle unicast frames right. Or did I miss something?
>
> BTW: is it theoretically possible to turn off RX antenna diversity, a=
nd
> what would be the potential gain?
>

Yes, check out the patch. The only problem i see with rx diversity in
some cases is when you get a frame on the wrong antenna, this can lead
on updating tx antenna (based on acks etc) which can lead to missed
frames.

--=20
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2009-04-21 14:35:03

by Bob Copeland

[permalink] [raw]
Subject: Re: how to set antenna iw + ath5k

On Tue, Apr 21, 2009 at 7:56 AM, Hans Maes <[email protected]> wrote:
> Any pointers where to look for a simple howto on 'the proper way' to apply
> these patches ? Any idea when this patch would make it into the git
> repository ?

The best way is to collect all the patches together and use git-am(1).
You need the raw patches, and I'm not sure if you can get them from the
ath5k-devel list archive, but as these were cross-posted to linux-wireless,
you can get them from http://marc.info (use the "download message raw"
link). You generally need the entire series, all 7 patches in this case.
As a last resort, you can ask the patch author to forward you a copy.

Once you have all the patches, you can apply them individually with
git-am, or as a group if you have them in mbox format. See its manpage
for details.

The usual alternative is "patch -p1 < foo.patch" but it won't create
git commits for you.

The patches should go in pretty soon, the only thing objected to was the
over 80 col changelog.

>>> Please reply to my personal e-mail address as well, I'm not subscribed to
>>> the list.

It is common etiquette on Linux kernel-related mailing lists to simply do
reply-all -- especially on lkml where most people do not subscribe.

--
Bob Copeland %% http://www.bobcopeland.com

2009-04-16 15:23:15

by Arnd Hannemann

[permalink] [raw]
Subject: Re: how to set antenna iw + ath5k

G=E1bor Stefanik wrote:
> On Thu, Apr 16, 2009 at 3:11 PM, Nick Kossifidis <[email protected]=
> wrote:
> =20
>> 2009/4/16 Hans Maes <[email protected]>:
>> =20
>>> Hello,
>>>
>>> I'm not sure this is the correct place to ask my question, but I've=
been
>>> searching on google for ages now and can't seem to find an answer s=
o I'm
>>> asking it here.
>>> If not, please yell at me and tell me where to go whine instead ;-)
>>>
>>> I'm using CM11 a/b/g cards with the Atheros AR5414A Chip, which hav=
e 2
>>> antenna connectors.
>>> I only have 1 antenna connected to the MAIN connector.
>>> Running a self compiled 2.6.29 kernel on a few debian lenny boxes w=
ith ath5k
>>> module for the wireless cards, set up in mesh mode.
>>> Seems to work fine on the test bench, but behaves rather poorly in
>>> production environment.
>>> Everything related to the mesh network setup seems to work, but I h=
ave about
>>> 40% - 60% packet loss on the entire netwerk (about 15 nodes)
>>>
>>> I'm guessing this has something to do with the antenna diversity se=
tting.
>>>
>>> Can anybody tell me how to tell the ath5k module to disable antenna
>>> diversity and only use the MAIN antenna ?
>>>
>>> If this is a RTFM thingie, then I apologize, I just can't seem to f=
ind it
>>> anywhere.
>>>
>>> Please reply to my personal e-mail address as well, I'm not subscri=
bed to
>>> the list.
>>>
>>> Thanks for your help.
>>>
>>> Regards,
>>>
>>> Hans
>>> =20
>> After this patch...
>> https://lists.ath5k.org/pipermail/ath5k-devel/2009-April/002264.html
>>
>> It's possible to tell the driver to use one fixed antenna (in your
>> case its fixed antenna A). Just change...
>> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
>>
>> with
>> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);
>>
>> we will have a better way to change this in the future ;-)
>> =20
>
> I wonder if just exporting that as a modparam is a good-enough
> choice... though perhaps the best solution would be something like "i=
w
> phy phy0 antenna 1 up/down". Or perhaps we should make antenna
> diversity depend on the PCI ID, defaulting to 1 antenna when diversit=
y
> support cannot be determined.
>
> =20
modparam seems somewhat broken, thinking of multiple wireless cards...
My feature request would be to allow setup fixed txantenna only for
broadcast/multicast frames.
I think it would work for almost all setups, even if only
one antenna connector is used, as diversity logic
will naturally handle unicast frames right. Or did I miss something?

BTW: is it theoretically possible to turn off RX antenna diversity, and
what would be the potential gain?

Best regards,
Arnd

2009-04-16 13:37:59

by Gábor Stefanik

[permalink] [raw]
Subject: Re: how to set antenna iw + ath5k

On Thu, Apr 16, 2009 at 3:11 PM, Nick Kossifidis <[email protected]> wrote:
> 2009/4/16 Hans Maes <[email protected]>:
>> Hello,
>>
>> I'm not sure this is the correct place to ask my question, but I've been
>> searching on google for ages now and can't seem to find an answer so I'm
>> asking it here.
>> If not, please yell at me and tell me where to go whine instead ;-)
>>
>> I'm using CM11 a/b/g cards with the Atheros AR5414A Chip, which have 2
>> antenna connectors.
>> I only have 1 antenna connected to the MAIN connector.
>> Running a self compiled 2.6.29 kernel on a few debian lenny boxes with ath5k
>> module for the wireless cards, set up in mesh mode.
>> Seems to work fine on the test bench, but behaves rather poorly in
>> production environment.
>> Everything related to the mesh network setup seems to work, but I have about
>> 40% - 60% packet loss on the entire netwerk (about 15 nodes)
>>
>> I'm guessing this has something to do with the antenna diversity setting.
>>
>> Can anybody tell me how to tell the ath5k module to disable antenna
>> diversity and only use the MAIN antenna ?
>>
>> If this is a RTFM thingie, then I apologize, I just can't seem to find it
>> anywhere.
>>
>> Please reply to my personal e-mail address as well, I'm not subscribed to
>> the list.
>>
>> Thanks for your help.
>>
>> Regards,
>>
>> Hans
>
> After this patch...
> https://lists.ath5k.org/pipermail/ath5k-devel/2009-April/002264.html
>
> It's possible to tell the driver to use one fixed antenna (in your
> case its fixed antenna A). Just change...
> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
>
> with
> ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);
>
> we will have a better way to change this in the future ;-)

I wonder if just exporting that as a modparam is a good-enough
choice... though perhaps the best solution would be something like "iw
phy phy0 antenna 1 up/down". Or perhaps we should make antenna
diversity depend on the PCI ID, defaulting to 1 antenna when diversity
support cannot be determined.

--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)