aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c34
1 files changed, 33 insertions, 1 deletions
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}