linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: Add firmware markers support
@ 2008-05-19 22:24 Michael Buesch
  0 siblings, 0 replies; only message in thread
From: Michael Buesch @ 2008-05-19 22:24 UTC (permalink / raw)
  To: John Linville; +Cc: bcm43xx-dev, linux-wireless

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>

---

John, this is for 2.6.27


Index: wireless-testing/drivers/net/wireless/b43/b43.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/b43.h	2008-05-18 23:57:16.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/b43.h	2008-05-20 00:16:27.000000000 +0200
@@ -425,14 +425,19 @@ enum {
 /* The firmware register to fetch the debug-IRQ reason from. */
 #define B43_DEBUGIRQ_REASON_REG		63
 /* Debug-IRQ reasons. */
 #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 */
 #define B43_FWPANIC_DIE			0 /* Firmware died. Don't auto-restart it. */
 #define B43_FWPANIC_RESTART		1 /* Firmware died. Schedule a controller reset. */
 
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c	2008-05-19 00:02:01.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c	2008-05-20 00:18:53.000000000 +0200
@@ -1688,13 +1688,13 @@ static void b43_handle_firmware_panic(st
 	}
 }
 
 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. */
 	if (!dev->fw.opensource)
 		return;
 
@@ -1736,12 +1736,23 @@ static void handle_irq_ucode_debug(struc
 				printk("\n");
 				cnt = 0;
 			}
 		}
 		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);
 	}
 out:
 	/* Acknowledge the debug-IRQ, so the firmware can continue. */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-19 22:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-19 22:24 [PATCH] b43: Add firmware markers support Michael Buesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).