ath9k: replaces SC_OP_BTCOEX_ENABLED with a bool
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 9 Sep 2009 20:44:23 +0000 (13:44 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:21 +0000 (16:39 -0400)
Whether or not bluetooth coex has been enabled is a hardware
state and only the hardware helpers will be able to set this.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/btcoex.c
drivers/net/wireless/ath/ath9k/btcoex.h
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/main.c

index f001cc26266098497f1e62b0215ff874173a5a73..891e71b10e5c3bb9de0d0d904a79aa13ae50f5a4 100644 (file)
@@ -532,7 +532,6 @@ struct ath_led {
 #define SC_OP_WAIT_FOR_PSPOLL_DATA BIT(17)
 #define SC_OP_WAIT_FOR_TX_ACK   BIT(18)
 #define SC_OP_BEACON_SYNC       BIT(19)
-#define SC_OP_BTCOEX_ENABLED    BIT(20)
 #define SC_OP_BT_PRIORITY_DETECTED BIT(21)
 
 struct ath_bus_ops {
index 61a8e1d95bb9c1ab3b9959923a5dcecf8869ff69..91befc78a15b66d06f59284d244fe4ab12219d2b 100644 (file)
@@ -164,7 +164,7 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah)
                (0x2 << (btcoex_info->btactive_gpio * 2)),
                (0x3 << (btcoex_info->btactive_gpio * 2)));
 
-       ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED;
+       ah->btcoex_info.enabled = true;
 }
 
 void ath9k_hw_btcoex_disable(struct ath_hw *ah)
@@ -182,5 +182,5 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah)
                REG_WRITE(ah, AR_BT_COEX_MODE2, 0);
        }
 
-       ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED;
+       ah->btcoex_info.enabled = false;
 }
index ed8d01d2f7629833495214c68ea5024d7769ef35..b2c3f766985203a94d879f3750fd83a91ff51305 100644 (file)
@@ -64,6 +64,7 @@ struct ath_btcoex_config {
 
 struct ath_btcoex_info {
        enum ath_btcoex_scheme btcoex_scheme;
+       bool enabled;
        u8 wlanactive_gpio;
        u8 btactive_gpio;
        u8 btpriority_gpio;
index 6e33aadc161c0f0ce4316449cdd8dea16b93efec..bbbd454fffef354004f5d44df276cd79082bc43b 100644 (file)
@@ -2578,7 +2578,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 #endif
        }
 
-       if (ah->ah_sc->sc_flags & SC_OP_BTCOEX_ENABLED)
+       if (ah->btcoex_info.enabled)
                ath9k_hw_btcoex_enable(ah);
 
        return 0;
index 9ac1ee0638f0bfff1a2073a994927ee750e720a7..cd1bc9c27527413aa2923ba6ab14dfcea387da8a 100644 (file)
@@ -2199,7 +2199,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
        ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
 
        if ((ah->btcoex_info.btcoex_scheme != ATH_BTCOEX_CFG_NONE) &&
-           !(sc->sc_flags & SC_OP_BTCOEX_ENABLED)) {
+           !ah->btcoex_info.enabled) {
                ath9k_hw_btcoex_init_weight(ah);
                ath9k_hw_btcoex_enable(ah);
 
@@ -2358,7 +2358,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
                return; /* another wiphy still in use */
        }
 
-       if (sc->sc_flags & SC_OP_BTCOEX_ENABLED) {
+       if (ah->btcoex_info.enabled) {
                ath9k_hw_btcoex_disable(ah);
                if (ah->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
                        ath9k_btcoex_timer_pause(sc);