aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-02-22 02:11:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-27 14:06:39 -0500
commit9a15858f0cb9432e29db08dd936c39d20019a484 (patch)
treeddfe9c637485e5fb96e3ef6de8cd6237e7d0ca15 /drivers/net/wireless/ath
parent64ab38df6e8ac8e56f38c49d26578fae2fb808f8 (diff)
ath9k: Remove ATH9K_HW_CAP_MCI checks
With the ability to remove BTCOEX support at compile time, these checks are no longer needed. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.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/ar9003_mci.c54
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/mci.c9
4 files changed, 1 insertions, 68 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index b9652f6e5a4f..4079676fe692 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -86,9 +86,6 @@ static void ar9003_mci_remote_reset(struct ath_hw *ah, bool wait_done)
86{ 86{
87 u32 payload[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00}; 87 u32 payload[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00};
88 88
89 if (!ATH9K_HW_CAP_MCI)
90 return;
91
92 ar9003_mci_send_message(ah, MCI_REMOTE_RESET, 0, payload, 16, 89 ar9003_mci_send_message(ah, MCI_REMOTE_RESET, 0, payload, 16,
93 wait_done, false); 90 wait_done, false);
94 udelay(5); 91 udelay(5);
@@ -98,9 +95,6 @@ static void ar9003_mci_send_lna_transfer(struct ath_hw *ah, bool wait_done)
98{ 95{
99 u32 payload = 0x00000000; 96 u32 payload = 0x00000000;
100 97
101 if (!ATH9K_HW_CAP_MCI)
102 return;
103
104 ar9003_mci_send_message(ah, MCI_LNA_TRANS, 0, &payload, 1, 98 ar9003_mci_send_message(ah, MCI_LNA_TRANS, 0, &payload, 1,
105 wait_done, false); 99 wait_done, false);
106} 100}
@@ -114,9 +108,6 @@ static void ar9003_mci_send_req_wake(struct ath_hw *ah, bool wait_done)
114 108
115static void ar9003_mci_send_sys_waking(struct ath_hw *ah, bool wait_done) 109static void ar9003_mci_send_sys_waking(struct ath_hw *ah, bool wait_done)
116{ 110{
117 if (!ATH9K_HW_CAP_MCI)
118 return;
119
120 ar9003_mci_send_message(ah, MCI_SYS_WAKING, MCI_FLAG_DISABLE_TIMESTAMP, 111 ar9003_mci_send_message(ah, MCI_SYS_WAKING, MCI_FLAG_DISABLE_TIMESTAMP,
121 NULL, 0, wait_done, false); 112 NULL, 0, wait_done, false);
122} 113}
@@ -230,9 +221,6 @@ static void ar9003_mci_send_coex_halt_bt_gpm(struct ath_hw *ah, bool halt,
230 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 221 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
231 u32 payload[4] = {0, 0, 0, 0}; 222 u32 payload[4] = {0, 0, 0, 0};
232 223
233 if (!ATH9K_HW_CAP_MCI)
234 return;
235
236 ath_dbg(common, MCI, "MCI Send Coex %s BT GPM\n", 224 ath_dbg(common, MCI, "MCI Send Coex %s BT GPM\n",
237 (halt) ? "halt" : "unhalt"); 225 (halt) ? "halt" : "unhalt");
238 226
@@ -385,18 +373,12 @@ void ar9003_mci_set_full_sleep(struct ath_hw *ah)
385 373
386static void ar9003_mci_disable_interrupt(struct ath_hw *ah) 374static void ar9003_mci_disable_interrupt(struct ath_hw *ah)
387{ 375{
388 if (!ATH9K_HW_CAP_MCI)
389 return;
390
391 REG_WRITE(ah, AR_MCI_INTERRUPT_EN, 0); 376 REG_WRITE(ah, AR_MCI_INTERRUPT_EN, 0);
392 REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, 0); 377 REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, 0);
393} 378}
394 379
395static void ar9003_mci_enable_interrupt(struct ath_hw *ah) 380static void ar9003_mci_enable_interrupt(struct ath_hw *ah)
396{ 381{
397 if (!ATH9K_HW_CAP_MCI)
398 return;
399
400 REG_WRITE(ah, AR_MCI_INTERRUPT_EN, AR_MCI_INTERRUPT_DEFAULT); 382 REG_WRITE(ah, AR_MCI_INTERRUPT_EN, AR_MCI_INTERRUPT_DEFAULT);
401 REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, 383 REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN,
402 AR_MCI_INTERRUPT_RX_MSG_DEFAULT); 384 AR_MCI_INTERRUPT_RX_MSG_DEFAULT);
@@ -406,9 +388,6 @@ static bool ar9003_mci_check_int(struct ath_hw *ah, u32 ints)
406{ 388{
407 u32 intr; 389 u32 intr;
408 390
409 if (!ATH9K_HW_CAP_MCI)
410 return false;
411
412 intr = REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_RAW); 391 intr = REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_RAW);
413 return ((intr & ints) == ints); 392 return ((intr & ints) == ints);
414} 393}
@@ -418,9 +397,6 @@ void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr,
418{ 397{
419 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 398 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
420 399
421 if (!ATH9K_HW_CAP_MCI)
422 return;
423
424 *raw_intr = mci->raw_intr; 400 *raw_intr = mci->raw_intr;
425 *rx_msg_intr = mci->rx_msg_intr; 401 *rx_msg_intr = mci->rx_msg_intr;
426 402
@@ -459,9 +435,6 @@ static void ar9003_mci_2g5g_changed(struct ath_hw *ah, bool is_2g)
459{ 435{
460 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 436 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
461 437
462 if (!ATH9K_HW_CAP_MCI)
463 return;
464
465 if (!mci->update_2g5g && 438 if (!mci->update_2g5g &&
466 (mci->is_2g != is_2g)) 439 (mci->is_2g != is_2g))
467 mci->update_2g5g = true; 440 mci->update_2g5g = true;
@@ -574,9 +547,6 @@ static void ar9003_mci_sync_bt_state(struct ath_hw *ah)
574 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 547 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
575 u32 cur_bt_state; 548 u32 cur_bt_state;
576 549
577 if (!ATH9K_HW_CAP_MCI)
578 return;
579
580 cur_bt_state = ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL); 550 cur_bt_state = ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL);
581 551
582 if (mci->bt_state != cur_bt_state) { 552 if (mci->bt_state != cur_bt_state) {
@@ -675,9 +645,6 @@ static u32 ar9003_mci_wait_for_gpm(struct ath_hw *ah, u8 gpm_type,
675 u8 recv_type = 0, recv_opcode = 0; 645 u8 recv_type = 0, recv_opcode = 0;
676 bool b_is_bt_cal_done = (gpm_type == MCI_GPM_BT_CAL_DONE); 646 bool b_is_bt_cal_done = (gpm_type == MCI_GPM_BT_CAL_DONE);
677 647
678 if (!ATH9K_HW_CAP_MCI)
679 return 0;
680
681 more_data = time_out ? MCI_GPM_NOMORE : MCI_GPM_MORE; 648 more_data = time_out ? MCI_GPM_NOMORE : MCI_GPM_MORE;
682 649
683 while (time_out > 0) { 650 while (time_out > 0) {
@@ -909,9 +876,6 @@ static void ar9003_mci_mute_bt(struct ath_hw *ah)
909{ 876{
910 struct ath_common *common = ath9k_hw_common(ah); 877 struct ath_common *common = ath9k_hw_common(ah);
911 878
912 if (!ATH9K_HW_CAP_MCI)
913 return;
914
915 /* disable all MCI messages */ 879 /* disable all MCI messages */
916 REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, 0xffff0000); 880 REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, 0xffff0000);
917 REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, 0xffffffff); 881 REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, 0xffffffff);
@@ -945,9 +909,6 @@ void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
945 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 909 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
946 u32 regval, thresh; 910 u32 regval, thresh;
947 911
948 if (!ATH9K_HW_CAP_MCI)
949 return;
950
951 ath_dbg(common, MCI, "MCI full_sleep = %d, is_2g = %d\n", 912 ath_dbg(common, MCI, "MCI full_sleep = %d, is_2g = %d\n",
952 is_full_sleep, is_2g); 913 is_full_sleep, is_2g);
953 914
@@ -1218,9 +1179,6 @@ void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done)
1218 struct ath_common *common = ath9k_hw_common(ah); 1179 struct ath_common *common = ath9k_hw_common(ah);
1219 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 1180 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
1220 1181
1221 if (!ATH9K_HW_CAP_MCI)
1222 return;
1223
1224 if (mci->update_2g5g) { 1182 if (mci->update_2g5g) {
1225 if (mci->is_2g) { 1183 if (mci->is_2g) {
1226 1184
@@ -1272,9 +1230,6 @@ bool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag,
1272 u32 saved_mci_int_en; 1230 u32 saved_mci_int_en;
1273 int i; 1231 int i;
1274 1232
1275 if (!ATH9K_HW_CAP_MCI)
1276 return false;
1277
1278 saved_mci_int_en = REG_READ(ah, AR_MCI_INTERRUPT_EN); 1233 saved_mci_int_en = REG_READ(ah, AR_MCI_INTERRUPT_EN);
1279 regval = REG_READ(ah, AR_BTCOEX_CTRL); 1234 regval = REG_READ(ah, AR_BTCOEX_CTRL);
1280 1235
@@ -1388,9 +1343,6 @@ void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
1388{ 1343{
1389 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 1344 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
1390 1345
1391 if (!ATH9K_HW_CAP_MCI)
1392 return;
1393
1394 mci->gpm_addr = gpm_addr; 1346 mci->gpm_addr = gpm_addr;
1395 mci->gpm_buf = gpm_buf; 1347 mci->gpm_buf = gpm_buf;
1396 mci->gpm_len = len; 1348 mci->gpm_len = len;
@@ -1402,9 +1354,6 @@ EXPORT_SYMBOL(ar9003_mci_setup);
1402 1354
1403void ar9003_mci_cleanup(struct ath_hw *ah) 1355void ar9003_mci_cleanup(struct ath_hw *ah)
1404{ 1356{
1405 if (!ATH9K_HW_CAP_MCI)
1406 return;
1407
1408 /* Turn off MCI and Jupiter mode. */ 1357 /* Turn off MCI and Jupiter mode. */
1409 REG_WRITE(ah, AR_BTCOEX_CTRL, 0x00); 1358 REG_WRITE(ah, AR_BTCOEX_CTRL, 0x00);
1410 ar9003_mci_disable_interrupt(ah); 1359 ar9003_mci_disable_interrupt(ah);
@@ -1418,9 +1367,6 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data)
1418 u32 value = 0, more_gpm = 0, gpm_ptr; 1367 u32 value = 0, more_gpm = 0, gpm_ptr;
1419 u8 query_type; 1368 u8 query_type;
1420 1369
1421 if (!ATH9K_HW_CAP_MCI)
1422 return 0;
1423
1424 switch (state_type) { 1370 switch (state_type) {
1425 case MCI_STATE_ENABLE: 1371 case MCI_STATE_ENABLE:
1426 if (mci->ready) { 1372 if (mci->ready) {
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 1f1a5c632152..63e4c4b1cb3d 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -333,7 +333,7 @@ void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status)
333 if (status & ATH9K_INT_GENTIMER) 333 if (status & ATH9K_INT_GENTIMER)
334 ath_gen_timer_isr(sc->sc_ah); 334 ath_gen_timer_isr(sc->sc_ah);
335 335
336 if ((status & ATH9K_INT_MCI) && ATH9K_HW_CAP_MCI) 336 if (status & ATH9K_INT_MCI)
337 ath_mci_intr(sc); 337 ath_mci_intr(sc);
338} 338}
339 339
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 5f5f57421249..c785303eb3ad 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -209,11 +209,7 @@ enum ath9k_hw_caps {
209 ATH9K_HW_CAP_5GHZ = BIT(12), 209 ATH9K_HW_CAP_5GHZ = BIT(12),
210 ATH9K_HW_CAP_APM = BIT(13), 210 ATH9K_HW_CAP_APM = BIT(13),
211 ATH9K_HW_CAP_RTT = BIT(14), 211 ATH9K_HW_CAP_RTT = BIT(14),
212#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
213 ATH9K_HW_CAP_MCI = BIT(15), 212 ATH9K_HW_CAP_MCI = BIT(15),
214#else
215 ATH9K_HW_CAP_MCI = 0,
216#endif
217 ATH9K_HW_CAP_DFS = BIT(16), 213 ATH9K_HW_CAP_DFS = BIT(16),
218}; 214};
219 215
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index 85a957ab89be..f818faa3b612 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -389,9 +389,6 @@ int ath_mci_setup(struct ath_softc *sc)
389 struct ath_mci_coex *mci = &sc->mci_coex; 389 struct ath_mci_coex *mci = &sc->mci_coex;
390 struct ath_mci_buf *buf = &mci->sched_buf; 390 struct ath_mci_buf *buf = &mci->sched_buf;
391 391
392 if (!ATH9K_HW_CAP_MCI)
393 return 0;
394
395 buf->bf_addr = dma_alloc_coherent(sc->dev, 392 buf->bf_addr = dma_alloc_coherent(sc->dev,
396 ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE, 393 ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE,
397 &buf->bf_paddr, GFP_KERNEL); 394 &buf->bf_paddr, GFP_KERNEL);
@@ -426,9 +423,6 @@ void ath_mci_cleanup(struct ath_softc *sc)
426 struct ath_mci_coex *mci = &sc->mci_coex; 423 struct ath_mci_coex *mci = &sc->mci_coex;
427 struct ath_mci_buf *buf = &mci->sched_buf; 424 struct ath_mci_buf *buf = &mci->sched_buf;
428 425
429 if (!ATH9K_HW_CAP_MCI)
430 return;
431
432 if (buf->bf_addr) 426 if (buf->bf_addr)
433 dma_free_coherent(sc->dev, 427 dma_free_coherent(sc->dev,
434 ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE, 428 ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE,
@@ -450,9 +444,6 @@ void ath_mci_intr(struct ath_softc *sc)
450 u32 more_data = MCI_GPM_MORE; 444 u32 more_data = MCI_GPM_MORE;
451 bool skip_gpm = false; 445 bool skip_gpm = false;
452 446
453 if (!ATH9K_HW_CAP_MCI)
454 return;
455
456 ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg); 447 ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg);
457 448
458 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) { 449 if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) {