ath5k: discard 11g caps if reported by an ar5211 eeprom
authorHelmut Schaa <helmut.schaa@googlemail.com>
Mon, 12 Jan 2009 12:04:06 +0000 (13:04 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 21:00:26 +0000 (16:00 -0500)
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 <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath5k/caps.c

index 150f5ed..367a6c7 100644 (file)
@@ -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);
                }