]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath6kl: add padding to firmware log records
authorEtay Luz <eluz@qca.qualcomm.com>
Wed, 29 Feb 2012 01:17:15 +0000 (17:17 -0800)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 1 Mar 2012 06:47:21 +0000 (08:47 +0200)
firmware debug utility expects firmware log record size
to be 1500 bytes. This patch ensures that the
firmware record will be exactly 1500 bytes.

kvalo: remove trailing space

Signed-off-by: Etay Luz <eluz@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/debug.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 3d0713d..28b516f
@@ -277,7 +277,7 @@ void ath6kl_debug_fwlog_event(struct ath6kl *ar, const void *buf, size_t len)
        if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE))
                return;
 
-       slot_len = sizeof(*slot) + len;
+       slot_len = sizeof(*slot) + ATH6KL_FWLOG_PAYLOAD_SIZE;
 
        skb = alloc_skb(slot_len, GFP_KERNEL);
        if (!skb)
@@ -288,6 +288,9 @@ void ath6kl_debug_fwlog_event(struct ath6kl *ar, const void *buf, size_t len)
        slot->length = cpu_to_le32(len);
        memcpy(slot->payload, buf, len);
 
+       /* Need to pad each record to fixed length ATH6KL_FWLOG_PAYLOAD_SIZE */
+       memset(slot->payload + len, 0, ATH6KL_FWLOG_PAYLOAD_SIZE - len);
+
        spin_lock(&ar->debug.fwlog_queue.lock);
 
        __skb_queue_tail(&ar->debug.fwlog_queue, skb);