diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-05-19 18:24:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:17 -0400 |
commit | 53c068566dde708cb28a4dfc06ae3d7fd7434397 (patch) | |
tree | a724356bc3f1b00eb352d6055816901607038944 | |
parent | afa83e239af58a93eddd10a7a43ac5618884db15 (diff) |
b43: Add firmware markers support
This adds support for firmware markers.
With firmware markers it's easily possible to check whether the
firmware runs some codepath or not. The driver will throw a message
when the firmware executes a MARKER(x).
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/b43.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index f0041750355d..e919189919bb 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -428,8 +428,13 @@ enum { | |||
428 | #define B43_DEBUGIRQ_PANIC 0 /* The firmware panic'ed */ | 428 | #define B43_DEBUGIRQ_PANIC 0 /* The firmware panic'ed */ |
429 | #define B43_DEBUGIRQ_DUMP_SHM 1 /* Dump shared SHM */ | 429 | #define B43_DEBUGIRQ_DUMP_SHM 1 /* Dump shared SHM */ |
430 | #define B43_DEBUGIRQ_DUMP_REGS 2 /* Dump the microcode registers */ | 430 | #define B43_DEBUGIRQ_DUMP_REGS 2 /* Dump the microcode registers */ |
431 | #define B43_DEBUGIRQ_MARKER 3 /* A "marker" was thrown by the firmware. */ | ||
431 | #define B43_DEBUGIRQ_ACK 0xFFFF /* The host writes that to ACK the IRQ */ | 432 | #define B43_DEBUGIRQ_ACK 0xFFFF /* The host writes that to ACK the IRQ */ |
432 | 433 | ||
434 | /* The firmware register that contains the "marker" line. */ | ||
435 | #define B43_MARKER_ID_REG 2 | ||
436 | #define B43_MARKER_LINE_REG 3 | ||
437 | |||
433 | /* The firmware register to fetch the panic reason from. */ | 438 | /* The firmware register to fetch the panic reason from. */ |
434 | #define B43_FWPANIC_REASON_REG 3 | 439 | #define B43_FWPANIC_REASON_REG 3 |
435 | /* Firmware panic reason codes */ | 440 | /* Firmware panic reason codes */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index e1dfb4074676..cbb317bb3484 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1689,7 +1689,7 @@ static void b43_handle_firmware_panic(struct b43_wldev *dev) | |||
1689 | static void handle_irq_ucode_debug(struct b43_wldev *dev) | 1689 | static void handle_irq_ucode_debug(struct b43_wldev *dev) |
1690 | { | 1690 | { |
1691 | unsigned int i, cnt; | 1691 | unsigned int i, cnt; |
1692 | u16 reason; | 1692 | u16 reason, marker_id, marker_line; |
1693 | __le16 *buf; | 1693 | __le16 *buf; |
1694 | 1694 | ||
1695 | /* The proprietary firmware doesn't have this IRQ. */ | 1695 | /* The proprietary firmware doesn't have this IRQ. */ |
@@ -1737,6 +1737,17 @@ static void handle_irq_ucode_debug(struct b43_wldev *dev) | |||
1737 | } | 1737 | } |
1738 | printk("\n"); | 1738 | printk("\n"); |
1739 | break; | 1739 | break; |
1740 | case B43_DEBUGIRQ_MARKER: | ||
1741 | if (!B43_DEBUG) | ||
1742 | break; /* Only with driver debugging enabled. */ | ||
1743 | marker_id = b43_shm_read16(dev, B43_SHM_SCRATCH, | ||
1744 | B43_MARKER_ID_REG); | ||
1745 | marker_line = b43_shm_read16(dev, B43_SHM_SCRATCH, | ||
1746 | B43_MARKER_LINE_REG); | ||
1747 | b43info(dev->wl, "The firmware just executed the MARKER(%u) " | ||
1748 | "at line number %u\n", | ||
1749 | marker_id, marker_line); | ||
1750 | break; | ||
1740 | default: | 1751 | default: |
1741 | b43dbg(dev->wl, "Debug-IRQ triggered for unknown reason: %u\n", | 1752 | b43dbg(dev->wl, "Debug-IRQ triggered for unknown reason: %u\n", |
1742 | reason); | 1753 | reason); |