aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2009-08-26 11:38:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:48 -0400
commitf985ad12b595094839fddaf757fcf5d853ed3d7f (patch)
treef485fc5812004b9d7261e4b87882480ce247e232 /drivers/net/wireless/ath
parent4a7f13eef508012bd1b0ffbb24b807e3494f31cd (diff)
ath9k: Split ath9k_hw_btcoex_enable() into two logical pieces
This function currently does initialization + enable the btcoex support. Split it into two logical functions which does the above operations separately. Btcoex initialization is done during attach time and enabling this feature is done in start(). Also, add code to disable btcoex support in stop(). Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c11
4 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 7705da1103f4..086880083360 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -521,6 +521,7 @@ struct ath_led {
521#define SC_OP_WAIT_FOR_PSPOLL_DATA BIT(17) 521#define SC_OP_WAIT_FOR_PSPOLL_DATA BIT(17)
522#define SC_OP_WAIT_FOR_TX_ACK BIT(18) 522#define SC_OP_WAIT_FOR_TX_ACK BIT(18)
523#define SC_OP_BEACON_SYNC BIT(19) 523#define SC_OP_BEACON_SYNC BIT(19)
524#define SC_OP_BTCOEX_ENABLED BIT(20)
524 525
525struct ath_bus_ops { 526struct ath_bus_ops {
526 void (*read_cachesize)(struct ath_softc *sc, int *csz); 527 void (*read_cachesize)(struct ath_softc *sc, int *csz);
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 4f3d5ea34812..d81e826b682a 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -4073,7 +4073,7 @@ void ath9k_hw_set11nmac2040(struct ath_hw *ah, enum ath9k_ht_macmode mode)
4073/* Bluetooth Coexistence */ 4073/* Bluetooth Coexistence */
4074/***************************/ 4074/***************************/
4075 4075
4076void ath9k_hw_btcoex_enable(struct ath_hw *ah) 4076void ath9k_hw_btcoex_init(struct ath_hw *ah)
4077{ 4077{
4078 /* connect bt_active to baseband */ 4078 /* connect bt_active to baseband */
4079 REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, 4079 REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL,
@@ -4090,8 +4090,23 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah)
4090 4090
4091 /* Configure the desired gpio port for input */ 4091 /* Configure the desired gpio port for input */
4092 ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio); 4092 ath9k_hw_cfg_gpio_input(ah, ah->btactive_gpio);
4093}
4093 4094
4095void ath9k_hw_btcoex_enable(struct ath_hw *ah)
4096{
4094 /* Configure the desired GPIO port for TX_FRAME output */ 4097 /* Configure the desired GPIO port for TX_FRAME output */
4095 ath9k_hw_cfg_output(ah, ah->wlanactive_gpio, 4098 ath9k_hw_cfg_output(ah, ah->wlanactive_gpio,
4096 AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); 4099 AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
4100
4101 ah->ah_sc->sc_flags |= SC_OP_BTCOEX_ENABLED;
4102}
4103
4104void ath9k_hw_btcoex_disable(struct ath_hw *ah)
4105{
4106 ath9k_hw_set_gpio(ah, ah->wlanactive_gpio, 0);
4107
4108 ath9k_hw_cfg_output(ah, ah->wlanactive_gpio,
4109 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
4110
4111 ah->ah_sc->sc_flags &= ~SC_OP_BTCOEX_ENABLED;
4097} 4112}
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index b24150a1b4ad..e634cb448ca0 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -614,6 +614,8 @@ bool ath9k_hw_intrpend(struct ath_hw *ah);
614bool ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked); 614bool ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked);
615enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints); 615enum ath9k_int ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints);
616 616
617void ath9k_hw_btcoex_init(struct ath_hw *ah);
617void ath9k_hw_btcoex_enable(struct ath_hw *ah); 618void ath9k_hw_btcoex_enable(struct ath_hw *ah);
619void ath9k_hw_btcoex_disable(struct ath_hw *ah);
618 620
619#endif 621#endif
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index eb8d673cde59..878d3be7c717 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1509,8 +1509,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc)
1509 ARRAY_SIZE(ath9k_5ghz_chantable); 1509 ARRAY_SIZE(ath9k_5ghz_chantable);
1510 } 1510 }
1511 1511
1512 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) 1512 if (ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX)
1513 ath9k_hw_btcoex_enable(sc->sc_ah); 1513 ath9k_hw_btcoex_init(ah);
1514 1514
1515 return 0; 1515 return 0;
1516bad2: 1516bad2:
@@ -1992,6 +1992,10 @@ static int ath9k_start(struct ieee80211_hw *hw)
1992 1992
1993 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); 1993 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
1994 1994
1995 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) &&
1996 !(sc->sc_flags & SC_OP_BTCOEX_ENABLED))
1997 ath9k_hw_btcoex_enable(sc->sc_ah);
1998
1995mutex_unlock: 1999mutex_unlock:
1996 mutex_unlock(&sc->mutex); 2000 mutex_unlock(&sc->mutex);
1997 2001
@@ -2138,6 +2142,9 @@ static void ath9k_stop(struct ieee80211_hw *hw)
2138 2142
2139 wiphy_rfkill_stop_polling(sc->hw->wiphy); 2143 wiphy_rfkill_stop_polling(sc->hw->wiphy);
2140 2144
2145 if (sc->sc_flags & SC_OP_BTCOEX_ENABLED)
2146 ath9k_hw_btcoex_disable(sc->sc_ah);
2147
2141 /* disable HAL and put h/w to sleep */ 2148 /* disable HAL and put h/w to sleep */
2142 ath9k_hw_disable(sc->sc_ah); 2149 ath9k_hw_disable(sc->sc_ah);
2143 ath9k_hw_configpcipowersave(sc->sc_ah, 1); 2150 ath9k_hw_configpcipowersave(sc->sc_ah, 1);