aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k/debug.c')
-rw-r--r--drivers/net/wireless/ath5k/debug.c55
1 files changed, 36 insertions, 19 deletions
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 */