]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/ath5k/reset.c
Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / ath5k / reset.c
index 953ba3b19ff73a8409a10c92f8f368af96d9b713..1b6d45b6772db39c269752e1b5bbef4e328d6389 100644 (file)
@@ -537,19 +537,20 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
                mdelay(1);
 
                /*
-                * Write some more initial register settings
+                * Write some more initial register settings for revised chips
                 */
-               if (ah->ah_version == AR5K_AR5212) {
+               if (ah->ah_version == AR5K_AR5212 &&
+                   ah->ah_phy_revision > 0x41) {
                        ath5k_hw_reg_write(ah, 0x0002a002, 0x982c);
 
                        if (channel->hw_value == CHANNEL_G)
-                               if (ah->ah_mac_srev < AR5K_SREV_VER_AR2413)
+                               if (ah->ah_mac_srev < AR5K_SREV_AR2413)
                                        ath5k_hw_reg_write(ah, 0x00f80d80,
                                                                0x994c);
-                               else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2424)
+                               else if (ah->ah_mac_srev < AR5K_SREV_AR5424)
                                        ath5k_hw_reg_write(ah, 0x00380140,
                                                                0x994c);
-                               else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2425)
+                               else if (ah->ah_mac_srev < AR5K_SREV_AR2425)
                                        ath5k_hw_reg_write(ah, 0x00fc0ec0,
                                                                0x994c);
                                else /* 2425 */
@@ -558,19 +559,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
                        else
                                ath5k_hw_reg_write(ah, 0x00000000, 0x994c);
 
-                       /* Some bits are disabled here, we know nothing about
-                        * register 0xa228 yet, most of the times this ends up
-                        * with a value 0x9b5 -haven't seen any dump with
-                        * a different value- */
-                       /* Got this from decompiling binary HAL */
-                       data = ath5k_hw_reg_read(ah, 0xa228);
-                       data &= 0xfffffdff;
-                       ath5k_hw_reg_write(ah, data, 0xa228);
-
-                       data = ath5k_hw_reg_read(ah, 0xa228);
-                       data &= 0xfffe03ff;
-                       ath5k_hw_reg_write(ah, data, 0xa228);
-                       data = 0;
+                       /* Got this from legacy-hal */
+                       AR5K_REG_DISABLE_BITS(ah, 0xa228, 0x200);
+
+                       AR5K_REG_MASKED_BITS(ah, 0xa228, 0x800, 0xfffe03ff);
 
                        /* Just write 0x9b5 ? */
                        /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */
@@ -915,7 +907,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
                ath5k_hw_reg_write(ah, 0x000100aa, 0x8118);
                ath5k_hw_reg_write(ah, 0x00003210, 0x811c);
                ath5k_hw_reg_write(ah, 0x00000052, 0x8108);
-               if (ah->ah_mac_srev >= AR5K_SREV_VER_AR2413)
+               if (ah->ah_mac_srev >= AR5K_SREV_AR2413)
                        ath5k_hw_reg_write(ah, 0x00000004, 0x8120);
        }