linux/drivers/net/can/usb/peak_usb/pcan_usb_core.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * CAN driver for PEAK System USB adapters
 * Derived from the PCAN project file driver/src/pcan_usb_core.c
 *
 * Copyright (C) 2003-2010 PEAK System-Technik GmbH
 * Copyright (C) 2010-2012 Stephane Grosjean <[email protected]>
 *
 * Many thanks to Klaus Hitschler <[email protected]>
 */
#ifndef PCAN_USB_CORE_H
#define PCAN_USB_CORE_H

/* PEAK-System vendor id. */
#define PCAN_USB_VENDOR_ID

/* supported device ids. */
#define PCAN_USB_PRODUCT_ID
#define PCAN_USBPRO_PRODUCT_ID
#define PCAN_USBPROFD_PRODUCT_ID
#define PCAN_USBFD_PRODUCT_ID
#define PCAN_USBCHIP_PRODUCT_ID
#define PCAN_USBX6_PRODUCT_ID

#define PCAN_USB_DRIVER_NAME

/* number of urbs that are submitted for rx/tx per channel */
#define PCAN_USB_MAX_RX_URBS
#define PCAN_USB_MAX_TX_URBS

/* usb adapters maximum channels per usb interface */
#define PCAN_USB_MAX_CHANNEL

/* maximum length of the usb commands sent to/received from the devices */
#define PCAN_USB_MAX_CMD_LEN

struct peak_usb_device;

/* PEAK-System USB adapter descriptor */
struct peak_usb_adapter {};

extern const struct peak_usb_adapter pcan_usb;
extern const struct peak_usb_adapter pcan_usb_pro;
extern const struct peak_usb_adapter pcan_usb_fd;
extern const struct peak_usb_adapter pcan_usb_chip;
extern const struct peak_usb_adapter pcan_usb_pro_fd;
extern const struct peak_usb_adapter pcan_usb_x6;

struct peak_time_ref {};

struct peak_tx_urb_context {};

#define PCAN_USB_STATE_CONNECTED
#define PCAN_USB_STATE_STARTED

/* PEAK-System USB device */
struct peak_usb_device {};

void pcan_dump_mem(const char *prompt, const void *p, int l);

/* common timestamp management */
void peak_usb_init_time_ref(struct peak_time_ref *time_ref,
			    const struct peak_usb_adapter *adapter);
void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_set_ts_now(struct peak_time_ref *time_ref, u32 ts_now);
void peak_usb_get_ts_time(struct peak_time_ref *time_ref, u32 ts, ktime_t *tv);
int peak_usb_netif_rx_64(struct sk_buff *skb, u32 ts_low, u32 ts_high);
void peak_usb_async_complete(struct urb *urb);
void peak_usb_restart_complete(struct peak_usb_device *dev);
int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info);

/* common 32-bit CAN channel ID ethtool management */
int peak_usb_get_eeprom_len(struct net_device *netdev);
int peak_usb_get_eeprom(struct net_device *netdev,
			struct ethtool_eeprom *eeprom, u8 *data);
int peak_usb_set_eeprom(struct net_device *netdev,
			struct ethtool_eeprom *eeprom, u8 *data);
#endif