mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
net: fec: add fec_txq_trigger_xmit() helper
Currently, the workaround for FEC_QUIRK_ERR007885 has three call sites, so add the helper fec_txq_trigger_xmit() to make the code more concise and reusable. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260205085742.2685134-2-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
d82cb7b7ec
commit
c8d4ad9176
|
|
@ -508,6 +508,17 @@ fec_enet_create_page_pool(struct fec_enet_private *fep,
|
|||
return err;
|
||||
}
|
||||
|
||||
static void fec_txq_trigger_xmit(struct fec_enet_private *fep,
|
||||
struct fec_enet_priv_tx_q *txq)
|
||||
{
|
||||
if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active))
|
||||
writel(0, txq->bd.reg_desc_active);
|
||||
}
|
||||
|
||||
static struct bufdesc *
|
||||
fec_enet_txq_submit_frag_skb(struct fec_enet_priv_tx_q *txq,
|
||||
struct sk_buff *skb,
|
||||
|
|
@ -717,12 +728,7 @@ static int fec_enet_txq_submit_skb(struct fec_enet_priv_tx_q *txq,
|
|||
txq->bd.cur = bdp;
|
||||
|
||||
/* Trigger transmission start */
|
||||
if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active))
|
||||
writel(0, txq->bd.reg_desc_active);
|
||||
fec_txq_trigger_xmit(fep, txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -913,12 +919,7 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,
|
|||
txq->bd.cur = bdp;
|
||||
|
||||
/* Trigger transmission start */
|
||||
if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active))
|
||||
writel(0, txq->bd.reg_desc_active);
|
||||
fec_txq_trigger_xmit(fep, txq);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
@ -3936,12 +3937,7 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
|
|||
txq->bd.cur = bdp;
|
||||
|
||||
/* Trigger transmission start */
|
||||
if (!(fep->quirks & FEC_QUIRK_ERR007885) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active) ||
|
||||
!readl(txq->bd.reg_desc_active))
|
||||
writel(0, txq->bd.reg_desc_active);
|
||||
fec_txq_trigger_xmit(fep, txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user