linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ath9k: Make AR_SREV_5416() macro evaluate to true for AR9100
@ 2010-02-27 17:26 Björn Smedman
  2010-02-27 17:47 ` Felix Fietkau
  0 siblings, 1 reply; 4+ messages in thread
From: Björn Smedman @ 2010-02-27 17:26 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luis R. Rodriguez

The AR_SREV_5416() macro evaluates to false for AR9100 while the
definitions for AR_SREV_5416_20_OR_LATER() and
AR_SREV_5416_22_OR_LATER() seem to assume AR9100 based chips fall
under this category. For example the last line of

#define AR_SREV_5416_20_OR_LATER(_ah) \
        (((AR_SREV_5416(_ah)) && \
         ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \
         ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))

makes no sense if AR_SREV_5416(_ah) is false when
(_ah)->hw_version.macVersion == AR_SREV_VERSION_9100.

The patch below changes AR_SREV_5416() to evaluate to true also for
AR9100. I've tested on an AR9100 based router with this patch and
haven't noticed any more problems than usual. Many code paths are
affected though so please comment.

/Björn
---
diff --git a/drivers/net/wireless/ath/ath9k/reg.h
b/drivers/net/wireless/ath/ath9k/reg.h
index 72cfa8e..39f7d66 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -762,7 +762,8 @@

 #define AR_SREV_5416(_ah) \
        (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI) || \
-        ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE))
+        ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
+        ((_ah)->hw_version.macVersion == AR_SREV_VERSION_9100))
 #define AR_SREV_5416_20_OR_LATER(_ah) \
        (((AR_SREV_5416(_ah)) && \
         ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC] ath9k: Make AR_SREV_5416() macro evaluate to true for AR9100
  2010-02-27 17:26 [RFC] ath9k: Make AR_SREV_5416() macro evaluate to true for AR9100 Björn Smedman
@ 2010-02-27 17:47 ` Felix Fietkau
  2010-02-27 18:54   ` Björn Smedman
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Fietkau @ 2010-02-27 17:47 UTC (permalink / raw)
  To: Björn Smedman; +Cc: linux-wireless, Luis R. Rodriguez

On 2010-02-27 6:26 PM, Björn Smedman wrote:
> The AR_SREV_5416() macro evaluates to false for AR9100 while the
> definitions for AR_SREV_5416_20_OR_LATER() and
> AR_SREV_5416_22_OR_LATER() seem to assume AR9100 based chips fall
> under this category. For example the last line of
> 
> #define AR_SREV_5416_20_OR_LATER(_ah) \
>         (((AR_SREV_5416(_ah)) && \
>          ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \
>          ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
> 
> makes no sense if AR_SREV_5416(_ah) is false when
> (_ah)->hw_version.macVersion == AR_SREV_VERSION_9100.
I think this is wrong. The AR_SREV_xxxx macros typically point to a
specific chip generation, whereas the AR_SREV_XXXX_OR_LATER() point to
the chip generation or any later.
AR9100 is related to AR9160, but not AR5416, so AR_SREV_5416() should
return false for 9100 based devices.
If you look at the AR_SREV_5416_20_OR_LATER macros, they do not assume
that AR_SREV_5416() evaluates to true for the
((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) case, as it's
either (is 5416 && macRev >= 20) or macVersion > 9100

- Felix

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] ath9k: Make AR_SREV_5416() macro evaluate to true for AR9100
  2010-02-27 17:47 ` Felix Fietkau
@ 2010-02-27 18:54   ` Björn Smedman
  2010-02-27 19:09     ` Felix Fietkau
  0 siblings, 1 reply; 4+ messages in thread
From: Björn Smedman @ 2010-02-27 18:54 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, Luis R. Rodriguez

Oops, I got those parenthesis mixed up. You are right. My bad.

But is AR9100 really not AR5416 based? For instance the devid define
is named AR5416_AR9100_DEVID and the original firmware reports the
chipset as

  ath_hal: 0.9.17.1 (AR5416, DEBUG, REGOPS_FUNC, WRITE_EEPROM, 11D)

Confusing, but you are probably right.

/Björn

2010/2/27 Felix Fietkau <nbd@openwrt.org>:
> On 2010-02-27 6:26 PM, Björn Smedman wrote:
>> The AR_SREV_5416() macro evaluates to false for AR9100 while the
>> definitions for AR_SREV_5416_20_OR_LATER() and
>> AR_SREV_5416_22_OR_LATER() seem to assume AR9100 based chips fall
>> under this category. For example the last line of
>>
>> #define AR_SREV_5416_20_OR_LATER(_ah) \
>>         (((AR_SREV_5416(_ah)) && \
>>          ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \
>>          ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
>>
>> makes no sense if AR_SREV_5416(_ah) is false when
>> (_ah)->hw_version.macVersion == AR_SREV_VERSION_9100.
> I think this is wrong. The AR_SREV_xxxx macros typically point to a
> specific chip generation, whereas the AR_SREV_XXXX_OR_LATER() point to
> the chip generation or any later.
> AR9100 is related to AR9160, but not AR5416, so AR_SREV_5416() should
> return false for 9100 based devices.
> If you look at the AR_SREV_5416_20_OR_LATER macros, they do not assume
> that AR_SREV_5416() evaluates to true for the
> ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) case, as it's
> either (is 5416 && macRev >= 20) or macVersion > 9100
>
> - Felix
>



-- 
Venatech AB
Ideon Innovation
Ole Römers väg 12
SE-22370 LUND
Sweden

+46 (0) 46 286 86 20
info@venatech.se
http://www.venatech.se

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] ath9k: Make AR_SREV_5416() macro evaluate to true for AR9100
  2010-02-27 18:54   ` Björn Smedman
@ 2010-02-27 19:09     ` Felix Fietkau
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Fietkau @ 2010-02-27 19:09 UTC (permalink / raw)
  To: Björn Smedman; +Cc: linux-wireless, Luis R. Rodriguez

On 2010-02-27 7:54 PM, Björn Smedman wrote:
> Oops, I got those parenthesis mixed up. You are right. My bad.
> 
> But is AR9100 really not AR5416 based? For instance the devid define
> is named AR5416_AR9100_DEVID and the original firmware reports the
> chipset as
> 
>   ath_hal: 0.9.17.1 (AR5416, DEBUG, REGOPS_FUNC, WRITE_EEPROM, 11D)
> 
> Confusing, but you are probably right.
Let's say it's 'loosely' based on AR5416. There are three currently
available chip generations of the 11n stuff: 5416, 9160, 9280.
The WiSoC stuff (named 9100, but it's typically 913x) belongs to 9160.

- Felix

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-27 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-27 17:26 [RFC] ath9k: Make AR_SREV_5416() macro evaluate to true for AR9100 Björn Smedman
2010-02-27 17:47 ` Felix Fietkau
2010-02-27 18:54   ` Björn Smedman
2010-02-27 19:09     ` Felix Fietkau

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).