ath5k: more RF2413 stuff
authorNick Kossifidis <mickflemm@gmail.com>
Thu, 28 Feb 2008 19:50:50 +0000 (14:50 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 7 Mar 2008 21:02:58 +0000 (16:02 -0500)
 * Add AR5K_RF2413 to radio check during hw_reset so it doesn't complain

 * Write ah_phy_spending value we set during attach instead of checking
each time for radio revision

 * Skip txpower setup for RF2413 because it can't transmit with it
(weird thing is that RF5413 has no problem with it).

Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath5k/hw.c
drivers/net/wireless/ath5k/phy.c

index f4d383e956a00a9b274ffaa1d02ec1596566308a..bd1513d1460b5f4d6a04a73d7d1f3775ed8b7e13 100644 (file)
@@ -640,7 +640,8 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
        if (ah->ah_version != AR5K_AR5210) {
                if (ah->ah_radio != AR5K_RF5111 &&
                        ah->ah_radio != AR5K_RF5112 &&
-                       ah->ah_radio != AR5K_RF5413) {
+                       ah->ah_radio != AR5K_RF5413 &&
+                       ah->ah_radio != AR5K_RF2413) {
                        ATH5K_ERR(ah->ah_sc,
                                "invalid phy radio: %u\n", ah->ah_radio);
                        return -EINVAL;
@@ -1002,9 +1003,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
                ath5k_hw_reg_write(ah, AR5K_PHY_SCAL_32MHZ, AR5K_PHY_SCAL);
                ath5k_hw_reg_write(ah, AR5K_PHY_SCLOCK_32MHZ, AR5K_PHY_SCLOCK);
                ath5k_hw_reg_write(ah, AR5K_PHY_SDELAY_32MHZ, AR5K_PHY_SDELAY);
-               ath5k_hw_reg_write(ah, ah->ah_radio == AR5K_RF5111 ?
-                       AR5K_PHY_SPENDING_RF5111 : AR5K_PHY_SPENDING_RF5112,
-                       AR5K_PHY_SPENDING);
+               ath5k_hw_reg_write(ah, ah->ah_phy_spending, AR5K_PHY_SPENDING);
        }
 
        /*
index f108b08ff4af570e779b988224356c5fd990a87b..40efd4d3b54c95c456c43a834eed132e41b33f12 100644 (file)
@@ -2178,6 +2178,15 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
                return -EINVAL;
        }
 
+       /*
+        * RF2413 for some reason can't
+        * transmit anything if we call
+        * this funtion, so we skip it
+        * until we fix txpower.
+        */
+       if (ah->ah_radio == AR5K_RF2413)
+               return 0;
+
        /* Reset TX power values */
        memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
        ah->ah_txpower.txp_tpc = tpc;