All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH 1/3] ath9k: use consistent value for REDUCE_SCALED_POWER_BY_THREE_CHAIN
Date: Sun, 15 Apr 2012 19:21:56 +0200	[thread overview]
Message-ID: <4F8B03B4.8090501@openwrt.org> (raw)
In-Reply-To: <CALSq=BYgJ-bawvPPb7bcqL2XXQjA8=j3irdr6h41C-G7CE3C=Q@mail.gmail.com>

Hi Dan,

Thank you for the comments.

> (Failed to reply-all originally, sorry:)
> 
> Erm...
> 
> On Sat, Apr 14, 2012 at 1:01 PM, Gabor Juhos <juhosg@openwrt.org> wrote:
>>
>> In eeprom_def.c and in ar9003_eeprom.c the value
>> of the symbol is 9, however the comments in these
>> files indicates the value should be 10*log10(3)*2
>> which is 9.54242509439325. Replace the the value
>> to 10 in these files.
> 
> So the truncated constant is off by a quarter-dB for 9 or for 10. Do
> the chips care one way or the other? (For comparison, Intel uses 4.5
> dB, i.e. 9 in this notation, to mean "divide-by-3". That's what ath9k
> has now).

In my understanding the value is not related to the chip. It is used for
per-chain tx power reduction, in order to ensure regulatory compliance. Using 10
instead of 9 means that the overall tx power will be lower.

> Are you making it consistent with some other file that's not mentioned
> here? If not, why?

I'm tyring to make it consistent between ar9003_eeprom.c, eeprom_def.c and
eeprom_9287.c. The first two files uses 9, whereas eeprom_9287 uses 10.

Considering Felix's comment, I will update the patch and will use 9 instead of
10. Although that will replace the value in eeprom_9287.c, but that should not
cause problems, because the AR9287 does not supports 3x3.

>>  #define REDUCE_SCALED_POWER_BY_TWO_CHAIN     6  /* 10*log10(2)*2 */
>> -#define REDUCE_SCALED_POWER_BY_THREE_CHAIN   9  /* 10*log10(3)*2 */
>> +#define REDUCE_SCALED_POWER_BY_THREE_CHAIN   10 /* 10*log10(3)*2 */
>>  #define PWRINCR_3_TO_1_CHAIN      9             /* 10*log(3)*2 */
> 
> Why only change one of two 9s to a 10? Why not also PWRINCR_3_TO_1_CHAIN?

The PWRINCR_* symbols are not used anywhere and should be removed.

-Gabor

WARNING: multiple messages have this Message-ID (diff)
From: Gabor Juhos <juhosg@openwrt.org>
To: Daniel Halperin <dhalperi@cs.washington.edu>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org,
	"ath9k-devel@lists.ath9k.org" <ath9k-devel@venema.h4ckr.net>
Subject: Re: [PATCH 1/3] ath9k: use consistent value for REDUCE_SCALED_POWER_BY_THREE_CHAIN
Date: Sun, 15 Apr 2012 19:21:56 +0200	[thread overview]
Message-ID: <4F8B03B4.8090501@openwrt.org> (raw)
In-Reply-To: <CALSq=BYgJ-bawvPPb7bcqL2XXQjA8=j3irdr6h41C-G7CE3C=Q@mail.gmail.com>

Hi Dan,

Thank you for the comments.

> (Failed to reply-all originally, sorry:)
> 
> Erm...
> 
> On Sat, Apr 14, 2012 at 1:01 PM, Gabor Juhos <juhosg@openwrt.org> wrote:
>>
>> In eeprom_def.c and in ar9003_eeprom.c the value
>> of the symbol is 9, however the comments in these
>> files indicates the value should be 10*log10(3)*2
>> which is 9.54242509439325. Replace the the value
>> to 10 in these files.
> 
> So the truncated constant is off by a quarter-dB for 9 or for 10. Do
> the chips care one way or the other? (For comparison, Intel uses 4.5
> dB, i.e. 9 in this notation, to mean "divide-by-3". That's what ath9k
> has now).

In my understanding the value is not related to the chip. It is used for
per-chain tx power reduction, in order to ensure regulatory compliance. Using 10
instead of 9 means that the overall tx power will be lower.

> Are you making it consistent with some other file that's not mentioned
> here? If not, why?

I'm tyring to make it consistent between ar9003_eeprom.c, eeprom_def.c and
eeprom_9287.c. The first two files uses 9, whereas eeprom_9287 uses 10.

Considering Felix's comment, I will update the patch and will use 9 instead of
10. Although that will replace the value in eeprom_9287.c, but that should not
cause problems, because the AR9287 does not supports 3x3.

>>  #define REDUCE_SCALED_POWER_BY_TWO_CHAIN     6  /* 10*log10(2)*2 */
>> -#define REDUCE_SCALED_POWER_BY_THREE_CHAIN   9  /* 10*log10(3)*2 */
>> +#define REDUCE_SCALED_POWER_BY_THREE_CHAIN   10 /* 10*log10(3)*2 */
>>  #define PWRINCR_3_TO_1_CHAIN      9             /* 10*log(3)*2 */
> 
> Why only change one of two 9s to a 10? Why not also PWRINCR_3_TO_1_CHAIN?

The PWRINCR_* symbols are not used anywhere and should be removed.

-Gabor

  reply	other threads:[~2012-04-15 17:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-14 20:01 [ath9k-devel] [PATCH 1/3] ath9k: use consistent value for REDUCE_SCALED_POWER_BY_THREE_CHAIN Gabor Juhos
2012-04-14 20:01 ` Gabor Juhos
2012-04-14 20:01 ` [ath9k-devel] [PATCH 2/3] ath9k: introduce ath9k_hw_get_scaled_power helper Gabor Juhos
2012-04-14 20:01   ` Gabor Juhos
2012-04-14 20:01 ` [ath9k-devel] [PATCH 3/3] ath9k: simplify ath9k_hw_get_scaled_power function Gabor Juhos
2012-04-14 20:01   ` Gabor Juhos
2012-04-14 22:11 ` [ath9k-devel] [PATCH 1/3] ath9k: use consistent value for REDUCE_SCALED_POWER_BY_THREE_CHAIN Daniel Halperin
2012-04-14 22:11   ` Daniel Halperin
2012-04-15 17:21   ` Gabor Juhos [this message]
2012-04-15 17:21     ` Gabor Juhos
2012-04-15 10:31 ` [ath9k-devel] " Felix Fietkau
2012-04-15 10:31   ` Felix Fietkau
2012-04-15 17:21   ` [ath9k-devel] " Gabor Juhos
2012-04-15 17:21     ` Gabor Juhos
2012-04-15 17:26     ` [ath9k-devel] " Felix Fietkau
2012-04-15 17:26       ` Felix Fietkau
2012-04-15 17:50       ` [ath9k-devel] " Gabor Juhos
2012-04-15 17:50         ` Gabor Juhos

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=4F8B03B4.8090501@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=ath9k-devel@lists.ath9k.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.