b43: Add firmware markers support
authorMichael Buesch <mb@bu3sch.de>
Mon, 19 May 2008 22:24:36 +0000 (00:24 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 22 May 2008 01:48:17 +0000 (21:48 -0400)
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>
drivers/net/wireless/b43/b43.h
drivers/net/wireless/b43/main.c

index f0041750355dad77c20dbcfec70ee0ae91fbaeae..e919189919bb4785da8c876449c68924d996cf4c 100644 (file)
@@ -428,8 +428,13 @@ enum {
 #define B43_DEBUGIRQ_PANIC             0       /* The firmware panic'ed */
 #define B43_DEBUGIRQ_DUMP_SHM          1       /* Dump shared SHM */
 #define B43_DEBUGIRQ_DUMP_REGS         2       /* Dump the microcode registers */
+#define B43_DEBUGIRQ_MARKER            3       /* A "marker" was thrown by the firmware. */
 #define B43_DEBUGIRQ_ACK               0xFFFF  /* The host writes that to ACK the IRQ */
 
+/* The firmware register that contains the "marker" line. */
+#define B43_MARKER_ID_REG              2
+#define B43_MARKER_LINE_REG            3
+
 /* The firmware register to fetch the panic reason from. */
 #define B43_FWPANIC_REASON_REG         3
 /* Firmware panic reason codes */
index e1dfb40746766c0423ec3a88e0e39bbe5afbab41..cbb317bb34840e91532c19ac6ba27cf700574458 100644 (file)
@@ -1689,7 +1689,7 @@ static void b43_handle_firmware_panic(struct b43_wldev *dev)
 static void handle_irq_ucode_debug(struct b43_wldev *dev)
 {
        unsigned int i, cnt;
-       u16 reason;
+       u16 reason, marker_id, marker_line;
        __le16 *buf;
 
        /* The proprietary firmware doesn't have this IRQ. */
@@ -1737,6 +1737,17 @@ static void handle_irq_ucode_debug(struct b43_wldev *dev)
                }
                printk("\n");
                break;
+       case B43_DEBUGIRQ_MARKER:
+               if (!B43_DEBUG)
+                       break; /* Only with driver debugging enabled. */
+               marker_id = b43_shm_read16(dev, B43_SHM_SCRATCH,
+                                          B43_MARKER_ID_REG);
+               marker_line = b43_shm_read16(dev, B43_SHM_SCRATCH,
+                                            B43_MARKER_LINE_REG);
+               b43info(dev->wl, "The firmware just executed the MARKER(%u) "
+                       "at line number %u\n",
+                       marker_id, marker_line);
+               break;
        default:
                b43dbg(dev->wl, "Debug-IRQ triggered for unknown reason: %u\n",
                       reason);