aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/mci.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-12-17 10:47:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-19 14:46:55 -0500
commit8a30930563521c9dba73c93b5631be1d0993f78f (patch)
tree859d5bd92689fc934aa6c7eea98f1d37891fb293 /drivers/net/wireless/ath/ath9k/mci.c
parent104cfa881006c18af9b118e1631dcf1f8378994a (diff)
ath9k_hw: make bluetooth coexistence support optional at compile time
Many systems (e.g. embedded systems) do not have wifi modules connected to bluetooth modules, so bluetooth coexistence is irrelevant there. With the addition of MCI support, ath9k picked up quite a bit of extra code that can be compiled out this way. This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for querying the bluetooth coexistence scheme, allowing the compiler to eliminate code that uses it, with only very little use of #ifdef. On MIPS this reduces the total size for the modules by about 20k. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/mci.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/mci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index ca9b53cc4001..fee8c6f0b251 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -417,6 +417,9 @@ int ath_mci_setup(struct ath_softc *sc)
417 struct ath_mci_coex *mci = &sc->mci_coex; 417 struct ath_mci_coex *mci = &sc->mci_coex;
418 int error = 0; 418 int error = 0;
419 419
420 if (!ATH9K_HW_CAP_MCI)
421 return 0;
422
420 mci->sched_buf.bf_len = ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE; 423 mci->sched_buf.bf_len = ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE;
421 424
422 if (ath_mci_buf_alloc(sc, &mci->sched_buf)) { 425 if (ath_mci_buf_alloc(sc, &mci->sched_buf)) {
@@ -450,6 +453,9 @@ void ath_mci_cleanup(struct ath_softc *sc)
450 struct ath_hw *ah = sc->sc_ah; 453 struct ath_hw *ah = sc->sc_ah;
451 struct ath_mci_coex *mci = &sc->mci_coex; 454 struct ath_mci_coex *mci = &sc->mci_coex;
452 455
456 if (!ATH9K_HW_CAP_MCI)
457 return;
458
453 /* 459 /*
454 * both schedule and gpm buffers will be released 460 * both schedule and gpm buffers will be released
455 */ 461 */
@@ -468,6 +474,9 @@ void ath_mci_intr(struct ath_softc *sc)
468 u32 more_data = MCI_GPM_MORE; 474 u32 more_data = MCI_GPM_MORE;
469 bool skip_gpm = false; 475 bool skip_gpm = false;
470 476
477 if (!ATH9K_HW_CAP_MCI)
478 return;
479
471 ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg); 480 ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg);
472 481
473 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) { 482 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) {