#include <asm/unaligned.h>
#include <linux/ethtool.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>
#include "pcan_usb_core.h"
#define PCAN_USB_EP_CMDOUT …
#define PCAN_USB_EP_CMDIN …
#define PCAN_USB_EP_MSGOUT …
#define PCAN_USB_EP_MSGIN …
#define PCAN_USB_CMD_FUNC …
#define PCAN_USB_CMD_NUM …
#define PCAN_USB_CMD_ARGS …
#define PCAN_USB_CMD_ARGS_LEN …
#define PCAN_USB_CMD_LEN …
#define PCAN_USB_CMD_BITRATE …
#define PCAN_USB_CMD_SET_BUS …
#define PCAN_USB_CMD_DEVID …
#define PCAN_USB_CMD_SN …
#define PCAN_USB_CMD_REGISTER …
#define PCAN_USB_CMD_EXT_VCC …
#define PCAN_USB_CMD_ERR_FR …
#define PCAN_USB_CMD_LED …
#define PCAN_USB_BUS_XCVER …
#define PCAN_USB_BUS_SILENT_MODE …
#define PCAN_USB_GET …
#define PCAN_USB_SET …
#define PCAN_USB_COMMAND_TIMEOUT …
#define PCAN_USB_STARTUP_TIMEOUT …
#define PCAN_USB_RX_BUFFER_SIZE …
#define PCAN_USB_TX_BUFFER_SIZE …
#define PCAN_USB_MSG_HEADER_LEN …
#define PCAN_USB_MSG_TX_CAN …
#define PCAN_USB_CRYSTAL_HZ …
#define PCAN_USB_STATUSLEN_TIMESTAMP …
#define PCAN_USB_STATUSLEN_INTERNAL …
#define PCAN_USB_STATUSLEN_EXT_ID …
#define PCAN_USB_STATUSLEN_RTR …
#define PCAN_USB_STATUSLEN_DLC …
#define PCAN_USB_TX_SRR …
#define PCAN_USB_TX_AT …
#define PCAN_USB_ERROR_TXFULL …
#define PCAN_USB_ERROR_RXQOVR …
#define PCAN_USB_ERROR_BUS_LIGHT …
#define PCAN_USB_ERROR_BUS_HEAVY …
#define PCAN_USB_ERROR_BUS_OFF …
#define PCAN_USB_ERROR_RXQEMPTY …
#define PCAN_USB_ERROR_QOVR …
#define PCAN_USB_ERROR_TXQFULL …
#define PCAN_USB_ERROR_BUS …
#define SJA1000_MODE_NORMAL …
#define SJA1000_MODE_INIT …
#define PCAN_USB_TS_DIV_SHIFTER …
#define PCAN_USB_TS_US_PER_TICK …
#define PCAN_USB_REC_ERROR …
#define PCAN_USB_REC_ANALOG …
#define PCAN_USB_REC_BUSLOAD …
#define PCAN_USB_REC_TS …
#define PCAN_USB_REC_BUSEVT …
#define PCAN_USB_ERR_RXERR …
#define PCAN_USB_ERR_TXERR …
#define PCAN_USB_BERR_MASK …
#define PCAN_USB_ERR_CNT_DEC …
#define PCAN_USB_ERR_CNT_INC …
struct pcan_usb { … };
struct pcan_usb_msg_context { … };
static int pcan_usb_send_cmd(struct peak_usb_device *dev, u8 f, u8 n, u8 *p)
{ … }
static int pcan_usb_wait_rsp(struct peak_usb_device *dev, u8 f, u8 n, u8 *p)
{ … }
static int pcan_usb_set_sja1000(struct peak_usb_device *dev, u8 mode)
{ … }
static int pcan_usb_set_bus(struct peak_usb_device *dev, u8 onoff)
{ … }
static int pcan_usb_set_silent(struct peak_usb_device *dev, u8 onoff)
{ … }
static int pcan_usb_set_err_frame(struct peak_usb_device *dev, u8 err_mask)
{ … }
static int pcan_usb_set_ext_vcc(struct peak_usb_device *dev, u8 onoff)
{ … }
static int pcan_usb_set_led(struct peak_usb_device *dev, u8 onoff)
{ … }
static int pcan_usb_set_bittiming(struct peak_usb_device *dev,
struct can_bittiming *bt)
{ … }
static int pcan_usb_write_mode(struct peak_usb_device *dev, u8 onoff)
{ … }
static void pcan_usb_restart(struct timer_list *t)
{ … }
static void pcan_usb_restart_pending(struct urb *urb)
{ … }
static int pcan_usb_restart_async(struct peak_usb_device *dev, struct urb *urb,
u8 *buf)
{ … }
static int pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number)
{ … }
static int pcan_usb_get_can_channel_id(struct peak_usb_device *dev, u32 *can_ch_id)
{ … }
static int pcan_usb_set_can_channel_id(struct peak_usb_device *dev, u32 can_ch_id)
{ … }
static int pcan_usb_update_ts(struct pcan_usb_msg_context *mc)
{ … }
static int pcan_usb_decode_ts(struct pcan_usb_msg_context *mc, u8 first_packet)
{ … }
static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
u8 status_len)
{ … }
static int pcan_usb_handle_bus_evt(struct pcan_usb_msg_context *mc, u8 ir)
{ … }
static int pcan_usb_decode_status(struct pcan_usb_msg_context *mc,
u8 status_len)
{ … }
static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
{ … }
static int pcan_usb_decode_msg(struct peak_usb_device *dev, u8 *ibuf, u32 lbuf)
{ … }
static int pcan_usb_decode_buf(struct peak_usb_device *dev, struct urb *urb)
{ … }
static int pcan_usb_encode_msg(struct peak_usb_device *dev, struct sk_buff *skb,
u8 *obuf, size_t *size)
{ … }
static int pcan_usb_get_berr_counter(const struct net_device *netdev,
struct can_berr_counter *bec)
{ … }
static int pcan_usb_start(struct peak_usb_device *dev)
{ … }
static int pcan_usb_init(struct peak_usb_device *dev)
{ … }
static int pcan_usb_probe(struct usb_interface *intf)
{ … }
static int pcan_usb_set_phys_id(struct net_device *netdev,
enum ethtool_phys_id_state state)
{ … }
static int pcan_usb_get_eeprom_len(struct net_device *netdev)
{ … }
static const struct ethtool_ops pcan_usb_ethtool_ops = …;
static const struct can_bittiming_const pcan_usb_const = …;
const struct peak_usb_adapter pcan_usb = …;