linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Gabor Juhos <juhosg@openwrt.org>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	mcgrof@qca.qualcomm.com
Subject: Re: [PATCH 02/12] ath9k: validate rx antenna settings
Date: Wed, 11 Jul 2012 20:54:46 +0200	[thread overview]
Message-ID: <4FFDCBF6.9080504@openwrt.org> (raw)
In-Reply-To: <4FFDC92D.2010103@openwrt.org>

On 2012-07-11 8:42 PM, Gabor Juhos wrote:
> 2012.07.11. 19:59 keltezéssel, Felix Fietkau írta:
>> Many chips are not able to deal with non-consecutive rx antenna selections
>> and respond with calibration errors, reset errors, etc.
>> When an antenna is selected as a tx antenna, also flag it for rx to avoid
>> chip issues.
>> 
>> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
>> ---
>>  drivers/net/wireless/ath/ath9k/main.c |   19 ++++++++++++++++++-
>>  1 files changed, 18 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
>> index 248e5b2..49f293a 100644
>> --- a/drivers/net/wireless/ath/ath9k/main.c
>> +++ b/drivers/net/wireless/ath/ath9k/main.c
>> @@ -1912,12 +1912,29 @@ static u32 fill_chainmask(u32 cap, u32 new)
>>  	return filled;
>>  }
>>  
>> +static bool validate_antenna_mask(struct ath_hw *ah, u32 val)
>> +{
>> +	switch (val & ah->caps.rx_chainmask) {
>> +	case 0x1:
>> +	case 0x3:
>> +	case 0x7:
>> +		return true;
>> +	case 0x2:
>> +		return (ah->caps.rx_chainmask == 1);
> 
> This case statement seems superfluous. If 'rx_chainmask == 1' then 'val &
> rx_chainmask' never will be 0x2.
> 
>> +	default:
>> +		return false;
>> +	}
> 
> Additionally, the function does not allows to set rx antenna to 0x2/0x3 for
> chips with antenna diversity capabilities.
Yeah, thanks. I added the case 0x2 above to take care of that, but it's
obviously buggy because of the masking with rx_chainmask.
I'll fix it in v2.

- Felix

      reply	other threads:[~2012-07-11 18:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 17:59 [PATCH 01/12] ath9k_hw: fall back to OTP ROM when platform data has no valid eeprom data Felix Fietkau
2012-07-11 17:59 ` [PATCH 02/12] ath9k: validate rx antenna settings Felix Fietkau
2012-07-11 17:59   ` [PATCH 03/12] ath9k_hw: enable ANI on AR934x Felix Fietkau
2012-07-11 17:59     ` [PATCH 04/12] ath9k_hw: fix tx gain tables for AR934x Felix Fietkau
2012-07-11 17:59       ` [PATCH 05/12] ath9k_hw: remove redundant arguments to INIT_INI_ARRAY Felix Fietkau
2012-07-11 17:59         ` [PATCH 06/12] ath9k/ath9k_htc: fix txop limit handling Felix Fietkau
2012-07-11 17:59           ` [PATCH 07/12] ath9k: make per-WMM-AC queue sizes configurable via debugfs Felix Fietkau
2012-07-11 17:59             ` [PATCH 08/12] ath9k: fix aggregate size limit based on queue TXOP limit Felix Fietkau
2012-07-11 17:59               ` [PATCH 09/12] ath9k_hw: apply XPA timing control values from EEPROM Felix Fietkau
2012-07-11 17:59                 ` [PATCH 10/12] ath9k_hw: clean up AR9003 EEPROM code Felix Fietkau
2012-07-11 17:59                   ` [PATCH 11/12] ath9k_hw: apply XLNA bias settings from EEPROM Felix Fietkau
2012-07-11 17:59                     ` [PATCH 12/12] ath9k_hw: fix SREV checks for applying tuning caps " Felix Fietkau
2012-07-12  6:27               ` [PATCH 08/12] ath9k: fix aggregate size limit based on queue TXOP limit Sujith Manoharan
2012-07-12 11:06                 ` Felix Fietkau
2012-07-11 18:42   ` [PATCH 02/12] ath9k: validate rx antenna settings Gabor Juhos
2012-07-11 18:54     ` Felix Fietkau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FFDCBF6.9080504@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=juhosg@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@qca.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).