linux/drivers/net/can/peak_canfd/peak_canfd.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2007, 2011 Wolfgang Grandegger <[email protected]>
 * Copyright (C) 2012 Stephane Grosjean <[email protected]>
 *
 * Copyright (C) 2016  PEAK System-Technik GmbH
 */

#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/ethtool.h>

#include "peak_canfd_user.h"

/* internal IP core cache size (used as default echo skbs max number) */
#define PCANFD_ECHO_SKB_MAX

/* bittiming ranges of the PEAK-System PC CAN-FD interfaces */
static const struct can_bittiming_const peak_canfd_nominal_const =;

static const struct can_bittiming_const peak_canfd_data_const =;

static struct peak_canfd_priv *pucan_init_cmd(struct peak_canfd_priv *priv)
{}

static void *pucan_add_cmd(struct peak_canfd_priv *priv, int cmd_op)
{}

static int pucan_write_cmd(struct peak_canfd_priv *priv)
{}

/* uCAN commands interface functions */
static int pucan_set_reset_mode(struct peak_canfd_priv *priv)
{}

static int pucan_set_normal_mode(struct peak_canfd_priv *priv)
{}

static int pucan_set_listen_only_mode(struct peak_canfd_priv *priv)
{}

static int pucan_set_timing_slow(struct peak_canfd_priv *priv,
				 const struct can_bittiming *pbt)
{}

static int pucan_set_timing_fast(struct peak_canfd_priv *priv,
				 const struct can_bittiming *pbt)
{}

static int pucan_set_std_filter(struct peak_canfd_priv *priv, u8 row, u32 mask)
{}

static int pucan_tx_abort(struct peak_canfd_priv *priv, u16 flags)
{}

static int pucan_clr_err_counters(struct peak_canfd_priv *priv)
{}

static int pucan_set_options(struct peak_canfd_priv *priv, u16 opt_mask)
{}

static int pucan_clr_options(struct peak_canfd_priv *priv, u16 opt_mask)
{}

static int pucan_setup_rx_barrier(struct peak_canfd_priv *priv)
{}

static int pucan_netif_rx(struct sk_buff *skb, __le32 ts_low, __le32 ts_high)
{}

/* handle the reception of one CAN frame */
static int pucan_handle_can_rx(struct peak_canfd_priv *priv,
			       struct pucan_rx_msg *msg)
{}

/* handle rx/tx error counters notification */
static int pucan_handle_error(struct peak_canfd_priv *priv,
			      struct pucan_error_msg *msg)
{}

/* handle status notification */
static int pucan_handle_status(struct peak_canfd_priv *priv,
			       struct pucan_status_msg *msg)
{}

/* handle uCAN Rx overflow notification */
static int pucan_handle_cache_critical(struct peak_canfd_priv *priv)
{}

/* handle a single uCAN message */
int peak_canfd_handle_msg(struct peak_canfd_priv *priv,
			  struct pucan_rx_msg *msg)
{}

/* handle a list of rx_count messages from rx_msg memory address */
int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv,
				struct pucan_rx_msg *msg_list, int msg_count)
{}

static int peak_canfd_start(struct peak_canfd_priv *priv)
{}

static void peak_canfd_stop(struct peak_canfd_priv *priv)
{}

static int peak_canfd_set_mode(struct net_device *ndev, enum can_mode mode)
{}

static int peak_canfd_get_berr_counter(const struct net_device *ndev,
				       struct can_berr_counter *bec)
{}

static int peak_canfd_open(struct net_device *ndev)
{}

static int peak_canfd_set_bittiming(struct net_device *ndev)
{}

static int peak_canfd_set_data_bittiming(struct net_device *ndev)
{}

static int peak_canfd_close(struct net_device *ndev)
{}

static netdev_tx_t peak_canfd_start_xmit(struct sk_buff *skb,
					 struct net_device *ndev)
{}

static int peak_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
{}

static const struct net_device_ops peak_canfd_netdev_ops =;

static int peak_get_ts_info(struct net_device *dev,
			    struct kernel_ethtool_ts_info *info)
{}

static const struct ethtool_ops peak_canfd_ethtool_ops =;

struct net_device *alloc_peak_canfd_dev(int sizeof_priv, int index,
					int echo_skb_max)
{}