]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath9k_hw: fix antenna diversity on AR9285
authorFelix Fietkau <nbd@openwrt.org>
Sun, 11 Jul 2010 10:48:39 +0000 (12:48 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:15:32 +0000 (16:15 -0400)
commit 601e0cb165e65dc185b31fe7ebd2c0169ea47306 upstream.

On AR9285, the antenna switch configuration register uses more than just
16 bits. Because of an arbitrary mask applied to the EEPROM value that
stores this configuration, diversity was broken in some cases, leading
to a significant degradation in signal strength.
Fix this by changing the callback to return a 32 bit value and remove
the arbitrary mask.

[PG: drop ar9003_eeprom.c change; v2.6.34 doesn't have it yet]

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/net/wireless/ath/ath9k/eeprom.h
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c

index 104e3ead13f14c012826fb2c95f08d03ac56c943..b64b3e526c7cd571fc46115e19845ffa8417f62f 100644 (file)
@@ -670,7 +670,7 @@ struct eeprom_ops {
        int (*get_eeprom_ver)(struct ath_hw *hw);
        int (*get_eeprom_rev)(struct ath_hw *hw);
        u8 (*get_num_ant_config)(struct ath_hw *hw, enum ieee80211_band band);
-       u16 (*get_eeprom_antenna_cfg)(struct ath_hw *hw,
+       u32 (*get_eeprom_antenna_cfg)(struct ath_hw *hw,
                                      struct ath9k_channel *chan);
        void (*set_board_values)(struct ath_hw *hw, struct ath9k_channel *chan);
        void (*set_addac)(struct ath_hw *hw, struct ath9k_channel *chan);
index 68db16690abf962237d9e10044873a8da44db9bc..73cd4dbfe8af8af9a66b10cc592ba75bddb81b69 100644 (file)
@@ -1138,13 +1138,13 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
        }
 }
 
-static u16 ath9k_hw_4k_get_eeprom_antenna_cfg(struct ath_hw *ah,
+static u32 ath9k_hw_4k_get_eeprom_antenna_cfg(struct ath_hw *ah,
                                              struct ath9k_channel *chan)
 {
        struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
        struct modal_eep_4k_header *pModal = &eep->modalHeader;
 
-       return pModal->antCtrlCommon & 0xFFFF;
+       return pModal->antCtrlCommon;
 }
 
 static u8 ath9k_hw_4k_get_num_ant_config(struct ath_hw *ah,
index 839d05a1df29f1c9d807ffceacace1ee1f276fc2..c6f77ce06f0584191b614abde93bbac777a0f22c 100644 (file)
@@ -1130,13 +1130,13 @@ static u8 ath9k_hw_AR9287_get_num_ant_config(struct ath_hw *ah,
        return 1;
 }
 
-static u16 ath9k_hw_AR9287_get_eeprom_antenna_cfg(struct ath_hw *ah,
+static u32 ath9k_hw_AR9287_get_eeprom_antenna_cfg(struct ath_hw *ah,
                                                  struct ath9k_channel *chan)
 {
        struct ar9287_eeprom *eep = &ah->eeprom.map9287;
        struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
 
-       return pModal->antCtrlCommon & 0xFFFF;
+       return pModal->antCtrlCommon;
 }
 
 static u16 ath9k_hw_AR9287_get_spur_channel(struct ath_hw *ah,
index 1644b1a465e2f74c6a52cfaef6e5238419a28af7..e61823eaec35661407e22e65210862c54df34add 100644 (file)
@@ -1431,14 +1431,14 @@ static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah,
        return num_ant_config;
 }
 
-static u16 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,
+static u32 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,
                                               struct ath9k_channel *chan)
 {
        struct ar5416_eeprom_def *eep = &ah->eeprom.def;
        struct modal_eep_header *pModal =
                &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
 
-       return pModal->antCtrlCommon & 0xFFFF;
+       return pModal->antCtrlCommon;
 }
 
 static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)