aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/Kconfig21
-rw-r--r--drivers/net/wireless/ath5k/Makefile2
-rw-r--r--drivers/net/wireless/ath5k/base.c2
-rw-r--r--drivers/net/wireless/ath5k/base.h4
-rw-r--r--drivers/net/wireless/ath5k/debug.c55
-rw-r--r--drivers/net/wireless/ath5k/debug.h19
6 files changed, 67 insertions, 36 deletions
diff --git a/drivers/net/wireless/ath5k/Kconfig b/drivers/net/wireless/ath5k/Kconfig
index af1b6b8c991a..f1f2aea2eab4 100644
--- a/drivers/net/wireless/ath5k/Kconfig
+++ b/drivers/net/wireless/ath5k/Kconfig
@@ -14,3 +14,24 @@ config ATH5K
14 14
15 If you choose to build a module, it'll be called ath5k. Say M if 15 If you choose to build a module, it'll be called ath5k. Say M if
16 unsure. 16 unsure.
17
18config ATH5K_DEBUG
19 bool "Atheros 5xxx debugging"
20 depends on ATH5K
21 ---help---
22 Atheros 5xxx debugging messages.
23
24 Say Y, if and you will get debug options for ath5k.
25 To use this, you need to mount debugfs:
26
27 mkdir /debug/
28 mount -t debugfs debug /debug/
29
30 You will get access to files under:
31 /debug/ath5k/phy0/
32
33 To enable debug, pass the debug level to the debug module
34 parameter. For example:
35
36 modprobe ath5k debug=0x00000400
37
diff --git a/drivers/net/wireless/ath5k/Makefile b/drivers/net/wireless/ath5k/Makefile
index 0f14b00f648e..564ecd0c5d4b 100644
--- a/drivers/net/wireless/ath5k/Makefile
+++ b/drivers/net/wireless/ath5k/Makefile
@@ -2,5 +2,5 @@ ath5k-y += base.o
2ath5k-y += hw.o 2ath5k-y += hw.o
3ath5k-y += initvals.o 3ath5k-y += initvals.o
4ath5k-y += phy.o 4ath5k-y += phy.o
5ath5k-y += debug.o 5ath5k-$(CONFIG_ATH5K_DEBUG) += debug.o
6obj-$(CONFIG_ATH5K) += ath5k.o 6obj-$(CONFIG_ATH5K) += ath5k.o
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 44c0133e844f..5ca441d7a6c1 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -994,7 +994,7 @@ ath5k_getchannels(struct ieee80211_hw *hw)
994 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband; 994 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
995 } 995 }
996 996
997/* FIXME: ath5k_debug_dump_modes(sc, modes); */ 997 ath5k_debug_dump_bands(sc);
998 998
999 return 0; 999 return 0;
1000} 1000}
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h
index bbe7a5438154..3a9755893018 100644
--- a/drivers/net/wireless/ath5k/base.h
+++ b/drivers/net/wireless/ath5k/base.h
@@ -108,9 +108,9 @@ struct ath5k_softc {
108 u8 g_rates; 108 u8 g_rates;
109 u8 xr_rates; 109 u8 xr_rates;
110 110
111#if ATH5K_DEBUG 111#ifdef CONFIG_ATH5K_DEBUG
112 struct ath5k_dbg_info debug; /* debug info */ 112 struct ath5k_dbg_info debug; /* debug info */
113#endif 113#endif /* CONFIG_ATH5K_DEBUG */
114 114
115 struct ath5k_buf *bufptr; /* allocated buffer ptr */ 115 struct ath5k_buf *bufptr; /* allocated buffer ptr */
116 struct ath5k_desc *desc; /* TX/RX descriptors */ 116 struct ath5k_desc *desc; /* TX/RX descriptors */
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c
index bb581ef6d1ef..05bf4fb8f907 100644
--- a/drivers/net/wireless/ath5k/debug.c
+++ b/drivers/net/wireless/ath5k/debug.c
@@ -65,7 +65,7 @@ static unsigned int ath5k_debug;
65module_param_named(debug, ath5k_debug, uint, 0); 65module_param_named(debug, ath5k_debug, uint, 0);
66 66
67 67
68#if ATH5K_DEBUG 68#ifdef CONFIG_ATH5K_DEBUG
69 69
70#include <linux/seq_file.h> 70#include <linux/seq_file.h>
71#include "reg.h" 71#include "reg.h"
@@ -340,7 +340,7 @@ static struct {
340 { ATH5K_DEBUG_LED, "led", "LED mamagement" }, 340 { ATH5K_DEBUG_LED, "led", "LED mamagement" },
341 { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, 341 { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" },
342 { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, 342 { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" },
343 { ATH5K_DEBUG_DUMPMODES, "dumpmodes", "dump modes" }, 343 { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" },
344 { ATH5K_DEBUG_TRACE, "trace", "trace function calls" }, 344 { ATH5K_DEBUG_TRACE, "trace", "trace function calls" },
345 { ATH5K_DEBUG_ANY, "all", "show all debug levels" }, 345 { ATH5K_DEBUG_ANY, "all", "show all debug levels" },
346}; 346};
@@ -452,30 +452,47 @@ ath5k_debug_finish_device(struct ath5k_softc *sc)
452/* functions used in other places */ 452/* functions used in other places */
453 453
454void 454void
455ath5k_debug_dump_modes(struct ath5k_softc *sc, struct ieee80211_hw_mode *modes) 455ath5k_debug_dump_bands(struct ath5k_softc *sc)
456{ 456{
457 unsigned int m, i; 457 unsigned int b, i;
458 458
459 if (likely(!(sc->debug.level & ATH5K_DEBUG_DUMPMODES))) 459 if (likely(!(sc->debug.level & ATH5K_DEBUG_DUMPBANDS)))
460 return; 460 return;
461 461
462 for (m = 0; m < NUM_DRIVER_MODES; m++) { 462 BUG_ON(!sc->sbands);
463 printk(KERN_DEBUG "Mode %u: channels %d, rates %d\n", m, 463
464 modes[m].num_channels, modes[m].num_rates); 464 for (b = 0; b < IEEE80211_NUM_BANDS; b++) {
465 struct ieee80211_supported_band *band = &sc->sbands[b];
466 char bname[5];
467 switch (band->band) {
468 case IEEE80211_BAND_2GHZ:
469 strcpy(bname, "2 GHz");
470 break;
471 case IEEE80211_BAND_5GHZ:
472 strcpy(bname, "5 GHz");
473 break;
474 default:
475 printk(KERN_DEBUG "Band not supported: %d\n",
476 band->band);
477 return;
478 }
479 printk(KERN_DEBUG "Band %s: channels %d, rates %d\n", bname,
480 band->n_channels, band->n_bitrates);
465 printk(KERN_DEBUG " channels:\n"); 481 printk(KERN_DEBUG " channels:\n");
466 for (i = 0; i < modes[m].num_channels; i++) 482 for (i = 0; i < band->n_channels; i++)
467 printk(KERN_DEBUG " %3d %d %.4x %.4x\n", 483 printk(KERN_DEBUG " %3d %d %.4x %.4x\n",
468 modes[m].channels[i].chan, 484 ieee80211_frequency_to_channel(
469 modes[m].channels[i].freq, 485 band->channels[i].center_freq),
470 modes[m].channels[i].val, 486 band->channels[i].center_freq,
471 modes[m].channels[i].flag); 487 band->channels[i].hw_value,
488 band->channels[i].flags);
472 printk(KERN_DEBUG " rates:\n"); 489 printk(KERN_DEBUG " rates:\n");
473 for (i = 0; i < modes[m].num_rates; i++) 490 for (i = 0; i < band->n_bitrates; i++)
474 printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n", 491 printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n",
475 modes[m].rates[i].rate, 492 band->bitrates[i].bitrate,
476 modes[m].rates[i].val, 493 band->bitrates[i].hw_value,
477 modes[m].rates[i].flags, 494 band->bitrates[i].flags,
478 modes[m].rates[i].val2); 495 band->bitrates[i].hw_value_short);
479 } 496 }
480} 497}
481 498
@@ -548,4 +565,4 @@ ath5k_debug_printtxbuf(struct ath5k_softc *sc,
548 !done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!'); 565 !done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!');
549} 566}
550 567
551#endif /* if ATH5K_DEBUG */ 568#endif /* ifdef CONFIG_ATH5K_DEBUG */
diff --git a/drivers/net/wireless/ath5k/debug.h b/drivers/net/wireless/ath5k/debug.h
index c4fd8c43df0c..16fbb6fbab35 100644
--- a/drivers/net/wireless/ath5k/debug.h
+++ b/drivers/net/wireless/ath5k/debug.h
@@ -61,11 +61,6 @@
61#ifndef _ATH5K_DEBUG_H 61#ifndef _ATH5K_DEBUG_H
62#define _ATH5K_DEBUG_H 62#define _ATH5K_DEBUG_H
63 63
64/* set this to 1 for debugging output */
65#ifndef ATH5K_DEBUG
66#define ATH5K_DEBUG 0
67#endif
68
69struct ath5k_softc; 64struct ath5k_softc;
70struct ath5k_hw; 65struct ath5k_hw;
71struct ieee80211_hw_mode; 66struct ieee80211_hw_mode;
@@ -96,7 +91,7 @@ struct ath5k_dbg_info {
96 * @ATH5K_DEBUG_LED: led management 91 * @ATH5K_DEBUG_LED: led management
97 * @ATH5K_DEBUG_DUMP_RX: print received skb content 92 * @ATH5K_DEBUG_DUMP_RX: print received skb content
98 * @ATH5K_DEBUG_DUMP_TX: print transmit skb content 93 * @ATH5K_DEBUG_DUMP_TX: print transmit skb content
99 * @ATH5K_DEBUG_DUMPMODES: dump modes 94 * @ATH5K_DEBUG_DUMPBANDS: dump bands
100 * @ATH5K_DEBUG_TRACE: trace function calls 95 * @ATH5K_DEBUG_TRACE: trace function calls
101 * @ATH5K_DEBUG_ANY: show at any debug level 96 * @ATH5K_DEBUG_ANY: show at any debug level
102 * 97 *
@@ -118,12 +113,12 @@ enum ath5k_debug_level {
118 ATH5K_DEBUG_LED = 0x00000080, 113 ATH5K_DEBUG_LED = 0x00000080,
119 ATH5K_DEBUG_DUMP_RX = 0x00000100, 114 ATH5K_DEBUG_DUMP_RX = 0x00000100,
120 ATH5K_DEBUG_DUMP_TX = 0x00000200, 115 ATH5K_DEBUG_DUMP_TX = 0x00000200,
121 ATH5K_DEBUG_DUMPMODES = 0x00000400, 116 ATH5K_DEBUG_DUMPBANDS = 0x00000400,
122 ATH5K_DEBUG_TRACE = 0x00001000, 117 ATH5K_DEBUG_TRACE = 0x00001000,
123 ATH5K_DEBUG_ANY = 0xffffffff 118 ATH5K_DEBUG_ANY = 0xffffffff
124}; 119};
125 120
126#if ATH5K_DEBUG 121#ifdef CONFIG_ATH5K_DEBUG
127 122
128#define ATH5K_TRACE(_sc) do { \ 123#define ATH5K_TRACE(_sc) do { \
129 if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \ 124 if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \
@@ -158,8 +153,7 @@ void
158ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah); 153ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah);
159 154
160void 155void
161ath5k_debug_dump_modes(struct ath5k_softc *sc, 156ath5k_debug_dump_bands(struct ath5k_softc *sc);
162 struct ieee80211_hw_mode *modes);
163 157
164void 158void
165ath5k_debug_dump_skb(struct ath5k_softc *sc, 159ath5k_debug_dump_skb(struct ath5k_softc *sc,
@@ -196,8 +190,7 @@ static inline void
196ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {} 190ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {}
197 191
198static inline void 192static inline void
199ath5k_debug_dump_modes(struct ath5k_softc *sc, 193ath5k_debug_dump_bands(struct ath5k_softc *sc) {}
200 struct ieee80211_hw_mode *modes) {}
201 194
202static inline void 195static inline void
203ath5k_debug_dump_skb(struct ath5k_softc *sc, 196ath5k_debug_dump_skb(struct ath5k_softc *sc,
@@ -207,6 +200,6 @@ static inline void
207ath5k_debug_printtxbuf(struct ath5k_softc *sc, 200ath5k_debug_printtxbuf(struct ath5k_softc *sc,
208 struct ath5k_buf *bf, int done) {} 201 struct ath5k_buf *bf, int done) {}
209 202
210#endif /* if ATH5K_DEBUG */ 203#endif /* ifdef CONFIG_ATH5K_DEBUG */
211 204
212#endif /* ifndef _ATH5K_DEBUG_H */ 205#endif /* ifndef _ATH5K_DEBUG_H */