linux/drivers/net/can/rcar/rcar_can.c

// SPDX-License-Identifier: GPL-2.0+
/* Renesas R-Car CAN device driver
 *
 * Copyright (C) 2013 Cogent Embedded, Inc. <[email protected]>
 * Copyright (C) 2013 Renesas Solutions Corp.
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/can/dev.h>
#include <linux/clk.h>
#include <linux/of.h>

#define RCAR_CAN_DRV_NAME

/* Clock Select Register settings */
enum CLKR {};

#define RCAR_SUPPORTED_CLOCKS

/* Mailbox configuration:
 * mailbox 60 - 63 - Rx FIFO mailboxes
 * mailbox 56 - 59 - Tx FIFO mailboxes
 * non-FIFO mailboxes are not used
 */
#define RCAR_CAN_N_MBX
#define RCAR_CAN_RX_FIFO_MBX
#define RCAR_CAN_TX_FIFO_MBX
#define RCAR_CAN_FIFO_DEPTH

/* Mailbox registers structure */
struct rcar_can_mbox_regs {};

struct rcar_can_regs {};

struct rcar_can_priv {};

static const struct can_bittiming_const rcar_can_bittiming_const =;

/* Control Register bits */
#define RCAR_CAN_CTLR_BOM
#define RCAR_CAN_CTLR_BOM_ENT
					/* at bus-off entry */
#define RCAR_CAN_CTLR_SLPM
#define RCAR_CAN_CTLR_CANM
#define RCAR_CAN_CTLR_CANM_HALT
#define RCAR_CAN_CTLR_CANM_RESET
#define RCAR_CAN_CTLR_CANM_FORCE_RESET
#define RCAR_CAN_CTLR_MLM
#define RCAR_CAN_CTLR_IDFM
#define RCAR_CAN_CTLR_IDFM_MIXED
#define RCAR_CAN_CTLR_MBM

/* Status Register bits */
#define RCAR_CAN_STR_RSTST

/* FIFO Received ID Compare Registers 0 and 1 bits */
#define RCAR_CAN_FIDCR_IDE
#define RCAR_CAN_FIDCR_RTR

/* Receive FIFO Control Register bits */
#define RCAR_CAN_RFCR_RFEST
#define RCAR_CAN_RFCR_RFE

/* Transmit FIFO Control Register bits */
#define RCAR_CAN_TFCR_TFUST
					/* Number Status Bits */
#define RCAR_CAN_TFCR_TFUST_SHIFT
					/* Message Number Status Bits */
#define RCAR_CAN_TFCR_TFE

#define RCAR_CAN_N_RX_MKREGS1
					/* for Rx mailboxes 0-31 */
#define RCAR_CAN_N_RX_MKREGS2

/* Bit Configuration Register settings */
#define RCAR_CAN_BCR_TSEG1(x)
#define RCAR_CAN_BCR_BPR(x)
#define RCAR_CAN_BCR_SJW(x)
#define RCAR_CAN_BCR_TSEG2(x)

/* Mailbox and Mask Registers bits */
#define RCAR_CAN_IDE
#define RCAR_CAN_RTR
#define RCAR_CAN_SID_SHIFT

/* Mailbox Interrupt Enable Register 1 bits */
#define RCAR_CAN_MIER1_RXFIE
#define RCAR_CAN_MIER1_TXFIE

/* Interrupt Enable Register bits */
#define RCAR_CAN_IER_ERSIE
#define RCAR_CAN_IER_RXFIE
					/* Enable Bit */
#define RCAR_CAN_IER_TXFIE
					/* Enable Bit */
/* Interrupt Status Register bits */
#define RCAR_CAN_ISR_ERSF
#define RCAR_CAN_ISR_RXFF
					/* Status Bit */
#define RCAR_CAN_ISR_TXFF
					/* Status Bit */

/* Error Interrupt Enable Register bits */
#define RCAR_CAN_EIER_BLIE
#define RCAR_CAN_EIER_OLIE
					/* Interrupt Enable */
#define RCAR_CAN_EIER_ORIE
#define RCAR_CAN_EIER_BORIE
#define RCAR_CAN_EIER_BOEIE
#define RCAR_CAN_EIER_EPIE
#define RCAR_CAN_EIER_EWIE
#define RCAR_CAN_EIER_BEIE

/* Error Interrupt Factor Judge Register bits */
#define RCAR_CAN_EIFR_BLIF
#define RCAR_CAN_EIFR_OLIF
					 /* Detect Flag */
#define RCAR_CAN_EIFR_ORIF
#define RCAR_CAN_EIFR_BORIF
#define RCAR_CAN_EIFR_BOEIF
#define RCAR_CAN_EIFR_EPIF
#define RCAR_CAN_EIFR_EWIF
#define RCAR_CAN_EIFR_BEIF

/* Error Code Store Register bits */
#define RCAR_CAN_ECSR_EDPM
#define RCAR_CAN_ECSR_ADEF
#define RCAR_CAN_ECSR_BE0F
#define RCAR_CAN_ECSR_BE1F
#define RCAR_CAN_ECSR_CEF
#define RCAR_CAN_ECSR_AEF
#define RCAR_CAN_ECSR_FEF
#define RCAR_CAN_ECSR_SEF

#define RCAR_CAN_NAPI_WEIGHT
#define MAX_STR_READS

static void tx_failure_cleanup(struct net_device *ndev)
{}

static void rcar_can_error(struct net_device *ndev)
{}

static void rcar_can_tx_done(struct net_device *ndev)
{}

static irqreturn_t rcar_can_interrupt(int irq, void *dev_id)
{}

static void rcar_can_set_bittiming(struct net_device *dev)
{}

static void rcar_can_start(struct net_device *ndev)
{}

static int rcar_can_open(struct net_device *ndev)
{}

static void rcar_can_stop(struct net_device *ndev)
{}

static int rcar_can_close(struct net_device *ndev)
{}

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

static const struct net_device_ops rcar_can_netdev_ops =;

static const struct ethtool_ops rcar_can_ethtool_ops =;

static void rcar_can_rx_pkt(struct rcar_can_priv *priv)
{}

static int rcar_can_rx_poll(struct napi_struct *napi, int quota)
{}

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

static int rcar_can_get_berr_counter(const struct net_device *dev,
				     struct can_berr_counter *bec)
{}

static const char * const clock_names[] =;

static int rcar_can_probe(struct platform_device *pdev)
{}

static void rcar_can_remove(struct platform_device *pdev)
{}

static int __maybe_unused rcar_can_suspend(struct device *dev)
{}

static int __maybe_unused rcar_can_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(rcar_can_pm_ops, rcar_can_suspend, rcar_can_resume);

static const struct of_device_id rcar_can_of_table[] __maybe_unused =;
MODULE_DEVICE_TABLE(of, rcar_can_of_table);

static struct platform_driver rcar_can_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_ALIAS();