linux/drivers/net/can/dev/dev.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2005 Marc Kleine-Budde, Pengutronix
 * Copyright (C) 2006 Andrey Volkov, Varma Electronics
 * Copyright (C) 2008-2009 Wolfgang Grandegger <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/workqueue.h>
#include <linux/can.h>
#include <linux/can/can-ml.h>
#include <linux/can/dev.h>
#include <linux/can/skb.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>

static void can_update_state_error_stats(struct net_device *dev,
					 enum can_state new_state)
{}

static int can_tx_state_to_frame(struct net_device *dev, enum can_state state)
{}

static int can_rx_state_to_frame(struct net_device *dev, enum can_state state)
{}

const char *can_get_state_str(const enum can_state state)
{}
EXPORT_SYMBOL_GPL();

static enum can_state can_state_err_to_state(u16 err)
{}

void can_state_get_by_berr_counter(const struct net_device *dev,
				   const struct can_berr_counter *bec,
				   enum can_state *tx_state,
				   enum can_state *rx_state)
{}
EXPORT_SYMBOL_GPL();

void can_change_state(struct net_device *dev, struct can_frame *cf,
		      enum can_state tx_state, enum can_state rx_state)
{}
EXPORT_SYMBOL_GPL();

/* CAN device restart for bus-off recovery */
static void can_restart(struct net_device *dev)
{}

static void can_restart_work(struct work_struct *work)
{}

int can_restart_now(struct net_device *dev)
{}

/* CAN bus-off
 *
 * This functions should be called when the device goes bus-off to
 * tell the netif layer that no more packets can be sent or received.
 * If enabled, a timer is started to trigger bus-off recovery.
 */
void can_bus_off(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

void can_setup(struct net_device *dev)
{}

/* Allocate and setup space for the CAN network device */
struct net_device *alloc_candev_mqs(int sizeof_priv, unsigned int echo_skb_max,
				    unsigned int txqs, unsigned int rxqs)
{}
EXPORT_SYMBOL_GPL();

/* Free space of the CAN network device */
void free_candev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

/* changing MTU and control mode for CAN/CANFD devices */
int can_change_mtu(struct net_device *dev, int new_mtu)
{}
EXPORT_SYMBOL_GPL();

/* generic implementation of netdev_ops::ndo_eth_ioctl for CAN devices
 * supporting hardware timestamps
 */
int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd)
{}
EXPORT_SYMBOL();

/* generic implementation of ethtool_ops::get_ts_info for CAN devices
 * supporting hardware timestamps
 */
int can_ethtool_op_get_ts_info_hwts(struct net_device *dev,
				    struct kernel_ethtool_ts_info *info)
{}
EXPORT_SYMBOL();

/* Common open function when the device gets opened.
 *
 * This function should be called in the open function of the device
 * driver.
 */
int open_candev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_OF
/* Common function that can be used to understand the limitation of
 * a transceiver when it provides no means to determine these limitations
 * at runtime.
 */
void of_can_transceiver(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();
#endif

/* Common close function for cleanup before the device gets closed.
 *
 * This function should be called in the close function of the device
 * driver.
 */
void close_candev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

static int can_set_termination(struct net_device *ndev, u16 term)
{}

static int can_get_termination(struct net_device *ndev)
{}

static bool
can_bittiming_const_valid(const struct can_bittiming_const *btc)
{}

/* Register the CAN network device */
int register_candev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

/* Unregister the CAN network device */
void unregister_candev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

/* Test if a network device is a candev based device
 * and return the can_priv* if so.
 */
struct can_priv *safe_candev_priv(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

static __init int can_dev_init(void)
{}
module_init();

static __exit void can_dev_exit(void)
{}
module_exit(can_dev_exit);

MODULE_ALIAS_RTNL_LINK();