aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/gpio.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-11-19 03:54:46 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-19 10:45:40 -0500
commitac46ba4384d2c44c56702d0da591696045fba682 (patch)
treed96d638823d533c9154bfbbe03af834a25518089 /drivers/net/wireless/ath/ath9k/gpio.c
parent57527f8d4d71b5167a02fb6713857f55d3974748 (diff)
ath9k: Fix BTCOEX debugfs file usage
The debugfs file for dumping btcoex parameters unconditionally assumes a MCI-based device. This will not work for older btcoex chips. Fix this by branching out the routine into separate functions. 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/ath9k/gpio.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c51
1 files changed, 35 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index a8ea57b9f49c..4236df8ffe67 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -494,35 +494,31 @@ int ath9k_init_btcoex(struct ath_softc *sc)
494 return 0; 494 return 0;
495} 495}
496 496
497int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 len, u32 size) 497static int ath9k_dump_mci_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
498{ 498{
499#define ATH_DUMP_BTCOEX(_s, _val) \
500 do { \
501 len += snprintf(buf + len, size - len, \
502 "%20s : %10d\n", _s, (_val)); \
503 } while (0)
504
505 struct ath_btcoex *btcoex = &sc->btcoex; 499 struct ath_btcoex *btcoex = &sc->btcoex;
506 struct ath_mci_profile *mci = &btcoex->mci; 500 struct ath_mci_profile *mci = &btcoex->mci;
507 struct ath_hw *ah = sc->sc_ah; 501 struct ath_hw *ah = sc->sc_ah;
508 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw; 502 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
503 u32 len = 0;
509 int i; 504 int i;
510 505
511 ATH_DUMP_BTCOEX("Total BT profiles", NUM_PROF(mci)); 506 ATH_DUMP_BTCOEX("Total BT profiles", NUM_PROF(mci));
512 ATH_DUMP_BTCOEX("Number of MGMT", mci->num_mgmt); 507 ATH_DUMP_BTCOEX("MGMT", mci->num_mgmt);
513 ATH_DUMP_BTCOEX("Number of SCO", mci->num_sco); 508 ATH_DUMP_BTCOEX("SCO", mci->num_sco);
514 ATH_DUMP_BTCOEX("Number of A2DP", mci->num_a2dp); 509 ATH_DUMP_BTCOEX("A2DP", mci->num_a2dp);
515 ATH_DUMP_BTCOEX("Number of HID", mci->num_hid); 510 ATH_DUMP_BTCOEX("HID", mci->num_hid);
516 ATH_DUMP_BTCOEX("Number of PAN", mci->num_pan); 511 ATH_DUMP_BTCOEX("PAN", mci->num_pan);
517 ATH_DUMP_BTCOEX("Number of ACL", mci->num_other_acl); 512 ATH_DUMP_BTCOEX("ACL", mci->num_other_acl);
518 ATH_DUMP_BTCOEX("Number of BDR", mci->num_bdr); 513 ATH_DUMP_BTCOEX("BDR", mci->num_bdr);
519 ATH_DUMP_BTCOEX("Aggr. Limit", mci->aggr_limit); 514 ATH_DUMP_BTCOEX("Aggr. Limit", mci->aggr_limit);
520 ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type); 515 ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type);
521 ATH_DUMP_BTCOEX("BTCoex Period (msec)", btcoex->btcoex_period); 516 ATH_DUMP_BTCOEX("BTCoex Period (msec)", btcoex->btcoex_period);
522 ATH_DUMP_BTCOEX("Duty Cycle", btcoex->duty_cycle); 517 ATH_DUMP_BTCOEX("Duty Cycle", btcoex->duty_cycle);
523 ATH_DUMP_BTCOEX("BT Wait time", btcoex->bt_wait_time); 518 ATH_DUMP_BTCOEX("BT Wait time", btcoex->bt_wait_time);
524 ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx); 519 ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx);
525 ATH_DUMP_BTCOEX("Concur RSSI count", btcoex->rssi_count); 520 ATH_DUMP_BTCOEX("Concurrent RSSI cnt", btcoex->rssi_count);
521
526 len += snprintf(buf + len, size - len, "BT Weights: "); 522 len += snprintf(buf + len, size - len, "BT Weights: ");
527 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) 523 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
528 len += snprintf(buf + len, size - len, "%08x ", 524 len += snprintf(buf + len, size - len, "%08x ",
@@ -537,9 +533,32 @@ int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 len, u32 size)
537 for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++) 533 for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++)
538 len += snprintf(buf + len, size - len, "%08x ", 534 len += snprintf(buf + len, size - len, "%08x ",
539 btcoex_hw->tx_prio[i]); 535 btcoex_hw->tx_prio[i]);
536
540 len += snprintf(buf + len, size - len, "\n"); 537 len += snprintf(buf + len, size - len, "\n");
541#undef ATH_DUMP_BTCOEX
542 538
543 return len; 539 return len;
544} 540}
541
542static int ath9k_dump_legacy_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
543{
544
545 struct ath_btcoex *btcoex = &sc->btcoex;
546 u32 len = 0;
547
548 ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type);
549 ATH_DUMP_BTCOEX("BTCoex Period (msec)", btcoex->btcoex_period);
550 ATH_DUMP_BTCOEX("Duty Cycle", btcoex->duty_cycle);
551 ATH_DUMP_BTCOEX("BT Wait time", btcoex->bt_wait_time);
552
553 return len;
554}
555
556int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
557{
558 if (ath9k_hw_mci_is_enabled(sc->sc_ah))
559 return ath9k_dump_mci_btcoex(sc, buf, size);
560 else
561 return ath9k_dump_legacy_btcoex(sc, buf, size);
562}
563
545#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ 564#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */