brcmfmac: pass struct brcmf_if instance in brcmf_txfinalize()
Most call sites of brcmf_txfinalize already have struct brcmf_if instance so pass that to brcmf_txfinalize() as the function needs it anyway. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
46f3b6ee48
commit
054e68add6
4 changed files with 15 additions and 17 deletions
|
@ -560,17 +560,11 @@ void brcmf_rx_frame(struct device *dev, struct sk_buff *skb)
|
||||||
brcmf_netif_rx(ifp, skb);
|
brcmf_netif_rx(ifp, skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp, u8 ifidx,
|
void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success)
|
||||||
bool success)
|
|
||||||
{
|
{
|
||||||
struct brcmf_if *ifp;
|
|
||||||
struct ethhdr *eh;
|
struct ethhdr *eh;
|
||||||
u16 type;
|
u16 type;
|
||||||
|
|
||||||
ifp = drvr->iflist[ifidx];
|
|
||||||
if (!ifp)
|
|
||||||
goto done;
|
|
||||||
|
|
||||||
eh = (struct ethhdr *)(txp->data);
|
eh = (struct ethhdr *)(txp->data);
|
||||||
type = ntohs(eh->h_proto);
|
type = ntohs(eh->h_proto);
|
||||||
|
|
||||||
|
@ -582,7 +576,7 @@ void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp, u8 ifidx,
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
ifp->stats.tx_errors++;
|
ifp->stats.tx_errors++;
|
||||||
done:
|
|
||||||
brcmu_pkt_buf_free_skb(txp);
|
brcmu_pkt_buf_free_skb(txp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -600,7 +594,7 @@ void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success)
|
||||||
if (brcmf_proto_hdrpull(drvr, false, txp, &ifp))
|
if (brcmf_proto_hdrpull(drvr, false, txp, &ifp))
|
||||||
brcmu_pkt_buf_free_skb(txp);
|
brcmu_pkt_buf_free_skb(txp);
|
||||||
else
|
else
|
||||||
brcmf_txfinalize(drvr, txp, ifp->ifidx, success);
|
brcmf_txfinalize(ifp, txp, success);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,8 +210,7 @@ void brcmf_remove_interface(struct brcmf_if *ifp);
|
||||||
int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr);
|
int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr);
|
||||||
void brcmf_txflowblock_if(struct brcmf_if *ifp,
|
void brcmf_txflowblock_if(struct brcmf_if *ifp,
|
||||||
enum brcmf_netif_stop_reason reason, bool state);
|
enum brcmf_netif_stop_reason reason, bool state);
|
||||||
void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp, u8 ifidx,
|
void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
|
||||||
bool success);
|
|
||||||
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
|
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
|
||||||
|
|
||||||
/* Sets dongle media info (drv_version, mac address). */
|
/* Sets dongle media info (drv_version, mac address). */
|
||||||
|
|
|
@ -1506,7 +1506,7 @@ brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot,
|
||||||
ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, ifp->ifidx,
|
ret = brcmf_fws_txstatus_suppressed(fws, fifo, skb, ifp->ifidx,
|
||||||
genbit, seq);
|
genbit, seq);
|
||||||
if (remove_from_hanger || ret)
|
if (remove_from_hanger || ret)
|
||||||
brcmf_txfinalize(fws->drvr, skb, ifp->ifidx, true);
|
brcmf_txfinalize(ifp, skb, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1905,7 +1905,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
|
||||||
if (fws->avoid_queueing) {
|
if (fws->avoid_queueing) {
|
||||||
rc = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb);
|
rc = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
brcmf_txfinalize(drvr, skb, ifp->ifidx, false);
|
brcmf_txfinalize(ifp, skb, false);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1929,7 +1929,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
|
||||||
brcmf_fws_schedule_deq(fws);
|
brcmf_fws_schedule_deq(fws);
|
||||||
} else {
|
} else {
|
||||||
brcmf_err("drop skb: no hanger slot\n");
|
brcmf_err("drop skb: no hanger slot\n");
|
||||||
brcmf_txfinalize(drvr, skb, ifp->ifidx, false);
|
brcmf_txfinalize(ifp, skb, false);
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
}
|
}
|
||||||
brcmf_fws_unlock(fws);
|
brcmf_fws_unlock(fws);
|
||||||
|
@ -2009,8 +2009,9 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker)
|
||||||
ret = brcmf_proto_txdata(drvr, ifidx, 0, skb);
|
ret = brcmf_proto_txdata(drvr, ifidx, 0, skb);
|
||||||
brcmf_fws_lock(fws);
|
brcmf_fws_lock(fws);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
brcmf_txfinalize(drvr, skb, ifidx,
|
brcmf_txfinalize(brcmf_get_ifp(drvr,
|
||||||
false);
|
ifidx),
|
||||||
|
skb, false);
|
||||||
if (fws->bus_flow_blocked)
|
if (fws->bus_flow_blocked)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -873,7 +873,11 @@ brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf)
|
||||||
commonring = msgbuf->flowrings[flowid];
|
commonring = msgbuf->flowrings[flowid];
|
||||||
atomic_dec(&commonring->outstanding_tx);
|
atomic_dec(&commonring->outstanding_tx);
|
||||||
|
|
||||||
brcmf_txfinalize(msgbuf->drvr, skb, tx_status->msg.ifidx, true);
|
/* Hante: i believe this was a bug as tx_status->msg.ifidx was used
|
||||||
|
* in brcmf_txfinalize as index in drvr->iflist. Can you confirm/deny?
|
||||||
|
*/
|
||||||
|
brcmf_txfinalize(brcmf_get_ifp(msgbuf->drvr, tx_status->msg.ifidx),
|
||||||
|
skb, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue