8#ifndef PEAK_CANFD_USER_H
9#define PEAK_CANFD_USER_H
11#include <linux/can/dev/peak_canfd.h>
14#define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC))
16struct peak_berr_counter {
22struct peak_canfd_priv {
23 struct rtcan_device *rdev;
26 struct peak_berr_counter bec;
32 int (*pre_cmd)(
struct peak_canfd_priv *priv);
33 int (*write_cmd)(
struct peak_canfd_priv *priv);
34 int (*post_cmd)(
struct peak_canfd_priv *priv);
36 int (*enable_tx_path)(
struct peak_canfd_priv *priv);
37 void *(*alloc_tx_msg)(
struct peak_canfd_priv *priv, u16 msg_size,
39 int (*write_tx_msg)(
struct peak_canfd_priv *priv,
40 struct pucan_tx_msg *msg);
43struct rtcan_device *alloc_peak_canfd_dev(
int sizeof_priv,
int index);
44void rtcan_peak_pciefd_remove_proc(
struct rtcan_device *rdev);
45int rtcan_peak_pciefd_create_proc(
struct rtcan_device *rdev);
47int peak_canfd_handle_msg(
struct peak_canfd_priv *priv,
48 struct pucan_rx_msg *msg);
49int peak_canfd_handle_msgs_list(
struct peak_canfd_priv *priv,
50 struct pucan_rx_msg *rx_msg,
int rx_count);