aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2012-10-25 07:46:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-29 15:30:35 -0400
commit4df50ca869890581020b95958251bd355c1dc6b1 (patch)
tree61cdbd703d63002dd5283c022d1430200a4fd135 /drivers/net/wireless/ath/ath9k
parentcdbe408da76d5cc294edb013850cc3a972d80968 (diff)
ath9k: Dump BTCOEX tuning parameters
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h6
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c34
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c48
3 files changed, 87 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 18dfb764eed..4e125d8904a 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -494,6 +494,7 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc);
494void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status); 494void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status);
495u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen); 495u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen);
496void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc); 496void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc);
497int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 len, u32 size);
497#else 498#else
498static inline int ath9k_init_btcoex(struct ath_softc *sc) 499static inline int ath9k_init_btcoex(struct ath_softc *sc)
499{ 500{
@@ -520,6 +521,11 @@ static inline u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc,
520static inline void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc) 521static inline void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc)
521{ 522{
522} 523}
524static inline int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf,
525 u32 len, u32 size)
526{
527 return 0;
528}
523#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ 529#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
524 530
525struct ath9k_wow_pattern { 531struct ath9k_wow_pattern {
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 6727b566d29..a8be94b2a53 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1586,6 +1586,35 @@ static const struct file_operations fops_samps = {
1586 1586
1587#endif 1587#endif
1588 1588
1589#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1590static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
1591 size_t count, loff_t *ppos)
1592{
1593 struct ath_softc *sc = file->private_data;
1594 u32 len = 0, size = 1500;
1595 char *buf;
1596 size_t retval;
1597
1598 buf = kzalloc(size, GFP_KERNEL);
1599 if (buf == NULL)
1600 return -ENOMEM;
1601
1602 len = ath9k_dump_btcoex(sc, buf, len, size);
1603
1604 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
1605 kfree(buf);
1606
1607 return retval;
1608}
1609
1610static const struct file_operations fops_btcoex = {
1611 .read = read_file_btcoex,
1612 .open = simple_open,
1613 .owner = THIS_MODULE,
1614 .llseek = default_llseek,
1615};
1616#endif
1617
1589int ath9k_init_debug(struct ath_hw *ah) 1618int ath9k_init_debug(struct ath_hw *ah)
1590{ 1619{
1591 struct ath_common *common = ath9k_hw_common(ah); 1620 struct ath_common *common = ath9k_hw_common(ah);
@@ -1658,6 +1687,9 @@ int ath9k_init_debug(struct ath_hw *ah)
1658 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); 1687 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
1659 debugfs_create_file("diversity", S_IRUSR | S_IWUSR, 1688 debugfs_create_file("diversity", S_IRUSR | S_IWUSR,
1660 sc->debug.debugfs_phy, sc, &fops_ant_diversity); 1689 sc->debug.debugfs_phy, sc, &fops_ant_diversity);
1661 1690#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1691 debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
1692 &fops_btcoex);
1693#endif
1662 return 0; 1694 return 0;
1663} 1695}
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 64dde1cd20e..a8ea57b9f49 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -494,4 +494,52 @@ 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)
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;
506 struct ath_mci_profile *mci = &btcoex->mci;
507 struct ath_hw *ah = sc->sc_ah;
508 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
509 int i;
510
511 ATH_DUMP_BTCOEX("Total BT profiles", NUM_PROF(mci));
512 ATH_DUMP_BTCOEX("Number of MGMT", mci->num_mgmt);
513 ATH_DUMP_BTCOEX("Number of SCO", mci->num_sco);
514 ATH_DUMP_BTCOEX("Number of A2DP", mci->num_a2dp);
515 ATH_DUMP_BTCOEX("Number of HID", mci->num_hid);
516 ATH_DUMP_BTCOEX("Number of PAN", mci->num_pan);
517 ATH_DUMP_BTCOEX("Number of ACL", mci->num_other_acl);
518 ATH_DUMP_BTCOEX("Number of BDR", mci->num_bdr);
519 ATH_DUMP_BTCOEX("Aggr. Limit", mci->aggr_limit);
520 ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type);
521 ATH_DUMP_BTCOEX("BTCoex Period (msec)", btcoex->btcoex_period);
522 ATH_DUMP_BTCOEX("Duty Cycle", btcoex->duty_cycle);
523 ATH_DUMP_BTCOEX("BT Wait time", btcoex->bt_wait_time);
524 ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx);
525 ATH_DUMP_BTCOEX("Concur RSSI count", btcoex->rssi_count);
526 len += snprintf(buf + len, size - len, "BT Weights: ");
527 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
528 len += snprintf(buf + len, size - len, "%08x ",
529 btcoex_hw->bt_weight[i]);
530 len += snprintf(buf + len, size - len, "\n");
531 len += snprintf(buf + len, size - len, "WLAN Weights: ");
532 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
533 len += snprintf(buf + len, size - len, "%08x ",
534 btcoex_hw->wlan_weight[i]);
535 len += snprintf(buf + len, size - len, "\n");
536 len += snprintf(buf + len, size - len, "Tx Priorities: ");
537 for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++)
538 len += snprintf(buf + len, size - len, "%08x ",
539 btcoex_hw->tx_prio[i]);
540 len += snprintf(buf + len, size - len, "\n");
541#undef ATH_DUMP_BTCOEX
542
543 return len;
544}
497#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ 545#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */