mirror of https://gitee.com/openkylin/linux.git
brcmfmac: release transmit packet in brcmf_txcomplete()
In the bus-specific driver code each call to brcmf_txcomplete() is following by a free of that packet. This patch moves that free to the brcmf_txcomplete() function. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Piotr Haber <phaber@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>
This commit is contained in:
parent
349e7104ff
commit
7f4bceecf0
|
@ -134,7 +134,7 @@ extern void brcmf_dev_reset(struct device *dev);
|
|||
/* Indication from bus module to change flow-control state */
|
||||
extern void brcmf_txflowblock(struct device *dev, bool state);
|
||||
|
||||
/* Notify tx completion */
|
||||
/* Notify the bus has transferred the tx packet to firmware */
|
||||
extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp,
|
||||
bool success);
|
||||
|
||||
|
|
|
@ -364,7 +364,7 @@ void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success)
|
|||
|
||||
ifp = drvr->iflist[ifidx];
|
||||
if (!ifp)
|
||||
return;
|
||||
goto done;
|
||||
|
||||
if (res == 0) {
|
||||
eh = (struct ethhdr *)(txp->data);
|
||||
|
@ -378,6 +378,9 @@ void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success)
|
|||
}
|
||||
if (!success)
|
||||
ifp->stats.tx_errors++;
|
||||
|
||||
done:
|
||||
brcmu_pkt_buf_free_skb(txp);
|
||||
}
|
||||
|
||||
static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev)
|
||||
|
|
|
@ -1775,7 +1775,7 @@ brcmf_sdbrcm_wait_event_wakeup(struct brcmf_sdio *bus)
|
|||
/* Writes a HW/SW header into the packet and sends it. */
|
||||
/* Assumes: (a) header space already there, (b) caller holds lock */
|
||||
static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
|
||||
uint chan, bool free_pkt)
|
||||
uint chan)
|
||||
{
|
||||
int ret;
|
||||
u8 *frame;
|
||||
|
@ -1805,10 +1805,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
|
|||
|
||||
pkt_align(new, pkt->len, BRCMF_SDALIGN);
|
||||
memcpy(new->data, pkt->data, pkt->len);
|
||||
if (free_pkt)
|
||||
brcmu_pkt_buf_free_skb(pkt);
|
||||
/* free the pkt if canned one is not used */
|
||||
free_pkt = true;
|
||||
pkt = new;
|
||||
frame = (u8 *) (pkt->data);
|
||||
/* precondition: (frame % BRCMF_SDALIGN) == 0) */
|
||||
|
@ -1901,10 +1898,6 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
|
|||
/* restore pkt buffer pointer before calling tx complete routine */
|
||||
skb_pull(pkt, SDPCM_HDRLEN + pad);
|
||||
brcmf_txcomplete(bus->sdiodev->dev, pkt, ret != 0);
|
||||
|
||||
if (free_pkt)
|
||||
brcmu_pkt_buf_free_skb(pkt);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1932,7 +1925,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes)
|
|||
spin_unlock_bh(&bus->txqlock);
|
||||
datalen = pkt->len - SDPCM_HDRLEN;
|
||||
|
||||
ret = brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_DATA_CHANNEL, true);
|
||||
ret = brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_DATA_CHANNEL);
|
||||
|
||||
/* In poll mode, need to check for other events */
|
||||
if (!bus->intr && cnt) {
|
||||
|
@ -2343,7 +2336,6 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt)
|
|||
if (!brcmf_c_prec_enq(bus->sdiodev->dev, &bus->txq, pkt, prec)) {
|
||||
skb_pull(pkt, SDPCM_HDRLEN);
|
||||
brcmf_txcomplete(bus->sdiodev->dev, pkt, false);
|
||||
brcmu_pkt_buf_free_skb(pkt);
|
||||
brcmf_err("out of bus->txq !!!\n");
|
||||
ret = -ENOSR;
|
||||
} else {
|
||||
|
|
|
@ -417,8 +417,6 @@ static void brcmf_usb_tx_complete(struct urb *urb)
|
|||
brcmf_usb_del_fromq(devinfo, req);
|
||||
|
||||
brcmf_txcomplete(devinfo->dev, req->skb, urb->status == 0);
|
||||
|
||||
brcmu_pkt_buf_free_skb(req->skb);
|
||||
req->skb = NULL;
|
||||
brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, &devinfo->tx_freecount);
|
||||
if (devinfo->tx_freecount > devinfo->tx_high_watermark &&
|
||||
|
|
Loading…
Reference in New Issue