#include <linux/unaligned.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/ethtool.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/usb.h>
#define MCBA_MODULE_NAME …
#define MCBA_VENDOR_ID …
#define MCBA_PRODUCT_ID …
#define MCBA_MAX_RX_URBS …
#define MCBA_MAX_TX_URBS …
#define MCBA_CTX_FREE …
#define MCBA_USB_RX_BUFF_SIZE …
#define MCBA_USB_TX_BUFF_SIZE …
#define MBCA_CMD_RECEIVE_MESSAGE …
#define MBCA_CMD_I_AM_ALIVE_FROM_CAN …
#define MBCA_CMD_I_AM_ALIVE_FROM_USB …
#define MBCA_CMD_CHANGE_BIT_RATE …
#define MBCA_CMD_TRANSMIT_MESSAGE_EV …
#define MBCA_CMD_SETUP_TERMINATION_RESISTANCE …
#define MBCA_CMD_READ_FW_VERSION …
#define MBCA_CMD_NOTHING_TO_SEND …
#define MBCA_CMD_TRANSMIT_MESSAGE_RSP …
#define MCBA_VER_REQ_USB …
#define MCBA_VER_REQ_CAN …
#define MCBA_VER_TERMINATION_ON …
#define MCBA_VER_TERMINATION_OFF …
#define MCBA_SIDL_EXID_MASK …
#define MCBA_DLC_MASK …
#define MCBA_DLC_RTR_MASK …
#define MCBA_CAN_STATE_WRN_TH …
#define MCBA_CAN_STATE_ERR_PSV_TH …
#define MCBA_TERMINATION_DISABLED …
#define MCBA_TERMINATION_ENABLED …
struct mcba_usb_ctx { … };
struct mcba_priv { … };
struct __packed mcba_usb_msg_can { … };
struct __packed mcba_usb_msg { … };
struct __packed mcba_usb_msg_ka_usb { … };
struct __packed mcba_usb_msg_ka_can { … };
struct __packed mcba_usb_msg_change_bitrate { … };
struct __packed mcba_usb_msg_termination { … };
struct __packed mcba_usb_msg_fw_ver { … };
static const struct usb_device_id mcba_usb_table[] = …;
MODULE_DEVICE_TABLE(usb, mcba_usb_table);
static const u16 mcba_termination[] = …;
static const u32 mcba_bitrate[] = …;
static inline void mcba_init_ctx(struct mcba_priv *priv)
{ … }
static inline struct mcba_usb_ctx *mcba_usb_get_free_ctx(struct mcba_priv *priv,
struct can_frame *cf)
{ … }
static inline void mcba_usb_free_ctx(struct mcba_usb_ctx *ctx)
{ … }
static void mcba_usb_write_bulk_callback(struct urb *urb)
{ … }
static netdev_tx_t mcba_usb_xmit(struct mcba_priv *priv,
struct mcba_usb_msg *usb_msg,
struct mcba_usb_ctx *ctx)
{ … }
static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
static void mcba_usb_xmit_cmd(struct mcba_priv *priv,
struct mcba_usb_msg *usb_msg)
{ … }
static void mcba_usb_xmit_change_bitrate(struct mcba_priv *priv, u16 bitrate)
{ … }
static void mcba_usb_xmit_read_fw_ver(struct mcba_priv *priv, u8 pic)
{ … }
static void mcba_usb_process_can(struct mcba_priv *priv,
struct mcba_usb_msg_can *msg)
{ … }
static void mcba_usb_process_ka_usb(struct mcba_priv *priv,
struct mcba_usb_msg_ka_usb *msg)
{ … }
static u32 convert_can2host_bitrate(struct mcba_usb_msg_ka_can *msg)
{ … }
static void mcba_usb_process_ka_can(struct mcba_priv *priv,
struct mcba_usb_msg_ka_can *msg)
{ … }
static void mcba_usb_process_rx(struct mcba_priv *priv,
struct mcba_usb_msg *msg)
{ … }
static void mcba_usb_read_bulk_callback(struct urb *urb)
{ … }
static int mcba_usb_start(struct mcba_priv *priv)
{ … }
static int mcba_usb_open(struct net_device *netdev)
{ … }
static void mcba_urb_unlink(struct mcba_priv *priv)
{ … }
static int mcba_usb_close(struct net_device *netdev)
{ … }
static int mcba_net_set_mode(struct net_device *netdev, enum can_mode mode)
{ … }
static int mcba_net_get_berr_counter(const struct net_device *netdev,
struct can_berr_counter *bec)
{ … }
static const struct net_device_ops mcba_netdev_ops = …;
static const struct ethtool_ops mcba_ethtool_ops = …;
static int mcba_net_set_bittiming(struct net_device *netdev)
{ … }
static int mcba_set_termination(struct net_device *netdev, u16 term)
{ … }
static int mcba_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static void mcba_usb_disconnect(struct usb_interface *intf)
{ … }
static struct usb_driver mcba_usb_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;