2009-01-12 11:58:43

by Helmut Schaa

[permalink] [raw]
Subject: [PATCH] ath5k: discard 11g caps if reported by an ar5211 eeprom

At least one ar5211 card (GIGABYTE GN-WLMA101, 168c:0012 subsystem
1458:e800) reports itself as 11g capable which seems to be a bug in the
eeprom. initvals.c assumes that ar5211 is only 11b capable and thus refuses
to initialize this card. Hence this patch changes the probing for 11g
capabilities to discard 11g capabilities for ar5211 cards which allows this
specific card to work fine in 11b and 11a modes.

Signed-off-by: Helmut Schaa <[email protected]>
---

Is anybody aware of 11g-capable ar5211 cards which would be limited by
this patch?

diff --git a/drivers/net/wireless/ath5k/caps.c b/drivers/net/wireless/ath5k/caps.c
index 150f5ed..367a6c7 100644
--- a/drivers/net/wireless/ath5k/caps.c
+++ b/drivers/net/wireless/ath5k/caps.c
@@ -85,7 +85,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
/* Enable 802.11b if a 2GHz capable radio (2111/5112) is
* connected */
if (AR5K_EEPROM_HDR_11B(ee_header) ||
- AR5K_EEPROM_HDR_11G(ee_header)) {
+ (AR5K_EEPROM_HDR_11G(ee_header) &&
+ ah->ah_version != AR5K_AR5211)) {
/* 2312 */
ah->ah_capabilities.cap_range.range_2ghz_min = 2412;
ah->ah_capabilities.cap_range.range_2ghz_max = 2732;
@@ -94,7 +95,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
__set_bit(AR5K_MODE_11B,
ah->ah_capabilities.cap_mode);

- if (AR5K_EEPROM_HDR_11G(ee_header))
+ if (AR5K_EEPROM_HDR_11G(ee_header) &&
+ ah->ah_version != AR5K_AR5211)
__set_bit(AR5K_MODE_11G,
ah->ah_capabilities.cap_mode);
}


2009-01-12 17:05:09

by Nick Kossifidis

[permalink] [raw]
Subject: Re: [PATCH] ath5k: discard 11g caps if reported by an ar5211 eeprom

2009/1/12 Helmut Schaa <[email protected]>:
> Am Montag, 12. Januar 2009 schrieb Nick Kossifidis:
>> 2009/1/12 Helmut Schaa <[email protected]>:
>> > At least one ar5211 card (GIGABYTE GN-WLMA101, 168c:0012 subsystem
>> > 1458:e800) reports itself as 11g capable which seems to be a bug in the
>> > eeprom. initvals.c assumes that ar5211 is only 11b capable and thus refuses
>> > to initialize this card. Hence this patch changes the probing for 11g
>> > capabilities to discard 11g capabilities for ar5211 cards which allows this
>> > specific card to work fine in 11b and 11a modes.
>> >
>> > Signed-off-by: Helmut Schaa <[email protected]>
>> > ---
>> >
>> > Is anybody aware of 11g-capable ar5211 cards which would be limited by
>> > this patch?
>
> [...]
>
>> This should be O.K. for now but i think AR5211 supports the so called
>> "pureg" mode which means ofdm only g (no cck headers etc).
>
> Sounds reasonable, yes.
>
>> It seems
>> radio (RF5111) supports g mode (it can be found on AR5212 abg cards)
>
> I guess you mean RF2111, right? RF5111 should be 11a.
>
> I've just found a product sheet at [1] that states that the RF2111
> supports "802.11g draft standard". I guess that's exactly what you've
> described as "pureg" mode.
>
> Thanks,
> Helmut
>
> [1] ftp://ftp.riss-telecom.ru/pub/wireless/doc/atheros/AR5001X.pdf
>

RF5111 is the RF chip, RF2111 is a frequency converter with cck
support, check this out..
http://www.hotchips.org/archives/hc14/3_Tue/16_mcfarland.pdf

--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2009-01-12 16:40:57

by Helmut Schaa

[permalink] [raw]
Subject: Re: [PATCH] ath5k: discard 11g caps if reported by an ar5211 eeprom

Am Montag, 12. Januar 2009 schrieb Nick Kossifidis:
> 2009/1/12 Helmut Schaa <[email protected]>:
> > At least one ar5211 card (GIGABYTE GN-WLMA101, 168c:0012 subsystem
> > 1458:e800) reports itself as 11g capable which seems to be a bug in the
> > eeprom. initvals.c assumes that ar5211 is only 11b capable and thus refuses
> > to initialize this card. Hence this patch changes the probing for 11g
> > capabilities to discard 11g capabilities for ar5211 cards which allows this
> > specific card to work fine in 11b and 11a modes.
> >
> > Signed-off-by: Helmut Schaa <[email protected]>
> > ---
> >
> > Is anybody aware of 11g-capable ar5211 cards which would be limited by
> > this patch?

[...]

> This should be O.K. for now but i think AR5211 supports the so called
> "pureg" mode which means ofdm only g (no cck headers etc).

Sounds reasonable, yes.

> It seems
> radio (RF5111) supports g mode (it can be found on AR5212 abg cards)

I guess you mean RF2111, right? RF5111 should be 11a.

I've just found a product sheet at [1] that states that the RF2111
supports "802.11g draft standard". I guess that's exactly what you've
described as "pureg" mode.

Thanks,
Helmut

[1] ftp://ftp.riss-telecom.ru/pub/wireless/doc/atheros/AR5001X.pdf

2009-01-12 18:29:57

by Helmut Schaa

[permalink] [raw]
Subject: Re: [PATCH] ath5k: discard 11g caps if reported by an ar5211 eeprom

Am Montag, 12. Januar 2009 schrieb Nick Kossifidis:
> RF5111 is the RF chip, RF2111 is a frequency converter with cck
> support, check this out..
> http://www.hotchips.org/archives/hc14/3_Tue/16_mcfarland.pdf

I see! Thanks for the link.

Helmut

2009-01-12 16:25:53

by Nick Kossifidis

[permalink] [raw]
Subject: Re: [PATCH] ath5k: discard 11g caps if reported by an ar5211 eeprom

2009/1/12 Helmut Schaa <[email protected]>:
> At least one ar5211 card (GIGABYTE GN-WLMA101, 168c:0012 subsystem
> 1458:e800) reports itself as 11g capable which seems to be a bug in the
> eeprom. initvals.c assumes that ar5211 is only 11b capable and thus refuses
> to initialize this card. Hence this patch changes the probing for 11g
> capabilities to discard 11g capabilities for ar5211 cards which allows this
> specific card to work fine in 11b and 11a modes.
>
> Signed-off-by: Helmut Schaa <[email protected]>
> ---
>
> Is anybody aware of 11g-capable ar5211 cards which would be limited by
> this patch?
>
> diff --git a/drivers/net/wireless/ath5k/caps.c b/drivers/net/wireless/ath5k/caps.c
> index 150f5ed..367a6c7 100644
> --- a/drivers/net/wireless/ath5k/caps.c
> +++ b/drivers/net/wireless/ath5k/caps.c
> @@ -85,7 +85,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
> /* Enable 802.11b if a 2GHz capable radio (2111/5112) is
> * connected */
> if (AR5K_EEPROM_HDR_11B(ee_header) ||
> - AR5K_EEPROM_HDR_11G(ee_header)) {
> + (AR5K_EEPROM_HDR_11G(ee_header) &&
> + ah->ah_version != AR5K_AR5211)) {
> /* 2312 */
> ah->ah_capabilities.cap_range.range_2ghz_min = 2412;
> ah->ah_capabilities.cap_range.range_2ghz_max = 2732;
> @@ -94,7 +95,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
> __set_bit(AR5K_MODE_11B,
> ah->ah_capabilities.cap_mode);
>
> - if (AR5K_EEPROM_HDR_11G(ee_header))
> + if (AR5K_EEPROM_HDR_11G(ee_header) &&
> + ah->ah_version != AR5K_AR5211)
> __set_bit(AR5K_MODE_11G,
> ah->ah_capabilities.cap_mode);
> }
>

This should be O.K. for now but i think AR5211 supports the so called
"pureg" mode which means ofdm only g (no cck headers etc). It seems
radio (RF5111) supports g mode (it can be found on AR5212 abg cards)
but baseband doesn't support dynamic cck/ofdm switching. This bit on
your eeprom might indicate the pureg capability. Since we don't handle
this yet it's ok to skip it and use only b mode.

--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick