Commit 4b776961 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmfmac: support hardware extension header in trace_brcmf_sdpcm_hdr()

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: default avatarFranky Lin <frankyl@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 89eda364
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment