]> git.itanic.dy.fi Git - linux-stable/commitdiff
can: rx-offload: rename rx_offload_get_echo_skb() -> can_rx_offload_get_echo_skb_queu...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 2 Jun 2023 07:36:38 +0000 (09:36 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 28 Jul 2023 07:45:24 +0000 (09:45 +0200)
Rename the rx_offload_get_echo_skb() function to
can_rx_offload_get_echo_skb_queue_timestamp(), since it inserts the
echo skb into the rx-offload queue sorted by timestamp.

This is a preparation for adding
can_rx_offload_get_echo_skb_queue_tail(), which adds the echo skb to
the end of the queue. This is intended for devices that do not support
timestamps.

Link: https://lore.kernel.org/all/20230718-gs_usb-rx-offload-v2-1-716e542d14d5@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/rx-offload.c
drivers/net/can/flexcan/flexcan-core.c
drivers/net/can/m_can/m_can.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
drivers/net/can/ti_hecc.c
include/linux/can/rx-offload.h

index 161e45a7e8c1135700165b553704c4256baef63f..6e87ad90834678c7411e1ac2be7cfb702558abb7 100644 (file)
@@ -240,9 +240,10 @@ int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
 }
 EXPORT_SYMBOL_GPL(can_rx_offload_queue_timestamp);
 
-unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
-                                        unsigned int idx, u32 timestamp,
-                                        unsigned int *frame_len_ptr)
+unsigned int
+can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
+                                           unsigned int idx, u32 timestamp,
+                                           unsigned int *frame_len_ptr)
 {
        struct net_device *dev = offload->dev;
        struct net_device_stats *stats = &dev->stats;
@@ -262,7 +263,7 @@ unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
 
        return len;
 }
-EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb);
+EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb_queue_timestamp);
 
 int can_rx_offload_queue_tail(struct can_rx_offload *offload,
                              struct sk_buff *skb)
index ff0fc18baf133c86596da9d6c7d630870b5c0cfc..48273d51f271194d2d2b10a00159ba8464dab60a 100644 (file)
@@ -1097,8 +1097,8 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 
                handled = IRQ_HANDLED;
                stats->tx_bytes +=
-                       can_rx_offload_get_echo_skb(&priv->offload, 0,
-                                                   reg_ctrl << 16, NULL);
+                       can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload, 0,
+                                                                   reg_ctrl << 16, NULL);
                stats->tx_packets++;
 
                /* after sending a RTR frame MB is in RX mode */
index a6263a617ac93331f50f4b9af10336189ba48c78..d204703521d28aca12ea1fe4b9a0f9f5a59c59ab 100644 (file)
@@ -1016,10 +1016,10 @@ static void m_can_tx_update_stats(struct m_can_classdev *cdev,
 
        if (cdev->is_peripheral)
                stats->tx_bytes +=
-                       can_rx_offload_get_echo_skb(&cdev->offload,
-                                                   msg_mark,
-                                                   timestamp,
-                                                   NULL);
+                       can_rx_offload_get_echo_skb_queue_timestamp(&cdev->offload,
+                                                                   msg_mark,
+                                                                   timestamp,
+                                                                   NULL);
        else
                stats->tx_bytes += can_get_echo_skb(dev, msg_mark, NULL);
 
index 237617b0c125f49b66fc19ee413d135715a8ebf2..e5bd57b65aafedded12bb0ec90b93fd3433b1a6d 100644 (file)
@@ -111,9 +111,9 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv,
        if (skb)
                mcp251xfd_skb_set_timestamp(priv, skb, hw_tef_obj->ts);
        stats->tx_bytes +=
-               can_rx_offload_get_echo_skb(&priv->offload,
-                                           tef_tail, hw_tef_obj->ts,
-                                           frame_len_ptr);
+               can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload,
+                                                           tef_tail, hw_tef_obj->ts,
+                                                           frame_len_ptr);
        stats->tx_packets++;
        priv->tef->tail++;
 
index a8243acde92d75f1a593b19d22d2abc1415550c3..5aab440074c690e36eab868e9e456355a3c608c2 100644 (file)
@@ -747,8 +747,8 @@ static irqreturn_t ti_hecc_interrupt(int irq, void *dev_id)
                        spin_unlock_irqrestore(&priv->mbx_lock, flags);
                        stamp = hecc_read_stamp(priv, mbxno);
                        stats->tx_bytes +=
-                               can_rx_offload_get_echo_skb(&priv->offload,
-                                                           mbxno, stamp, NULL);
+                               can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload,
+                                                                           mbxno, stamp, NULL);
                        stats->tx_packets++;
                        --priv->tx_tail;
                }
index c205c51d79c9076dbcce6d74593115227f246daa..e3b4199732c6a5d84119088328e17b753ea528b4 100644 (file)
@@ -44,9 +44,9 @@ int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload,
 int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
 int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
                                   struct sk_buff *skb, u32 timestamp);
-unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
-                                        unsigned int idx, u32 timestamp,
-                                        unsigned int *frame_len_ptr);
+unsigned int can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
+                                                        unsigned int idx, u32 timestamp,
+                                                        unsigned int *frame_len_ptr);
 int can_rx_offload_queue_tail(struct can_rx_offload *offload,
                              struct sk_buff *skb);
 void can_rx_offload_irq_finish(struct can_rx_offload *offload);