aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2009-08-26 11:38:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:51 -0400
commit1773912bd25196c2a3ca6c174574561363f43b2b (patch)
tree9e48b824bb5800f90c59bfa2a9a4d6437f230e2f /drivers/net/wireless/ath/ath9k/main.c
parentff155a45cea56ad7a90c3f5192db59a4c7812fde (diff)
ath9k: Add Bluetooth Coexistence 3-wire support
This patch adds 3-wire bluetooth coex support for AR9285. This support can be enabled through btcoex_enable modparam. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 215c67251f79..4fae699a53c2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -602,6 +602,10 @@ irqreturn_t ath_isr(int irq, void *dev)
602 sc->sc_flags |= SC_OP_WAIT_FOR_BEACON; 602 sc->sc_flags |= SC_OP_WAIT_FOR_BEACON;
603 } 603 }
604 604
605 if (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
606 if (status & ATH9K_INT_GENTIMER)
607 ath_gen_timer_isr(ah);
608
605chip_reset: 609chip_reset:
606 610
607 ath_debug_stat_interrupt(sc, status); 611 ath_debug_stat_interrupt(sc, status);
@@ -1279,6 +1283,10 @@ void ath_detach(struct ath_softc *sc)
1279 if (ATH_TXQ_SETUP(sc, i)) 1283 if (ATH_TXQ_SETUP(sc, i))
1280 ath_tx_cleanupq(sc, &sc->tx.txq[i]); 1284 ath_tx_cleanupq(sc, &sc->tx.txq[i]);
1281 1285
1286 if ((sc->btcoex_info.no_stomp_timer) &&
1287 sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
1288 ath_gen_timer_free(sc->sc_ah, sc->btcoex_info.no_stomp_timer);
1289
1282 ath9k_hw_detach(sc->sc_ah); 1290 ath9k_hw_detach(sc->sc_ah);
1283 sc->sc_ah = NULL; 1291 sc->sc_ah = NULL;
1284 ath9k_exit_debug(sc); 1292 ath9k_exit_debug(sc);
@@ -1509,8 +1517,11 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc)
1509 ARRAY_SIZE(ath9k_5ghz_chantable); 1517 ARRAY_SIZE(ath9k_5ghz_chantable);
1510 } 1518 }
1511 1519
1512 if (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_2WIRE) 1520 if (sc->btcoex_info.btcoex_scheme != ATH_BTCOEX_CFG_NONE) {
1513 ath9k_hw_btcoex_init(ah); 1521 r = ath9k_hw_btcoex_init(ah);
1522 if (r)
1523 goto bad2;
1524 }
1514 1525
1515 return 0; 1526 return 0;
1516bad2: 1527bad2:
@@ -1992,10 +2003,16 @@ static int ath9k_start(struct ieee80211_hw *hw)
1992 2003
1993 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); 2004 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
1994 2005
1995 if ((sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_2WIRE) && 2006 if ((sc->btcoex_info.btcoex_scheme != ATH_BTCOEX_CFG_NONE) &&
1996 !(sc->sc_flags & SC_OP_BTCOEX_ENABLED)) 2007 !(sc->sc_flags & SC_OP_BTCOEX_ENABLED)) {
2008 ath_btcoex_set_weight(&sc->btcoex_info, AR_BT_COEX_WGHT,
2009 AR_STOMP_LOW_WLAN_WGHT);
1997 ath9k_hw_btcoex_enable(sc->sc_ah); 2010 ath9k_hw_btcoex_enable(sc->sc_ah);
1998 2011
2012 if (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
2013 ath_btcoex_timer_resume(sc, &sc->btcoex_info);
2014 }
2015
1999mutex_unlock: 2016mutex_unlock:
2000 mutex_unlock(&sc->mutex); 2017 mutex_unlock(&sc->mutex);
2001 2018
@@ -2129,6 +2146,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
2129 return; /* another wiphy still in use */ 2146 return; /* another wiphy still in use */
2130 } 2147 }
2131 2148
2149 if (sc->sc_flags & SC_OP_BTCOEX_ENABLED) {
2150 ath9k_hw_btcoex_disable(sc->sc_ah);
2151 if (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
2152 ath_btcoex_timer_pause(sc, &sc->btcoex_info);
2153 }
2154
2132 /* make sure h/w will not generate any interrupt 2155 /* make sure h/w will not generate any interrupt
2133 * before setting the invalid flag. */ 2156 * before setting the invalid flag. */
2134 ath9k_hw_set_interrupts(sc->sc_ah, 0); 2157 ath9k_hw_set_interrupts(sc->sc_ah, 0);
@@ -2142,9 +2165,6 @@ static void ath9k_stop(struct ieee80211_hw *hw)
2142 2165
2143 wiphy_rfkill_stop_polling(sc->hw->wiphy); 2166 wiphy_rfkill_stop_polling(sc->hw->wiphy);
2144 2167
2145 if (sc->sc_flags & SC_OP_BTCOEX_ENABLED)
2146 ath9k_hw_btcoex_disable(sc->sc_ah);
2147
2148 /* disable HAL and put h/w to sleep */ 2168 /* disable HAL and put h/w to sleep */
2149 ath9k_hw_disable(sc->sc_ah); 2169 ath9k_hw_disable(sc->sc_ah);
2150 ath9k_hw_configpcipowersave(sc->sc_ah, 1); 2170 ath9k_hw_configpcipowersave(sc->sc_ah, 1);