diff mbox

[RFC,2/4] ath10k: save firmware debug log messages.

Message ID 1401812719-25061-2-git-send-email-greearb@candelatech.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ben Greear June 3, 2014, 4:25 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

They may be dumped through the firmware dump debugfs
file.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Joe Perches June 3, 2014, 4:45 p.m. UTC | #1
On Tue, 2014-06-03 at 09:25 -0700, greearb@candelatech.com wrote:
> They may be dumped through the firmware dump debugfs
> file.
[]
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
[]
> @@ -1084,11 +1084,14 @@ static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb)
>  
>  static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
>  {
> +	u32 *m = (u32 *)(skb->data);
>  	ath10k_dbg(ATH10K_DBG_WMI, "wmi event debug mesg len %d\n",
>  		   skb->len);
>  
>  	trace_ath10k_wmi_dbglog(skb->data, skb->len);
>  
> +	ath10k_dbg_save_fw_dbg_buffer(ar, (u8 *)(&(m[1])), skb->len - 4);
> +
>  	return 0;
>  }
>  

That last line looks an overly complicated way of writing

	ath10k_dbg_save_fw_dbg_buffer(ar, skb->data + 4, skb->len - 4);

btw: why skip the first 4 bytes?


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Greear June 3, 2014, 4:49 p.m. UTC | #2
On 06/03/2014 09:45 AM, Joe Perches wrote:
> On Tue, 2014-06-03 at 09:25 -0700, greearb@candelatech.com wrote:
>> They may be dumped through the firmware dump debugfs
>> file.
> []
>> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> []
>> @@ -1084,11 +1084,14 @@ static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb)
>>  
>>  static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
>>  {
>> +	u32 *m = (u32 *)(skb->data);
>>  	ath10k_dbg(ATH10K_DBG_WMI, "wmi event debug mesg len %d\n",
>>  		   skb->len);
>>  
>>  	trace_ath10k_wmi_dbglog(skb->data, skb->len);
>>  
>> +	ath10k_dbg_save_fw_dbg_buffer(ar, (u8 *)(&(m[1])), skb->len - 4);
>> +
>>  	return 0;
>>  }
>>  
> 
> That last line looks an overly complicated way of writing
> 
> 	ath10k_dbg_save_fw_dbg_buffer(ar, skb->data + 4, skb->len - 4);
> 
> btw: why skip the first 4 bytes?

First 4 bytes is a counter meaning something like 'messages lost due to overflow',
and is not really part of the debug messages.

Thanks,
Ben
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 4b7782a..7637618 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1084,11 +1084,14 @@  static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb)
 
 static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
 {
+	u32 *m = (u32 *)(skb->data);
 	ath10k_dbg(ATH10K_DBG_WMI, "wmi event debug mesg len %d\n",
 		   skb->len);
 
 	trace_ath10k_wmi_dbglog(skb->data, skb->len);
 
+	ath10k_dbg_save_fw_dbg_buffer(ar, (u8 *)(&(m[1])), skb->len - 4);
+
 	return 0;
 }