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

brcmfmac: minor optimization of brcmf_sdbrcm_txpkt() function

When taking care of packet alignment to 64-byte boundary padding may
be added between SDPCM header and CDC data. It clear both SDPCM header
space and padding space. Changed it to only clear padding space. In
filling the SDPCM header it uses unaligned access to set SDPCM software
header, but preceding code assures it is properly aligned.
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Change-Id: Iad22f277f3496440ba4d2db771205714774570ac
Reviewed-on: http://lb-bun-88.bun.broadcom.com:8080/76Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Reviewed-by: default avatarPiotr Haber <phaber@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a886f7f4
...@@ -1813,8 +1813,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt, ...@@ -1813,8 +1813,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
} else { } else {
skb_push(pkt, pad); skb_push(pkt, pad);
frame = (u8 *) (pkt->data); frame = (u8 *) (pkt->data);
/* precondition: pad + SDPCM_HDRLEN <= pkt->len */ memset(frame + SDPCM_HDRLEN, 0, pad);
memset(frame, 0, pad + SDPCM_HDRLEN);
} }
} }
/* precondition: pad < BRCMF_SDALIGN */ /* precondition: pad < BRCMF_SDALIGN */
...@@ -1830,8 +1829,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt, ...@@ -1830,8 +1829,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
(((pad + (((pad +
SDPCM_HDRLEN) << SDPCM_DOFFSET_SHIFT) & SDPCM_DOFFSET_MASK); SDPCM_HDRLEN) << SDPCM_DOFFSET_SHIFT) & SDPCM_DOFFSET_MASK);
put_unaligned_le32(swheader, frame + SDPCM_FRAMETAG_LEN); *(((__le32 *) frame) + 1) = cpu_to_le32(swheader);
put_unaligned_le32(0, frame + SDPCM_FRAMETAG_LEN + sizeof(swheader)); *(((__le32 *) frame) + 2) = 0;
#ifdef DEBUG #ifdef DEBUG
tx_packets[pkt->priority]++; tx_packets[pkt->priority]++;
......
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