ath9k: Fix rd_ext EEPROM capability for AR9285
authorSujith <Sujith.Manoharan@atheros.com>
Thu, 12 Feb 2009 04:36:43 +0000 (10:06 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:51:43 +0000 (14:51 -0500)
AR9285 chipsets have a different EEPROM layout,
handle this appropriately when populating the rd_ext
capability.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/eeprom.h
drivers/net/wireless/ath9k/hw.c

index b7c656c84ba31a058664a9f8f965d4486b31a2c4..5c0d6c339fe9db8bc35a6a848406b608f29b132e 100644 (file)
 #define INCREASE_MAXPOW_BY_TWO_CHAIN     6  /* 10*log10(2)*2 */
 #define INCREASE_MAXPOW_BY_THREE_CHAIN   10 /* 10*log10(3)*2 */
 
+/*
+ * For AR9285 and later chipsets, the following bits are not being programmed
+ * in EEPROM and so need to be enabled always.
+ *
+ * Bit 0: en_fcc_mid
+ * Bit 1: en_jap_mid
+ * Bit 2: en_fcc_dfs_ht40
+ * Bit 3: en_jap_ht40
+ * Bit 4: en_jap_dfs_ht40
+ */
+#define AR9285_RDEXT_DEFAULT    0x1F
+
 #define AR_EEPROM_MAC(i)       (0x1d+(i))
 #define ATH9K_POW_SM(_r, _s)   (((_r) & 0x3f) << (_s))
 #define FREQ2FBIN(x, y)                ((y) ? ((x) - 2300) : (((x) - 4800) / 5))
index cad8e39c201eb6d3f3360b605ac0d100753363f6..55d5a7440942e7375606b76533c0600fd4eb2b6c 100644 (file)
@@ -3128,10 +3128,11 @@ bool ath9k_hw_fill_cap_info(struct ath_hw *ah)
        u16 capField = 0, eeval;
 
        eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
-
        ah->regulatory.current_rd = eeval;
 
        eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_1);
+       if (AR_SREV_9285_10_OR_LATER(ah))
+               eeval |= AR9285_RDEXT_DEFAULT;
        ah->regulatory.current_rd_ext = eeval;
 
        capField = ah->eep_ops->get_eeprom(ah, EEP_OP_CAP);