Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1522505 > unrolled thread

[PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected

Started bykhalasa@piap.pl (Krzysztof Hałasa)
First post2016-11-15 11:00 +0100
Last post2016-11-21 15:20 +0100
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected khalasa@piap.pl (Krzysztof Hałasa) - 2016-11-15 11:00 +0100
    Re: [4.9.0-rc5] AR9300 calibration problems with antenna selected Kalle Valo <kvalo@codeaurora.org> - 2016-11-17 12:10 +0100
    Re: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna  selected miaoqing@codeaurora.org - 2016-11-21 06:50 +0100
      Re: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected khalasa@piap.pl (Krzysztof Hałasa) - 2016-11-21 15:00 +0100
        Re: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna  selected Matthias May <matthias.may@neratec.com> - 2016-11-21 15:20 +0100

#1522505 — [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected

Fromkhalasa@piap.pl (Krzysztof Hałasa)
Date2016-11-15 11:00 +0100
Subject[PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected
Message-ID<sDIH0-3dJ-15@gated-at.bofh.it>
Hi,

I recently tried to select a single antenna on AR9300 and it works for
30 seconds only. The subsequent calibration makes the RX signal level to
drop from the usual -30/-40 dBm to -70/-80 dBm, and the transmission
practically stops.

With the attached patch it works, though selecting the antenna doesn't
seem to have any visible effect, at least with "iw wlanX station dump"
(perhaps it works for TX).

I'm using ad-hoc mode:

rmmod ath9k
modprobe ath9k
iw dev wlan0 set type ibss
iw phy phyX set antenna 2
ip link set up dev wlan0
iw dev wlan0 set bitrates legacy-2.4 18
iw dev wlan0 ibss join nameXXX freqYYY
ip addr add ZZZ broadcast + dev wlan0

The card in question is Mikrotik (Routerboard) R11e-2HPnD mPCIe adapter:
AR9580 Wireless Network Adapter (rev 01), ID 168c:0033, subsystem
19b6:d016.
ieee80211 phy0: Atheros AR9300 Rev:4 mem=0xc0f40000, irq=334
https://routerboard.com/R11e-2HPnD

Linux 4.9.0-rc5.


Is there a better way?

Signed-off-by: Krzysztof Halasa <khalasa@piap.pl>

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e9f32b5..7f17e5d 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2245,7 +2245,7 @@ static int ath9k_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
 		return 0;
 
 	/* AR9100 runs into calibration issues if not all rx chains are enabled */
-	if (AR_SREV_9100(ah))
+	if (AR_SREV_9100(ah) || AR_SREV_9300(ah))
 		ah->rxchainmask = 0x7;
 	else
 		ah->rxchainmask = fill_chainmask(ah->caps.rx_chainmask, rx_ant);


-- 
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

[toc] | [next] | [standalone]


#1524385 — Re: [4.9.0-rc5] AR9300 calibration problems with antenna selected

FromKalle Valo <kvalo@codeaurora.org>
Date2016-11-17 12:10 +0100
SubjectRe: [4.9.0-rc5] AR9300 calibration problems with antenna selected
Message-ID<sEsJQ-8m7-29@gated-at.bofh.it>
In reply to#1522505
Krzysztof wrote:
> Hi,
> 
> I recently tried to select a single antenna on AR9300 and it works for
> 30 seconds only. The subsequent calibration makes the RX signal level to
> drop from the usual -30/-40 dBm to -70/-80 dBm, and the transmission
> practically stops.
> 
> With the attached patch it works, though selecting the antenna doesn't
> seem to have any visible effect, at least with "iw wlanX station dump"
> (perhaps it works for TX).
> 
> I'm using ad-hoc mode:
> 
> rmmod ath9k
> modprobe ath9k
> iw dev wlan0 set type ibss
> iw phy phyX set antenna 2
> ip link set up dev wlan0
> iw dev wlan0 set bitrates legacy-2.4 18
> iw dev wlan0 ibss join nameXXX freqYYY
> ip addr add ZZZ broadcast + dev wlan0
> 
> The card in question is Mikrotik (Routerboard) R11e-2HPnD mPCIe adapter:
> AR9580 Wireless Network Adapter (rev 01), ID 168c:0033, subsystem
> 19b6:d016.
> ieee80211 phy0: Atheros AR9300 Rev:4 mem=0xc0f40000, irq=334
> https://routerboard.com/R11e-2HPnD
> 
> Linux 4.9.0-rc5.
> 
> 
> Is there a better way?
> 
> Signed-off-by: Krzysztof Halasa <khalasa@piap.pl>
> 
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index e9f32b5..7f17e5d 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -2245,7 +2245,7 @@ static int ath9k_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
>  		return 0;
>  
>  	/* AR9100 runs into calibration issues if not all rx chains are enabled */
> -	if (AR_SREV_9100(ah))
> +	if (AR_SREV_9100(ah) || AR_SREV_9300(ah))
>  		ah->rxchainmask = 0x7;
>  	else
>  		ah->rxchainmask = fill_chainmask(ah->caps.rx_chainmask, rx_ant);

I'll assume this is an RFC patch. Please resubmit if this is the right
approach.

Patch set to RFC.

-- 
https://patchwork.kernel.org/patch/9429263/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

[toc] | [prev] | [next] | [standalone]


#1526371 — Re: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected

Frommiaoqing@codeaurora.org
Date2016-11-21 06:50 +0100
SubjectRe: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected
Message-ID<sFPEm-5rv-7@gated-at.bofh.it>
In reply to#1522505
I would prefer that you didn't submit this.

> 
> I recently tried to select a single antenna on AR9300 and it works for
> 30 seconds only. The subsequent calibration makes the RX signal level
> to drop from the usual -30/-40 dBm to -70/-80 dBm, and the
> transmission practically stops.
> 
> With the attached patch it works, though selecting the antenna doesn't
> seem to have any visible effect, at least with "iw wlanX station dump"
> (perhaps it works for TX).
> 
> I'm using ad-hoc mode:
> 
> rmmod ath9k
> modprobe ath9k
> iw dev wlan0 set type ibss
> iw phy phyX set antenna 2

2 is a bad mask. We use bitmap, the valid masks are 1, 3, 7.

--
Miaoqing

[toc] | [prev] | [next] | [standalone]


#1526685

Fromkhalasa@piap.pl (Krzysztof Hałasa)
Date2016-11-21 15:00 +0100
Message-ID<sFXiC-1QC-27@gated-at.bofh.it>
In reply to#1526371
miaoqing@codeaurora.org writes:

>> rmmod ath9k
>> modprobe ath9k
>> iw dev wlan0 set type ibss
>> iw phy phyX set antenna 2
>
> 2 is a bad mask. We use bitmap, the valid masks are 1, 3, 7.

Thanks for your response.

I have two antenna connections (and a single antenna). Is it possible to
select the secondary antenna connector only? How?
-- 
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

[toc] | [prev] | [next] | [standalone]


#1526699 — Re: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected

FromMatthias May <matthias.may@neratec.com>
Date2016-11-21 15:20 +0100
SubjectRe: [PATCH 4.9.0-rc5] AR9300 calibration problems with antenna selected
Message-ID<sFXBT-2h6-15@gated-at.bofh.it>
In reply to#1526685
On 21/11/16 14:54, Krzysztof Hałasa wrote:
> miaoqing@codeaurora.org writes:
> 
>>> rmmod ath9k
>>> modprobe ath9k
>>> iw dev wlan0 set type ibss
>>> iw phy phyX set antenna 2
>>
>> 2 is a bad mask. We use bitmap, the valid masks are 1, 3, 7.
> 
> Thanks for your response.
> 
> I have two antenna connections (and a single antenna). Is it possible to
> select the secondary antenna connector only? How?
> 

No this is not really possible.
We have been playing around with this two, three years ago with this.
There are just too many things which rely on chain0
Noise calibration, DFS, Temperature measurement, Spectrum measurement
are just a few of the things I remember which don't work realiably anymore.
See [1] for more.

BR
Matthias

[1]
http://ath9k-devel.ath9k.narkive.com/QZcobwy1/ath9k-deaf-qca9558-when-setting-rxchainmask#post1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web