brcmfmac: support hardware extension header in trace_brcmf_sdpcm_hdr()
authorArend van Spriel <arend@broadcom.com>
Fri, 29 Nov 2013 11:25:06 +0000 (12:25 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 2 Dec 2013 19:25:19 +0000 (14:25 -0500)
The SDPCM header can be traced, but it used a fixed header size. With
txglom feature the SDPCM header will have additional 8 bytes of hardware
extension header so SDIO core can properly handle the txglom packet.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h

index 2597a534e6949bc75bc970a7d6751f0c10852105..510ab184efb5625cf3aa304bb7256ef36dc491f9 100644 (file)
@@ -1147,7 +1147,7 @@ static int brcmf_sdio_hdparse(struct brcmf_sdio *bus, u8 *header,
        u8 rx_seq, fc, tx_seq_max;
        u32 swheader;
 
-       trace_brcmf_sdpcm_hdr(false, header);
+       trace_brcmf_sdpcm_hdr(SDPCM_RX, header);
 
        /* hw header */
        len = get_unaligned_le16(header);
@@ -1271,7 +1271,7 @@ static void brcmf_sdio_hdpack(struct brcmf_sdio *bus, u8 *header,
                     SDPCM_DOFFSET_MASK;
        *(((__le32 *)header) + 1) = cpu_to_le32(sw_header);
        *(((__le32 *)header) + 2) = 0;
-       trace_brcmf_sdpcm_hdr(true, header);
+       trace_brcmf_sdpcm_hdr(SDPCM_TX, header);
 }
 
 static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
index 3c67529b90743123691d08aa7ed4d3fdb4a45c6d..d229cda98aa7628081ec75fe90ada47428e79265 100644 (file)
@@ -110,21 +110,32 @@ TRACE_EVENT(brcmf_bdchdr,
        TP_printk("bdc: prio=%d siglen=%d", __entry->prio, __entry->siglen)
 );
 
+#ifndef SDPCM_RX
+#define SDPCM_RX       0
+#endif
+#ifndef SDPCM_TX
+#define SDPCM_TX       1
+#endif
+#ifndef SDPCM_GLOM
+#define SDPCM_GLOM     2
+#endif
+
 TRACE_EVENT(brcmf_sdpcm_hdr,
-       TP_PROTO(bool tx, void *data),
-       TP_ARGS(tx, data),
+       TP_PROTO(u8 dir, void *data),
+       TP_ARGS(dir, data),
        TP_STRUCT__entry(
-               __field(u8, tx)
+               __field(u8, dir)
                __field(u16, len)
-               __array(u8, hdr, 12)
+               __dynamic_array(u8, hdr, dir == SDPCM_GLOM ? 20 : 12)
        ),
        TP_fast_assign(
-               memcpy(__entry->hdr, data, 12);
-               __entry->len = __entry->hdr[0] | (__entry->hdr[1] << 8);
-               __entry->tx = tx ? 1 : 0;
+               memcpy(__get_dynamic_array(hdr), data, dir == SDPCM_GLOM ? 20 : 12);
+               __entry->len = *(u8 *)data | (*((u8 *)data + 1) << 8);
+               __entry->dir = dir;
        ),
-       TP_printk("sdpcm: %s len %u, seq %d", __entry->tx ? "TX" : "RX",
-                 __entry->len, __entry->hdr[4])
+       TP_printk("sdpcm: %s len %u, seq %d",
+                 __entry->dir == SDPCM_RX ? "RX" : "TX",
+                 __entry->len, ((u8 *)__get_dynamic_array(hdr))[4])
 );
 
 #ifdef CONFIG_BRCM_TRACING