File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: GPL-2.0-only
22/* Copyright (c) 2014 Protonic Holland,
33 * David Jander
4- * Copyright (C) 2014-2021 Pengutronix,
4+ * Copyright (C) 2014-2021, 2023 Pengutronix,
55 * Marc Kleine-Budde <kernel@pengutronix.de>
66 */
77
@@ -280,6 +280,31 @@ int can_rx_offload_queue_tail(struct can_rx_offload *offload,
280280}
281281EXPORT_SYMBOL_GPL (can_rx_offload_queue_tail );
282282
283+ unsigned int
284+ can_rx_offload_get_echo_skb_queue_tail (struct can_rx_offload * offload ,
285+ unsigned int idx ,
286+ unsigned int * frame_len_ptr )
287+ {
288+ struct net_device * dev = offload -> dev ;
289+ struct net_device_stats * stats = & dev -> stats ;
290+ struct sk_buff * skb ;
291+ unsigned int len ;
292+ int err ;
293+
294+ skb = __can_get_echo_skb (dev , idx , & len , frame_len_ptr );
295+ if (!skb )
296+ return 0 ;
297+
298+ err = can_rx_offload_queue_tail (offload , skb );
299+ if (err ) {
300+ stats -> rx_errors ++ ;
301+ stats -> tx_fifo_errors ++ ;
302+ }
303+
304+ return len ;
305+ }
306+ EXPORT_SYMBOL_GPL (can_rx_offload_get_echo_skb_queue_tail );
307+
283308void can_rx_offload_irq_finish (struct can_rx_offload * offload )
284309{
285310 unsigned long flags ;
Original file line number Diff line number Diff line change 33 * linux/can/rx-offload.h
44 *
55 * Copyright (c) 2014 David Jander, Protonic Holland
6- * Copyright (c) 2014-2017 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
6+ * Copyright (c) 2014-2017, 2023 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
77 */
88
99#ifndef _CAN_RX_OFFLOAD_H
@@ -49,6 +49,9 @@ unsigned int can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *
4949 unsigned int * frame_len_ptr );
5050int can_rx_offload_queue_tail (struct can_rx_offload * offload ,
5151 struct sk_buff * skb );
52+ unsigned int can_rx_offload_get_echo_skb_queue_tail (struct can_rx_offload * offload ,
53+ unsigned int idx ,
54+ unsigned int * frame_len_ptr );
5255void can_rx_offload_irq_finish (struct can_rx_offload * offload );
5356void can_rx_offload_threaded_irq_finish (struct can_rx_offload * offload );
5457void can_rx_offload_del (struct can_rx_offload * offload );
You can’t perform that action at this time.
0 commit comments