aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-11-23 16:33:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-28 15:05:04 -0500
commita830df0714117574fd0d5fe98477059b3e9fd5bf (patch)
treeb9e97c27d1b24dfed5f5267e1ee991e791e767a2 /drivers/net/wireless
parentf911ab83a2c07118dc605d643545647cef6f2322 (diff)
ath9k: separate debugfs support from CONFIG_ATH_DEBUG
In my setups, ath9k's debugfs files are most of the time much more useful than the messages generated by enabling CONFIG_ATH_DEBUG along with the right debug flags. Since CONFIG_ATH_DEBUG comes with a noticeable overhead on embedded systems, this patch makes it possible to use the debugfs files without that option. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig13
-rw-r--r--drivers/net/wireless/ath/ath9k/Makefile2
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h6
5 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index 006364f76bb4..03a1106ad725 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -23,17 +23,12 @@ config ATH9K
23 23
24 If you choose to build a module, it'll be called ath9k. 24 If you choose to build a module, it'll be called ath9k.
25 25
26if ATH_DEBUG 26config ATH9K_DEBUGFS
27
28config ATH9K_DEBUG
29 bool "Atheros ath9k debugging" 27 bool "Atheros ath9k debugging"
30 depends on ATH9K 28 depends on ATH9K
31 ---help--- 29 ---help---
32 Say Y, if you need ath9k to display debug messages. 30 Say Y, if you need access to ath9k's statistics for
33 Pass the debug mask as a module parameter: 31 interrupts, rate control, etc.
34
35 modprobe ath9k debug=0x00000200
36 32
37 Look in ath9k/debug.h for possible debug masks 33 Also required for changing debug message flags at run time.
38 34
39endif # ATH_DEBUG
diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile
index e53f9680a385..4985b2b1b0a9 100644
--- a/drivers/net/wireless/ath/ath9k/Makefile
+++ b/drivers/net/wireless/ath/ath9k/Makefile
@@ -7,7 +7,7 @@ ath9k-y += beacon.o \
7 7
8ath9k-$(CONFIG_PCI) += pci.o 8ath9k-$(CONFIG_PCI) += pci.o
9ath9k-$(CONFIG_ATHEROS_AR71XX) += ahb.o 9ath9k-$(CONFIG_ATHEROS_AR71XX) += ahb.o
10ath9k-$(CONFIG_ATH9K_DEBUG) += debug.o 10ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o
11 11
12obj-$(CONFIG_ATH9K) += ath9k.o 12obj-$(CONFIG_ATH9K) += ath9k.o
13 13
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 42f79caa870b..e2cef2ff5d8f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -486,7 +486,7 @@ struct ath_softc {
486 486
487 int beacon_interval; 487 int beacon_interval;
488 488
489#ifdef CONFIG_ATH9K_DEBUG 489#ifdef CONFIG_ATH9K_DEBUGFS
490 struct ath9k_debug debug; 490 struct ath9k_debug debug;
491#endif 491#endif
492 struct ath_beacon_config cur_beacon_conf; 492 struct ath_beacon_config cur_beacon_conf;
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 608fa06e531c..b66f72dbf7b9 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -31,6 +31,8 @@ static int ath9k_debugfs_open(struct inode *inode, struct file *file)
31 return 0; 31 return 0;
32} 32}
33 33
34#ifdef CONFIG_ATH_DEBUG
35
34static ssize_t read_file_debug(struct file *file, char __user *user_buf, 36static ssize_t read_file_debug(struct file *file, char __user *user_buf,
35 size_t count, loff_t *ppos) 37 size_t count, loff_t *ppos)
36{ 38{
@@ -71,6 +73,8 @@ static const struct file_operations fops_debug = {
71 .owner = THIS_MODULE 73 .owner = THIS_MODULE
72}; 74};
73 75
76#endif
77
74static ssize_t read_file_dma(struct file *file, char __user *user_buf, 78static ssize_t read_file_dma(struct file *file, char __user *user_buf,
75 size_t count, loff_t *ppos) 79 size_t count, loff_t *ppos)
76{ 80{
@@ -563,10 +567,12 @@ int ath9k_init_debug(struct ath_hw *ah)
563 if (!sc->debug.debugfs_phy) 567 if (!sc->debug.debugfs_phy)
564 goto err; 568 goto err;
565 569
570#ifdef CONFIG_ATH_DEBUG
566 sc->debug.debugfs_debug = debugfs_create_file("debug", 571 sc->debug.debugfs_debug = debugfs_create_file("debug",
567 S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_debug); 572 S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_debug);
568 if (!sc->debug.debugfs_debug) 573 if (!sc->debug.debugfs_debug)
569 goto err; 574 goto err;
575#endif
570 576
571 sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, 577 sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR,
572 sc->debug.debugfs_phy, sc, &fops_dma); 578 sc->debug.debugfs_phy, sc, &fops_dma);
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index f282eeef669b..536663e3ee11 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -23,13 +23,13 @@
23struct ath_txq; 23struct ath_txq;
24struct ath_buf; 24struct ath_buf;
25 25
26#ifdef CONFIG_ATH9K_DEBUG 26#ifdef CONFIG_ATH9K_DEBUGFS
27#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++ 27#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
28#else 28#else
29#define TX_STAT_INC(q, c) do { } while (0) 29#define TX_STAT_INC(q, c) do { } while (0)
30#endif 30#endif
31 31
32#ifdef CONFIG_ATH9K_DEBUG 32#ifdef CONFIG_ATH9K_DEBUGFS
33 33
34/** 34/**
35 * struct ath_interrupt_stats - Contains statistics about interrupts 35 * struct ath_interrupt_stats - Contains statistics about interrupts
@@ -186,6 +186,6 @@ static inline void ath_debug_stat_retries(struct ath_softc *sc, int rix,
186{ 186{
187} 187}
188 188
189#endif /* CONFIG_ATH9K_DEBUG */ 189#endif /* CONFIG_ATH9K_DEBUGFS */
190 190
191#endif /* DEBUG_H */ 191#endif /* DEBUG_H */