]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: tsec: Reorder tsec_recv and tsec_free_pkt
authorJ. Neuschäfer <j.ne@posteo.net>
Sun, 16 Feb 2025 21:18:12 +0000 (22:18 +0100)
committerPeng Fan <peng.fan@nxp.com>
Mon, 3 Mar 2025 06:18:48 +0000 (14:18 +0800)
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>
drivers/net/tsec.c

index 6481ee24a6010099cbabb5a213641c63706176a2..b27fc322db55b7b845f8d629348cb34d79de3cc2 100644 (file)
@@ -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;