aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/debug.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-02-04 10:03:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:37 -0500
commitb446197cc14ef060baeed5acbcddf148c04d03f8 (patch)
tree74fd1867ef8e31d3572b5e3b09ceeccd296376bf /drivers/net/wireless/ath5k/debug.c
parente9ddc0f25ce524d257e6cf779e495f567ed7678f (diff)
ath5k: Port debug.c over to the new band API and enable as build option
This patch finishes the port and enables debug as an build option. This was tested on: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43) RF5112A multiband radio found (0x36) Note: For 2 GHz band on the above card I noticed we get negative channel numbers. Will look into this unless someone beats me to it. Example out put when loading using: sudo modprobe ath5k debug=0x00000400 Band 2 GHz: channels 26, rates 12 channels: 1 2412 00c0 0000 2 2417 00c0 0000 3 2422 00c0 0000 4 2427 00c0 0000 5 2432 00c0 0000 6 2437 00c0 0000 7 2442 00c0 0000 8 2447 00c0 0000 9 2452 00c0 0000 10 2457 00c0 0000 11 2462 00c0 0000 12 2467 00c0 0000 13 2472 00c0 0000 14 2484 00c0 0000 -498 2512 00c0 0000 -494 2532 00c0 0000 -490 2552 00c0 0000 -486 2572 00c0 0000 -482 2592 00c0 0000 -478 2612 00c0 0000 -474 2632 00c0 0000 -470 2652 00c0 0000 -466 2672 00c0 0000 -462 2692 00c0 0000 -458 2712 00c0 0000 -454 2732 00c0 0000 Band 5 GHz: channels 194, rates 8 channels: 27 5135 0140 0000 28 5140 0140 0000 [... etc ] 219 6095 0140 0000 220 6100 0140 0000 rates: 60 000b 0000 0000 90 000f 0000 0000 120 000a 0000 0000 180 000e 0000 0000 240 0009 0000 0000 360 000d 0000 0000 480 0008 0000 0000 540 000c 0000 0000 Changes to base.c, base.h Changes-licensed-under: 3-Clause-BSD Changes to debug.c, debug.h Changes-licensed-under: GPL Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> Signed-off-by: John W. Linville <linville@tuxdriver.com>
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 bb581ef6d1e..05bf4fb8f90 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 */