Commit 2e3df4a3 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

can: rx-offload: rename rx_offload_get_echo_skb() -> can_rx_offload_get_echo_skb_queue_timestamp()

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.deSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 412fbb84
...@@ -240,9 +240,10 @@ int can_rx_offload_queue_timestamp(struct can_rx_offload *offload, ...@@ -240,9 +240,10 @@ int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
} }
EXPORT_SYMBOL_GPL(can_rx_offload_queue_timestamp); EXPORT_SYMBOL_GPL(can_rx_offload_queue_timestamp);
unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload, unsigned int
unsigned int idx, u32 timestamp, can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
unsigned int *frame_len_ptr) unsigned int idx, u32 timestamp,
unsigned int *frame_len_ptr)
{ {
struct net_device *dev = offload->dev; struct net_device *dev = offload->dev;
struct net_device_stats *stats = &dev->stats; struct net_device_stats *stats = &dev->stats;
...@@ -262,7 +263,7 @@ unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload, ...@@ -262,7 +263,7 @@ unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
return len; 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, int can_rx_offload_queue_tail(struct can_rx_offload *offload,
struct sk_buff *skb) struct sk_buff *skb)
......
...@@ -1097,8 +1097,8 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) ...@@ -1097,8 +1097,8 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
handled = IRQ_HANDLED; handled = IRQ_HANDLED;
stats->tx_bytes += stats->tx_bytes +=
can_rx_offload_get_echo_skb(&priv->offload, 0, can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload, 0,
reg_ctrl << 16, NULL); reg_ctrl << 16, NULL);
stats->tx_packets++; stats->tx_packets++;
/* after sending a RTR frame MB is in RX mode */ /* after sending a RTR frame MB is in RX mode */
......
...@@ -1016,10 +1016,10 @@ static void m_can_tx_update_stats(struct m_can_classdev *cdev, ...@@ -1016,10 +1016,10 @@ static void m_can_tx_update_stats(struct m_can_classdev *cdev,
if (cdev->is_peripheral) if (cdev->is_peripheral)
stats->tx_bytes += stats->tx_bytes +=
can_rx_offload_get_echo_skb(&cdev->offload, can_rx_offload_get_echo_skb_queue_timestamp(&cdev->offload,
msg_mark, msg_mark,
timestamp, timestamp,
NULL); NULL);
else else
stats->tx_bytes += can_get_echo_skb(dev, msg_mark, NULL); stats->tx_bytes += can_get_echo_skb(dev, msg_mark, NULL);
......
...@@ -111,9 +111,9 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, ...@@ -111,9 +111,9 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv,
if (skb) if (skb)
mcp251xfd_skb_set_timestamp(priv, skb, hw_tef_obj->ts); mcp251xfd_skb_set_timestamp(priv, skb, hw_tef_obj->ts);
stats->tx_bytes += stats->tx_bytes +=
can_rx_offload_get_echo_skb(&priv->offload, can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload,
tef_tail, hw_tef_obj->ts, tef_tail, hw_tef_obj->ts,
frame_len_ptr); frame_len_ptr);
stats->tx_packets++; stats->tx_packets++;
priv->tef->tail++; priv->tef->tail++;
......
...@@ -747,8 +747,8 @@ static irqreturn_t ti_hecc_interrupt(int irq, void *dev_id) ...@@ -747,8 +747,8 @@ static irqreturn_t ti_hecc_interrupt(int irq, void *dev_id)
spin_unlock_irqrestore(&priv->mbx_lock, flags); spin_unlock_irqrestore(&priv->mbx_lock, flags);
stamp = hecc_read_stamp(priv, mbxno); stamp = hecc_read_stamp(priv, mbxno);
stats->tx_bytes += stats->tx_bytes +=
can_rx_offload_get_echo_skb(&priv->offload, can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload,
mbxno, stamp, NULL); mbxno, stamp, NULL);
stats->tx_packets++; stats->tx_packets++;
--priv->tx_tail; --priv->tx_tail;
} }
......
...@@ -44,9 +44,9 @@ int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, ...@@ -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_irq_offload_fifo(struct can_rx_offload *offload);
int can_rx_offload_queue_timestamp(struct can_rx_offload *offload, int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
struct sk_buff *skb, u32 timestamp); struct sk_buff *skb, u32 timestamp);
unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload, unsigned int can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
unsigned int idx, u32 timestamp, unsigned int idx, u32 timestamp,
unsigned int *frame_len_ptr); unsigned int *frame_len_ptr);
int can_rx_offload_queue_tail(struct can_rx_offload *offload, int can_rx_offload_queue_tail(struct can_rx_offload *offload,
struct sk_buff *skb); struct sk_buff *skb);
void can_rx_offload_irq_finish(struct can_rx_offload *offload); void can_rx_offload_irq_finish(struct can_rx_offload *offload);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment