Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89876
b: refs/heads/master
c: b446197
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Feb 29, 2008
1 parent c3e3524 commit a0429d9
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9ddc0f25ce524d257e6cf779e495f567ed7678f
refs/heads/master: b446197cc14ef060baeed5acbcddf148c04d03f8
21 changes: 21 additions & 0 deletions trunk/drivers/net/wireless/ath5k/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,24 @@ config ATH5K

If you choose to build a module, it'll be called ath5k. Say M if
unsure.

config ATH5K_DEBUG
bool "Atheros 5xxx debugging"
depends on ATH5K
---help---
Atheros 5xxx debugging messages.

Say Y, if and you will get debug options for ath5k.
To use this, you need to mount debugfs:

mkdir /debug/
mount -t debugfs debug /debug/

You will get access to files under:
/debug/ath5k/phy0/

To enable debug, pass the debug level to the debug module
parameter. For example:

modprobe ath5k debug=0x00000400

2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath5k/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ ath5k-y += base.o
ath5k-y += hw.o
ath5k-y += initvals.o
ath5k-y += phy.o
ath5k-y += debug.o
ath5k-$(CONFIG_ATH5K_DEBUG) += debug.o
obj-$(CONFIG_ATH5K) += ath5k.o
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ ath5k_getchannels(struct ieee80211_hw *hw)
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
}

/* FIXME: ath5k_debug_dump_modes(sc, modes); */
ath5k_debug_dump_bands(sc);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath5k/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ struct ath5k_softc {
u8 g_rates;
u8 xr_rates;

#if ATH5K_DEBUG
#ifdef CONFIG_ATH5K_DEBUG
struct ath5k_dbg_info debug; /* debug info */
#endif
#endif /* CONFIG_ATH5K_DEBUG */

struct ath5k_buf *bufptr; /* allocated buffer ptr */
struct ath5k_desc *desc; /* TX/RX descriptors */
Expand Down
55 changes: 36 additions & 19 deletions trunk/drivers/net/wireless/ath5k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static unsigned int ath5k_debug;
module_param_named(debug, ath5k_debug, uint, 0);


#if ATH5K_DEBUG
#ifdef CONFIG_ATH5K_DEBUG

#include <linux/seq_file.h>
#include "reg.h"
Expand Down Expand Up @@ -340,7 +340,7 @@ static struct {
{ ATH5K_DEBUG_LED, "led", "LED mamagement" },
{ ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" },
{ ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" },
{ ATH5K_DEBUG_DUMPMODES, "dumpmodes", "dump modes" },
{ ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" },
{ ATH5K_DEBUG_TRACE, "trace", "trace function calls" },
{ ATH5K_DEBUG_ANY, "all", "show all debug levels" },
};
Expand Down Expand Up @@ -452,30 +452,47 @@ ath5k_debug_finish_device(struct ath5k_softc *sc)
/* functions used in other places */

void
ath5k_debug_dump_modes(struct ath5k_softc *sc, struct ieee80211_hw_mode *modes)
ath5k_debug_dump_bands(struct ath5k_softc *sc)
{
unsigned int m, i;
unsigned int b, i;

if (likely(!(sc->debug.level & ATH5K_DEBUG_DUMPMODES)))
if (likely(!(sc->debug.level & ATH5K_DEBUG_DUMPBANDS)))
return;

for (m = 0; m < NUM_DRIVER_MODES; m++) {
printk(KERN_DEBUG "Mode %u: channels %d, rates %d\n", m,
modes[m].num_channels, modes[m].num_rates);
BUG_ON(!sc->sbands);

for (b = 0; b < IEEE80211_NUM_BANDS; b++) {
struct ieee80211_supported_band *band = &sc->sbands[b];
char bname[5];
switch (band->band) {
case IEEE80211_BAND_2GHZ:
strcpy(bname, "2 GHz");
break;
case IEEE80211_BAND_5GHZ:
strcpy(bname, "5 GHz");
break;
default:
printk(KERN_DEBUG "Band not supported: %d\n",
band->band);
return;
}
printk(KERN_DEBUG "Band %s: channels %d, rates %d\n", bname,
band->n_channels, band->n_bitrates);
printk(KERN_DEBUG " channels:\n");
for (i = 0; i < modes[m].num_channels; i++)
for (i = 0; i < band->n_channels; i++)
printk(KERN_DEBUG " %3d %d %.4x %.4x\n",
modes[m].channels[i].chan,
modes[m].channels[i].freq,
modes[m].channels[i].val,
modes[m].channels[i].flag);
ieee80211_frequency_to_channel(
band->channels[i].center_freq),
band->channels[i].center_freq,
band->channels[i].hw_value,
band->channels[i].flags);
printk(KERN_DEBUG " rates:\n");
for (i = 0; i < modes[m].num_rates; i++)
for (i = 0; i < band->n_bitrates; i++)
printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n",
modes[m].rates[i].rate,
modes[m].rates[i].val,
modes[m].rates[i].flags,
modes[m].rates[i].val2);
band->bitrates[i].bitrate,
band->bitrates[i].hw_value,
band->bitrates[i].flags,
band->bitrates[i].hw_value_short);
}
}

Expand Down Expand Up @@ -548,4 +565,4 @@ ath5k_debug_printtxbuf(struct ath5k_softc *sc,
!done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!');
}

#endif /* if ATH5K_DEBUG */
#endif /* ifdef CONFIG_ATH5K_DEBUG */
19 changes: 6 additions & 13 deletions trunk/drivers/net/wireless/ath5k/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
#ifndef _ATH5K_DEBUG_H
#define _ATH5K_DEBUG_H

/* set this to 1 for debugging output */
#ifndef ATH5K_DEBUG
#define ATH5K_DEBUG 0
#endif

struct ath5k_softc;
struct ath5k_hw;
struct ieee80211_hw_mode;
Expand Down Expand Up @@ -96,7 +91,7 @@ struct ath5k_dbg_info {
* @ATH5K_DEBUG_LED: led management
* @ATH5K_DEBUG_DUMP_RX: print received skb content
* @ATH5K_DEBUG_DUMP_TX: print transmit skb content
* @ATH5K_DEBUG_DUMPMODES: dump modes
* @ATH5K_DEBUG_DUMPBANDS: dump bands
* @ATH5K_DEBUG_TRACE: trace function calls
* @ATH5K_DEBUG_ANY: show at any debug level
*
Expand All @@ -118,12 +113,12 @@ enum ath5k_debug_level {
ATH5K_DEBUG_LED = 0x00000080,
ATH5K_DEBUG_DUMP_RX = 0x00000100,
ATH5K_DEBUG_DUMP_TX = 0x00000200,
ATH5K_DEBUG_DUMPMODES = 0x00000400,
ATH5K_DEBUG_DUMPBANDS = 0x00000400,
ATH5K_DEBUG_TRACE = 0x00001000,
ATH5K_DEBUG_ANY = 0xffffffff
};

#if ATH5K_DEBUG
#ifdef CONFIG_ATH5K_DEBUG

#define ATH5K_TRACE(_sc) do { \
if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \
Expand Down Expand Up @@ -158,8 +153,7 @@ void
ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah);

void
ath5k_debug_dump_modes(struct ath5k_softc *sc,
struct ieee80211_hw_mode *modes);
ath5k_debug_dump_bands(struct ath5k_softc *sc);

void
ath5k_debug_dump_skb(struct ath5k_softc *sc,
Expand Down Expand Up @@ -196,8 +190,7 @@ static inline void
ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {}

static inline void
ath5k_debug_dump_modes(struct ath5k_softc *sc,
struct ieee80211_hw_mode *modes) {}
ath5k_debug_dump_bands(struct ath5k_softc *sc) {}

static inline void
ath5k_debug_dump_skb(struct ath5k_softc *sc,
Expand All @@ -207,6 +200,6 @@ static inline void
ath5k_debug_printtxbuf(struct ath5k_softc *sc,
struct ath5k_buf *bf, int done) {}

#endif /* if ATH5K_DEBUG */
#endif /* ifdef CONFIG_ATH5K_DEBUG */

#endif /* ifndef _ATH5K_DEBUG_H */

0 comments on commit a0429d9

Please sign in to comment.