From: Arend van Spriel Date: Tue, 15 Oct 2013 13:44:55 +0000 (+0200) Subject: brcmfmac: fix brcmf_sdcard_send_pkt() for host without sg support X-Git-Tag: firefly_0821_release~176^2~4570^2~3^2^2~335 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c8cce1f9a714b90ab454e3ac4a9968445e228b81;p=firefly-linux-kernel-4.4.55.git brcmfmac: fix brcmf_sdcard_send_pkt() for host without sg support If the host does not support scatter-gather transmit the packets in the pktq individually using brcmf_sdio_buffrw(). Reviewed-by: Franky Lin Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c index 92818d790de5..1103dc1cc9dc 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c @@ -620,6 +620,7 @@ int brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn, uint flags, struct sk_buff_head *pktq) { + struct sk_buff *skb; uint width; int err; @@ -631,9 +632,16 @@ brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn, if (err) return err; - if (pktq->qlen == 1) - return brcmf_sdio_buffrw(sdiodev, fn, true, addr, pktq->next); - return brcmf_sdio_sglist_rw(sdiodev, fn, true, addr, pktq); + if (pktq->qlen == 1 || !sdiodev->sg_support) + skb_queue_walk(pktq, skb) { + err = brcmf_sdio_buffrw(sdiodev, fn, true, addr, skb); + if (err) + break; + } + else + err = brcmf_sdio_sglist_rw(sdiodev, fn, true, addr, pktq); + + return err; } int