2010-03-07 23:45:09

by doddel

[permalink] [raw]
Subject: ath9k: ar9220 does rx but no tx on antenna B

in experimenting with writing antenna control for ath9k from user nl80211 user
space found experimentally, verified with several R52n miniPCI ar9220 boards,
that the current ath9k does not transmit on antenna B but does receive. Only on
antenna A association/authentication and communication is possible.
Have tried all sorts of settings for registers $8004 (AR_STA_ID1) masks
200000/40000/80000/400000 and $8058 (default antenna) and enabling/disabling
ccmp and cck diversity but cannot get antenna B to transmit.
What is the proper way to switch between
1) mimo 80211.n operation and
2) single antenna no-diversity operation, or
3) sectored operation giving all available antennas some airtime and beacons and
answering on basis of best reception results ?
As said current ath9k seems not to initialize the ar9220 properly for mimo mode
on the R52n board that has two PAs but now only can use one.



2010-03-11 16:47:43

by doddel

[permalink] [raw]
Subject: Re: ath9k: ar9220 does rx but no tx on antenna B

Some further experimentation revealed that in case of the ar9220 as applied on
the miniPCI board R52N (mikrotik) the observed behaviour is caused by ath9k's
function ath_update_chainmask (main.c) which sets the rx/tx_chainmasks to 1 in
case of any legacy (non-HT) mode. On the R52N the two antenna connectors
correspond 1:1 to the two RF processing chains which this function selects: 1
(legacy) or 3 (1+2) for HT.
Signals from chain 2 still are still received in legacy mode when it has an
antenna on chain 2 even though chain 1 is selected because the driver does not
disable fast diversity and the external RF circuitry remains active. But
transmission does only happen through chain 1.
Register values set at AR_PHY_SWITCH_CHAIN_0 and at AR_PHY_SWITCH_CHAIN_0+offset
on basis of eeprom info are identical, effectively eliminating the default
antenna setting as a means to distinguish between antennas. This is right in
this case as there are no antennas to switch between per RF processing chain.
Ath9k's decision to make HT modes force multiple antenna use is an
over-simplification. Communication with MCS index 0-7 (max. 150 Mbps@40MHz)
require only a single spatial stream and therefor can work with a single antenna.
Conclusions:
Selection of a single antenna has to be done via setting the chainmask, while
optionally disabling diversity reception.
The number of available antennas and available parallel processing chains,
whichever the least, will determine the max. MCS index possible.
A single antenna must be allowed for HT modes as up to MCS index 7 they can
still function.
For protection of the non-terminated power amplifier(s) it is better to only
activate the txchains that have antennas i.s.o. all available chains.
An idea perhaps is to define a user setting antenna_mode with the bits [3:0]
defined as in ath5k and bits [7:4] an optional map of connected antennas; in
case [7:4]=0 the assumption could be fast diversity / mimo and antennas present
to the full of hardware capabilities.


2010-03-08 09:27:07

by doddel

[permalink] [raw]
Subject: Re: ath9k: ar9220 does rx but no tx on antenna B

The R52n miniPCI is documented to have
"Support for up to 2x2 MIMO with spatial multiplexing".
Indeed the board layout contains two identical RF stages with filters and tx
amplifiers / rx pre-amplifiers (SiGE SE9523) and antenna connectors.
Having scanned through all present ath9k code for things related to antenna
choice i saw in several places (beacon.c, rcvc.c) some code that determines an
antenna. But the resulting values do not get applied. Aso the tx descriptor
structures do not contain antenna information, unlike in ath5k and madwifi.
Hope that somebody can shed some light on what these chipsets that ath9k is
meant for can or cannot do in terms of antenna choice.
And how to control it and switch between full 2x2 mimo 80211n and bgn style with
single or sectored antennas.


2010-03-07 23:59:13

by Gábor Stefanik

[permalink] [raw]
Subject: Re: ath9k: ar9220 does rx but no tx on antenna B

On Mon, Mar 8, 2010 at 12:38 AM, doddel <[email protected]> wrote:
> in experimenting with writing antenna control for ath9k from user nl80211 user
> space found experimentally, verified with several R52n miniPCI ar9220 boards,
> that the current ath9k does not transmit on antenna B but does receive. Only on
> antenna A association/authentication and communication is possible.
> Have tried all sorts of settings for registers $8004 (AR_STA_ID1) masks
> 200000/40000/80000/400000 and $8058 (default antenna) and enabling/disabling
> ccmp and cck diversity but cannot get antenna B to transmit.
> What is the proper way to switch between
> 1) mimo 80211.n operation and
> 2) single antenna no-diversity operation, or
> 3) sectored operation giving all available antennas some airtime and beacons and
> answering on basis of best reception results ?
> As said current ath9k seems not to initialize the ar9220 properly for mimo mode
> on the R52n board that has two PAs but now only can use one.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

Isn't AR9220 an 1T2R device?

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