#include <linux/ethtool.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/usb.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define CONTR_CAN_MESSAGE …
#define CONTR_CAN_STATE …
#define CONTR_BUS_ERROR …
#define CONTR_CONT_OFF …
#define CONTR_CONT_ON …
#define CONTR_ONCE …
#define CPC_MSG_TYPE_CAN_FRAME …
#define CPC_MSG_TYPE_RTR_FRAME …
#define CPC_MSG_TYPE_CAN_PARAMS …
#define CPC_MSG_TYPE_CAN_STATE …
#define CPC_MSG_TYPE_EXT_CAN_FRAME …
#define CPC_MSG_TYPE_EXT_RTR_FRAME …
#define CPC_MSG_TYPE_CONTROL …
#define CPC_MSG_TYPE_CONFIRM …
#define CPC_MSG_TYPE_OVERRUN …
#define CPC_MSG_TYPE_CAN_FRAME_ERROR …
#define CPC_MSG_TYPE_ERR_COUNTER …
#define CPC_CMD_TYPE_CAN_FRAME …
#define CPC_CMD_TYPE_CONTROL …
#define CPC_CMD_TYPE_CAN_PARAMS …
#define CPC_CMD_TYPE_RTR_FRAME …
#define CPC_CMD_TYPE_CAN_STATE …
#define CPC_CMD_TYPE_EXT_CAN_FRAME …
#define CPC_CMD_TYPE_EXT_RTR_FRAME …
#define CPC_CMD_TYPE_CAN_EXIT …
#define CPC_CMD_TYPE_INQ_ERR_COUNTER …
#define CPC_CMD_TYPE_CLEAR_MSG_QUEUE …
#define CPC_CMD_TYPE_CLEAR_CMD_QUEUE …
#define CPC_CC_TYPE_SJA1000 …
#define CPC_CAN_ECODE_ERRFRAME …
#define CPC_OVR_EVENT_CAN …
#define CPC_OVR_EVENT_CANSTATE …
#define CPC_OVR_EVENT_BUSERROR …
#define CPC_OVR_HW …
#define CPC_MSG_HEADER_LEN …
#define CPC_CAN_MSG_MIN_SIZE …
#define USB_CPCUSB_VENDOR_ID …
#define USB_CPCUSB_ARM7_PRODUCT_ID …
#define SJA1000_MOD_NORMAL …
#define SJA1000_MOD_RM …
#define SJA1000_ECC_SEG …
#define SJA1000_ECC_DIR …
#define SJA1000_ECC_ERR …
#define SJA1000_ECC_BIT …
#define SJA1000_ECC_FORM …
#define SJA1000_ECC_STUFF …
#define SJA1000_ECC_MASK …
#define SJA1000_SR_BS …
#define SJA1000_SR_ES …
#define SJA1000_DEFAULT_OUTPUT_CONTROL …
#define EMS_USB_ARM7_CLOCK …
#define CPC_TX_QUEUE_TRIGGER_LOW …
#define CPC_TX_QUEUE_TRIGGER_HIGH …
struct cpc_can_msg { … };
struct cpc_sja1000_params { … };
struct cpc_can_params { … };
struct cpc_confirm { … };
struct cpc_overrun { … };
struct cpc_sja1000_can_error { … };
struct cpc_can_error { … };
struct cpc_can_err_counter { … };
struct __packed ems_cpc_msg { … };
static struct usb_device_id ems_usb_table[] = …;
MODULE_DEVICE_TABLE(usb, ems_usb_table);
#define RX_BUFFER_SIZE …
#define CPC_HEADER_SIZE …
#define INTR_IN_BUFFER_SIZE …
#define MAX_RX_URBS …
#define MAX_TX_URBS …
struct ems_usb;
struct ems_tx_urb_context { … };
struct ems_usb { … };
static void ems_usb_read_interrupt_callback(struct urb *urb)
{ … }
static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
{ … }
static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
{ … }
static void ems_usb_read_bulk_callback(struct urb *urb)
{ … }
static void ems_usb_write_bulk_callback(struct urb *urb)
{ … }
static int ems_usb_command_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
{ … }
static int ems_usb_write_mode(struct ems_usb *dev, u8 mode)
{ … }
static int ems_usb_control_cmd(struct ems_usb *dev, u8 val)
{ … }
static int ems_usb_start(struct ems_usb *dev)
{ … }
static void unlink_all_urbs(struct ems_usb *dev)
{ … }
static int ems_usb_open(struct net_device *netdev)
{ … }
static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev)
{ … }
static int ems_usb_close(struct net_device *netdev)
{ … }
static const struct net_device_ops ems_usb_netdev_ops = …;
static const struct ethtool_ops ems_usb_ethtool_ops = …;
static const struct can_bittiming_const ems_usb_bittiming_const = …;
static int ems_usb_set_mode(struct net_device *netdev, enum can_mode mode)
{ … }
static int ems_usb_set_bittiming(struct net_device *netdev)
{ … }
static void init_params_sja1000(struct ems_cpc_msg *msg)
{ … }
static int ems_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static void ems_usb_disconnect(struct usb_interface *intf)
{ … }
static struct usb_driver ems_usb_driver = …;
module_usb_driver(…) …;