aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-02-22 02:10:21 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:06:33 -0500
commit5908120fdc2aac0cb1be4059b40ec256d55934bc (patch)
tree6f1aa131a7884233f1689c4efe39aeae2d6a01d5 /drivers
parentd3c83ac12338509f37e95bffb19097a361a089a2 (diff)
ath9k: Move BTCOEX init/deinit functions to gpio.c
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c51
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c48
3 files changed, 54 insertions, 47 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 171ccf7c972f..aa609832e06f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -454,6 +454,8 @@ struct ath_btcoex {
454 struct ath_mci_profile mci; 454 struct ath_mci_profile mci;
455}; 455};
456 456
457int ath9k_init_btcoex(struct ath_softc *sc);
458void ath9k_deinit_btcoex(struct ath_softc *sc);
457int ath_init_btcoex_timer(struct ath_softc *sc); 459int ath_init_btcoex_timer(struct ath_softc *sc);
458void ath9k_btcoex_timer_resume(struct ath_softc *sc); 460void ath9k_btcoex_timer_resume(struct ath_softc *sc);
459void ath9k_btcoex_timer_pause(struct ath_softc *sc); 461void ath9k_btcoex_timer_pause(struct ath_softc *sc);
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 597c84e31adb..ef23624518b5 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -317,3 +317,54 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc)
317 317
318 btcoex->hw_timer_enabled = false; 318 btcoex->hw_timer_enabled = false;
319} 319}
320
321void ath9k_deinit_btcoex(struct ath_softc *sc)
322{
323 if ((sc->btcoex.no_stomp_timer) &&
324 ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE)
325 ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer);
326
327 if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_MCI)
328 ath_mci_cleanup(sc);
329}
330
331int ath9k_init_btcoex(struct ath_softc *sc)
332{
333 struct ath_txq *txq;
334 struct ath_hw *ah = sc->sc_ah;
335 int r;
336
337 switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) {
338 case ATH_BTCOEX_CFG_NONE:
339 break;
340 case ATH_BTCOEX_CFG_2WIRE:
341 ath9k_hw_btcoex_init_2wire(sc->sc_ah);
342 break;
343 case ATH_BTCOEX_CFG_3WIRE:
344 ath9k_hw_btcoex_init_3wire(sc->sc_ah);
345 r = ath_init_btcoex_timer(sc);
346 if (r)
347 return -1;
348 txq = sc->tx.txq_map[WME_AC_BE];
349 ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
350 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
351 break;
352 case ATH_BTCOEX_CFG_MCI:
353 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
354 sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE;
355 INIT_LIST_HEAD(&sc->btcoex.mci.info);
356
357 r = ath_mci_setup(sc);
358 if (r)
359 return r;
360
361 ath9k_hw_btcoex_init_mci(ah);
362
363 break;
364 default:
365 WARN_ON(1);
366 break;
367 }
368
369 return 0;
370}
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index a944fc95f69f..d8b05961f7e3 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -419,47 +419,6 @@ fail:
419 return error; 419 return error;
420} 420}
421 421
422static int ath9k_init_btcoex(struct ath_softc *sc)
423{
424 struct ath_txq *txq;
425 struct ath_hw *ah = sc->sc_ah;
426 int r;
427
428 switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) {
429 case ATH_BTCOEX_CFG_NONE:
430 break;
431 case ATH_BTCOEX_CFG_2WIRE:
432 ath9k_hw_btcoex_init_2wire(sc->sc_ah);
433 break;
434 case ATH_BTCOEX_CFG_3WIRE:
435 ath9k_hw_btcoex_init_3wire(sc->sc_ah);
436 r = ath_init_btcoex_timer(sc);
437 if (r)
438 return -1;
439 txq = sc->tx.txq_map[WME_AC_BE];
440 ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
441 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
442 break;
443 case ATH_BTCOEX_CFG_MCI:
444 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
445 sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE;
446 INIT_LIST_HEAD(&sc->btcoex.mci.info);
447
448 r = ath_mci_setup(sc);
449 if (r)
450 return r;
451
452 ath9k_hw_btcoex_init_mci(ah);
453
454 break;
455 default:
456 WARN_ON(1);
457 break;
458 }
459
460 return 0;
461}
462
463static int ath9k_init_queues(struct ath_softc *sc) 422static int ath9k_init_queues(struct ath_softc *sc)
464{ 423{
465 int i = 0; 424 int i = 0;
@@ -861,12 +820,7 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
861 if (sc->sbands[IEEE80211_BAND_5GHZ].channels) 820 if (sc->sbands[IEEE80211_BAND_5GHZ].channels)
862 kfree(sc->sbands[IEEE80211_BAND_5GHZ].channels); 821 kfree(sc->sbands[IEEE80211_BAND_5GHZ].channels);
863 822
864 if ((sc->btcoex.no_stomp_timer) && 823 ath9k_deinit_btcoex(sc);
865 ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE)
866 ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer);
867
868 if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_MCI)
869 ath_mci_cleanup(sc);
870 824
871 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) 825 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
872 if (ATH_TXQ_SETUP(sc, i)) 826 if (ATH_TXQ_SETUP(sc, i))