linux/drivers/net/can/cc770/cc770.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Core driver for the CC770 and AN82527 CAN controllers
 *
 * Copyright (C) 2009, 2011 Wolfgang Grandegger <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#include <linux/skbuff.h>
#include <linux/delay.h>

#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/can/platform/cc770.h>

#include "cc770.h"

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

/*
 * The CC770 is a CAN controller from Bosch, which is 100% compatible
 * with the AN82527 from Intel, but with "bugs" being fixed and some
 * additional functionality, mainly:
 *
 * 1. RX and TX error counters are readable.
 * 2. Support of silent (listen-only) mode.
 * 3. Message object 15 can receive all types of frames, also RTR and EFF.
 *
 * Details are available from Bosch's "CC770_Product_Info_2007-01.pdf",
 * which explains in detail the compatibility between the CC770 and the
 * 82527. This driver use the additional functionality 3. on real CC770
 * devices. Unfortunately, the CC770 does still not store the message
 * identifier of received remote transmission request frames and
 * therefore it's set to 0.
 *
 * The message objects 1..14 can be used for TX and RX while the message
 * objects 15 is optimized for RX. It has a shadow register for reliable
 * data reception under heavy bus load. Therefore it makes sense to use
 * this message object for the needed use case. The frame type (EFF/SFF)
 * for the message object 15 can be defined via kernel module parameter
 * "msgobj15_eff". If not equal 0, it will receive 29-bit EFF frames,
 * otherwise 11 bit SFF messages.
 */
static int msgobj15_eff;
module_param(msgobj15_eff, int, 0444);
MODULE_PARM_DESC();

static int i82527_compat;
module_param(i82527_compat, int, 0444);
MODULE_PARM_DESC();

/*
 * This driver uses the last 5 message objects 11..15. The definitions
 * and structure below allows to configure and assign them to the real
 * message object.
 */
static unsigned char cc770_obj_flags[CC770_OBJ_MAX] =;

static const struct can_bittiming_const cc770_bittiming_const =;

static inline int intid2obj(unsigned int intid)
{}

static void enable_all_objs(const struct net_device *dev)
{}

static void disable_all_objs(const struct cc770_priv *priv)
{}

static void set_reset_mode(struct net_device *dev)
{}

static void set_normal_mode(struct net_device *dev)
{}

static void chipset_init(struct cc770_priv *priv)
{}

static int cc770_probe_chip(struct net_device *dev)
{}

static void cc770_start(struct net_device *dev)
{}

static int cc770_set_mode(struct net_device *dev, enum can_mode mode)
{}

static int cc770_set_bittiming(struct net_device *dev)
{}

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

static void cc770_tx(struct net_device *dev, int mo)
{}

static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev)
{}

static void cc770_rx(struct net_device *dev, unsigned int mo, u8 ctrl1)
{}

static int cc770_err(struct net_device *dev, u8 status)
{}

static int cc770_status_interrupt(struct net_device *dev)
{}

static void cc770_rx_interrupt(struct net_device *dev, unsigned int o)
{}

static void cc770_rtr_interrupt(struct net_device *dev, unsigned int o)
{}

static void cc770_tx_interrupt(struct net_device *dev, unsigned int o)
{}

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

static int cc770_open(struct net_device *dev)
{}

static int cc770_close(struct net_device *dev)
{}

struct net_device *alloc_cc770dev(int sizeof_priv)
{}
EXPORT_SYMBOL_GPL();

void free_cc770dev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

static const struct net_device_ops cc770_netdev_ops =;

static const struct ethtool_ops cc770_ethtool_ops =;

int register_cc770dev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

void unregister_cc770dev(struct net_device *dev)
{}
EXPORT_SYMBOL_GPL();

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

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