#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>
#define MAX_RX_URBS …
#define MAX_TX_URBS …
#define RX_BUFFER_SIZE …
#define USB_8DEV_VENDOR_ID …
#define USB_8DEV_PRODUCT_ID …
enum usb_8dev_endpoint { … };
#define USB_8DEV_ABP_CLOCK …
#define USB_8DEV_SILENT …
#define USB_8DEV_LOOPBACK …
#define USB_8DEV_DISABLE_AUTO_RESTRANS …
#define USB_8DEV_STATUS_FRAME …
enum usb_8dev_cmd { … };
#define USB_8DEV_BAUD_MANUAL …
#define USB_8DEV_CMD_START …
#define USB_8DEV_CMD_END …
#define USB_8DEV_CMD_SUCCESS …
#define USB_8DEV_CMD_ERROR …
#define USB_8DEV_CMD_TIMEOUT …
#define USB_8DEV_DATA_START …
#define USB_8DEV_DATA_END …
#define USB_8DEV_TYPE_CAN_FRAME …
#define USB_8DEV_TYPE_ERROR_FRAME …
#define USB_8DEV_EXTID …
#define USB_8DEV_RTR …
#define USB_8DEV_ERR_FLAG …
#define USB_8DEV_STATUSMSG_OK …
#define USB_8DEV_STATUSMSG_OVERRUN …
#define USB_8DEV_STATUSMSG_BUSLIGHT …
#define USB_8DEV_STATUSMSG_BUSHEAVY …
#define USB_8DEV_STATUSMSG_BUSOFF …
#define USB_8DEV_STATUSMSG_STUFF …
#define USB_8DEV_STATUSMSG_FORM …
#define USB_8DEV_STATUSMSG_ACK …
#define USB_8DEV_STATUSMSG_BIT0 …
#define USB_8DEV_STATUSMSG_BIT1 …
#define USB_8DEV_STATUSMSG_CRC …
#define USB_8DEV_RP_MASK …
static const struct usb_device_id usb_8dev_table[] = …;
MODULE_DEVICE_TABLE(usb, usb_8dev_table);
struct usb_8dev_tx_urb_context { … };
struct usb_8dev_priv { … };
struct __packed usb_8dev_tx_msg { … };
struct __packed usb_8dev_rx_msg { … };
struct __packed usb_8dev_cmd_msg { … };
static int usb_8dev_send_cmd_msg(struct usb_8dev_priv *priv, u8 *msg, int size)
{ … }
static int usb_8dev_wait_cmd_msg(struct usb_8dev_priv *priv, u8 *msg, int size,
int *actual_length)
{ … }
static int usb_8dev_send_cmd(struct usb_8dev_priv *priv,
struct usb_8dev_cmd_msg *out,
struct usb_8dev_cmd_msg *in)
{ … }
static int usb_8dev_cmd_open(struct usb_8dev_priv *priv)
{ … }
static int usb_8dev_cmd_close(struct usb_8dev_priv *priv)
{ … }
static int usb_8dev_cmd_version(struct usb_8dev_priv *priv, u32 *res)
{ … }
static int usb_8dev_set_mode(struct net_device *netdev, enum can_mode mode)
{ … }
static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv,
struct usb_8dev_rx_msg *msg)
{ … }
static void usb_8dev_rx_can_msg(struct usb_8dev_priv *priv,
struct usb_8dev_rx_msg *msg)
{ … }
static void usb_8dev_read_bulk_callback(struct urb *urb)
{ … }
static void usb_8dev_write_bulk_callback(struct urb *urb)
{ … }
static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
static int usb_8dev_get_berr_counter(const struct net_device *netdev,
struct can_berr_counter *bec)
{ … }
static int usb_8dev_start(struct usb_8dev_priv *priv)
{ … }
static int usb_8dev_open(struct net_device *netdev)
{ … }
static void unlink_all_urbs(struct usb_8dev_priv *priv)
{ … }
static int usb_8dev_close(struct net_device *netdev)
{ … }
static const struct net_device_ops usb_8dev_netdev_ops = …;
static const struct ethtool_ops usb_8dev_ethtool_ops = …;
static const struct can_bittiming_const usb_8dev_bittiming_const = …;
static int usb_8dev_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static void usb_8dev_disconnect(struct usb_interface *intf)
{ … }
static struct usb_driver usb_8dev_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;