Skip to contentSkip to conversation

ath10k: Log firmware debug prints and dbg logs.

PATCH In review [email protected] 2 participants 2 messages Oct 23, 2013 – Oct 24, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Log firmware debug prints and dbg logs.

From: Ben Greear <[email protected]>

This should aid in debugging firmware issues on standard NIC hardware that does not have a serial port.

---

NOTE: This requires a previous patch sent privately to kvalo.

 drivers/net/wireless/ath/ath10k/debug.h |  1 +
 drivers/net/wireless/ath/ath10k/wmi.c   | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/debug.h +1 -0
index 845c661..807bf03 100644
@@ -33,6 +33,7 @@ enum ath10k_debug_mask {
 	ATH10K_DBG_MGMT		= 0x00000100,
 	ATH10K_DBG_DATA		= 0x00000200,
 	ATH10K_DBG_BMI		= 0x00000400,
+	ATH10K_DBG_FIRMWARE	= 0x00000800,
 	ATH10K_DBG_ANY		= 0xffffffff,
 };
 
drivers/net/wireless/ath/ath10k/wmi.c +9 -1
index a796d0b..34cff8b 100644
@@ -1046,7 +1046,12 @@ static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb)
 
 static void ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
 {
-	ath10k_dbg(ATH10K_DBG_WMI, "WMI_DEBUG_MESG_EVENTID\n");
+	u32 *m = (u32 *)(skb->data);
+	ath10k_dbg(ATH10K_DBG_WMI, "WMI_DEBUG_MESG_EVENTID, dropped: %i\n",
+		   m[0]);
+	/* Format is dropped-count(u32) [message buffer]. */
+	if (ath10k_debug_mask & ATH10K_DBG_FIRMWARE)
+		ath10k_dbg_print_fw_dbg_buffer((u8 *)(&(m[1])), skb->len - 4);
 }
 
 static void ath10k_wmi_event_update_stats(struct ath10k *ar,
@@ -1402,7 +1407,10 @@ static void ath10k_wmi_event_profile_match(struct ath10k *ar,
 static void ath10k_wmi_event_debug_print(struct ath10k *ar,
 				  struct sk_buff *skb)
 {
+	struct wmi_debug_mesg_event *ev;
+	ev = (struct wmi_debug_mesg_event *)(skb->data);
 	ath10k_dbg(ATH10K_DBG_WMI, "WMI_DEBUG_PRINT_EVENTID\n");
+	ath10k_dbg(ATH10K_DBG_FIRMWARE, "%s\n", ev->bufp);
 }
 
 static void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb)
Signature · 7 lines
1.7.11.7


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw
Quoted 6 lines · <[email protected]> writes:

From: Ben Greear <[email protected]>

This should aid in debugging firmware issues on standard NIC hardware that does not have a serial port.

I have been working on using a tracepoint for this. That way we can do this in user space.

Signature · 6 lines
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k