diff options
author | J. Neuschäfer <j.ne@posteo.net> | 2025-02-16 22:18:12 +0100 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2025-03-03 14:18:48 +0800 |
commit | a149456d6a5457abe0187eb38a8ccb5d1da1bf0f (patch) | |
tree | e937465ea16a4f7f0d2cacfe8be40cdd8ae6717e /drivers/net/tsec.c | |
parent | 6ae0a578de67038df291a5fea3e7ab67cc520680 (diff) |
net: tsec: Reorder tsec_recv and tsec_free_pkt
This is necessary for the following patch. No functional change.
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/net/tsec.c')
-rw-r--r-- | drivers/net/tsec.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 6481ee24a60..b27fc322db5 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -278,6 +278,24 @@ static int tsec_send(struct udevice *dev, void *packet, int length) return result; } +static int tsec_free_pkt(struct udevice *dev, uchar *packet, int length) +{ + struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev); + u16 status; + + out_be16(&priv->rxbd[priv->rx_idx].length, 0); + + status = RXBD_EMPTY; + /* Set the wrap bit if this is the last element in the list */ + if ((priv->rx_idx + 1) == PKTBUFSRX) + status |= RXBD_WRAP; + out_be16(&priv->rxbd[priv->rx_idx].status, status); + + priv->rx_idx = (priv->rx_idx + 1) % PKTBUFSRX; + + return 0; +} + static int tsec_recv(struct udevice *dev, int flags, uchar **packetp) { struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev); @@ -307,24 +325,6 @@ static int tsec_recv(struct udevice *dev, int flags, uchar **packetp) return ret; } -static int tsec_free_pkt(struct udevice *dev, uchar *packet, int length) -{ - struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev); - u16 status; - - out_be16(&priv->rxbd[priv->rx_idx].length, 0); - - status = RXBD_EMPTY; - /* Set the wrap bit if this is the last element in the list */ - if ((priv->rx_idx + 1) == PKTBUFSRX) - status |= RXBD_WRAP; - out_be16(&priv->rxbd[priv->rx_idx].status, status); - - priv->rx_idx = (priv->rx_idx + 1) % PKTBUFSRX; - - return 0; -} - static void tsec_halt(struct udevice *dev) { struct tsec_private *priv; |