1 /* SPDX-License-Identifier: GPL-2.0-only */ << 2 /* 1 /* 3 * linux/can/rx-offload.h 2 * linux/can/rx-offload.h 4 * 3 * 5 * Copyright (c) 2014 David Jander, Protonic H 4 * Copyright (c) 2014 David Jander, Protonic Holland 6 * Copyright (c) 2014-2017, 2023 Pengutronix, !! 5 * Copyright (c) 2014-2017 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de> >> 6 * >> 7 * This program is free software; you can redistribute it and/or modify >> 8 * it under the terms of the version 2 of the GNU General Public License >> 9 * as published by the Free Software Foundation >> 10 * >> 11 * This program is distributed in the hope that it will be useful, >> 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of >> 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> 14 * GNU General Public License for more details. 7 */ 15 */ 8 16 9 #ifndef _CAN_RX_OFFLOAD_H 17 #ifndef _CAN_RX_OFFLOAD_H 10 #define _CAN_RX_OFFLOAD_H 18 #define _CAN_RX_OFFLOAD_H 11 19 12 #include <linux/netdevice.h> 20 #include <linux/netdevice.h> 13 #include <linux/can.h> 21 #include <linux/can.h> 14 22 15 struct can_rx_offload { 23 struct can_rx_offload { 16 struct net_device *dev; 24 struct net_device *dev; 17 25 18 struct sk_buff *(*mailbox_read)(struct !! 26 unsigned int (*mailbox_read)(struct can_rx_offload *offload, struct can_frame *cf, 19 unsign !! 27 u32 *timestamp, unsigned int mb); 20 bool d << 21 28 22 struct sk_buff_head skb_queue; 29 struct sk_buff_head skb_queue; 23 struct sk_buff_head skb_irq_queue; << 24 u32 skb_queue_len_max; 30 u32 skb_queue_len_max; 25 31 26 unsigned int mb_first; 32 unsigned int mb_first; 27 unsigned int mb_last; 33 unsigned int mb_last; 28 34 29 struct napi_struct napi; 35 struct napi_struct napi; 30 36 31 bool inc; 37 bool inc; 32 }; 38 }; 33 39 34 int can_rx_offload_add_timestamp(struct net_de !! 40 int can_rx_offload_add_timestamp(struct net_device *dev, struct can_rx_offload *offload); 35 struct can_rx !! 41 int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight); 36 int can_rx_offload_add_fifo(struct net_device !! 42 int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg); 37 struct can_rx_offl << 38 unsigned int weigh << 39 int can_rx_offload_add_manual(struct net_devic << 40 struct can_rx_of << 41 unsigned int wei << 42 int can_rx_offload_irq_offload_timestamp(struc << 43 u64 r << 44 int can_rx_offload_irq_offload_fifo(struct can 43 int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload); 45 int can_rx_offload_queue_timestamp(struct can_ !! 44 int can_rx_offload_irq_queue_err_skb(struct can_rx_offload *offload, struct sk_buff *skb); 46 struct sk_b !! 45 void can_rx_offload_reset(struct can_rx_offload *offload); 47 unsigned int can_rx_offload_get_echo_skb_queue << 48 << 49 << 50 int can_rx_offload_queue_tail(struct can_rx_of << 51 struct sk_buff * << 52 unsigned int can_rx_offload_get_echo_skb_queue << 53 << 54 << 55 void can_rx_offload_irq_finish(struct can_rx_o << 56 void can_rx_offload_threaded_irq_finish(struct << 57 void can_rx_offload_del(struct can_rx_offload 46 void can_rx_offload_del(struct can_rx_offload *offload); 58 void can_rx_offload_enable(struct can_rx_offlo 47 void can_rx_offload_enable(struct can_rx_offload *offload); >> 48 >> 49 static inline void can_rx_offload_schedule(struct can_rx_offload *offload) >> 50 { >> 51 napi_schedule(&offload->napi); >> 52 } 59 53 60 static inline void can_rx_offload_disable(stru 54 static inline void can_rx_offload_disable(struct can_rx_offload *offload) 61 { 55 { 62 napi_disable(&offload->napi); 56 napi_disable(&offload->napi); 63 } 57 } 64 58 65 #endif /* !_CAN_RX_OFFLOAD_H */ 59 #endif /* !_CAN_RX_OFFLOAD_H */ 66 60
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.