/* SPDX-License-Identifier: GPL-2.0 */ /* Parts of this driver are based on the following: * - Kvaser linux leaf driver (version 4.78) * - CAN driver for esd CAN-USB/2 * - Kvaser linux usbcanII driver (version 5.3) * - Kvaser linux mhydra driver (version 5.24) * * Copyright (C) 2002-2018 KVASER AB, Sweden. All rights reserved. * Copyright (C) 2010 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh * Copyright (C) 2012 Olivier Sobrie <olivier@sobrie.be> * Copyright (C) 2015 Valeo S.A.
*/
#ifndef KVASER_USB_H #define KVASER_USB_H
/* Kvaser USB CAN dongles are divided into three major platforms: * - Hydra: Running firmware labeled as 'mhydra' * - Leaf: Based on Renesas M32C or Freescale i.MX28, running firmware labeled * as 'filo' * - UsbcanII: Based on Renesas M16C, running firmware labeled as 'helios'
*/
u32 ean[2];
u32 serial_number; struct kvaser_usb_fw_version fw_version;
u8 hw_revision; unsignedint nchannels; /* @max_tx_urbs: Firmware-reported maximum number of outstanding, * not yet ACKed, transmissions on this device. This value is * also used as a sentinel for marking free tx contexts.
*/ unsignedint max_tx_urbs; struct kvaser_usb_dev_card_data card_data;
spinlock_t tx_contexts_lock; /* lock for active_tx_contexts */ int active_tx_contexts; struct kvaser_usb_tx_urb_context tx_contexts[];
};
/** * struct kvaser_usb_dev_ops - Device specific functions * @dev_set_mode: used for can.do_set_mode * @dev_set_bittiming: used for can.do_set_bittiming * @dev_get_busparams: readback arbitration busparams * @dev_set_data_bittiming: used for can.fd.do_set_data_bittiming * @dev_get_data_busparams: readback data busparams * @dev_get_berr_counter: used for can.do_get_berr_counter * * @dev_setup_endpoints: setup USB in and out endpoints * @dev_init_card: initialize card * @dev_init_channel: initialize channel * @dev_remove_channel: uninitialize channel * @dev_get_software_info: get software info * @dev_get_software_details: get software details * @dev_get_card_info: get card info * @dev_get_capabilities: discover device capabilities * @dev_set_led: turn on/off device LED * * @dev_set_opt_mode: set ctrlmod * @dev_start_chip: start the CAN controller * @dev_stop_chip: stop the CAN controller * @dev_reset_chip: reset the CAN controller * @dev_flush_queue: flush outstanding CAN messages * @dev_read_bulk_callback: handle incoming commands * @dev_frame_to_cmd: translate struct can_frame into device command
*/ struct kvaser_usb_dev_ops { int (*dev_set_mode)(struct net_device *netdev, enum can_mode mode); int (*dev_set_bittiming)(conststruct net_device *netdev, conststruct kvaser_usb_busparams *busparams); int (*dev_get_busparams)(struct kvaser_usb_net_priv *priv); int (*dev_set_data_bittiming)(conststruct net_device *netdev, conststruct kvaser_usb_busparams *busparams); int (*dev_get_data_busparams)(struct kvaser_usb_net_priv *priv); int (*dev_get_berr_counter)(conststruct net_device *netdev, struct can_berr_counter *bec); int (*dev_setup_endpoints)(struct kvaser_usb *dev); int (*dev_init_card)(struct kvaser_usb *dev); int (*dev_init_channel)(struct kvaser_usb_net_priv *priv); void (*dev_remove_channel)(struct kvaser_usb_net_priv *priv); int (*dev_get_software_info)(struct kvaser_usb *dev); int (*dev_get_software_details)(struct kvaser_usb *dev); int (*dev_get_card_info)(struct kvaser_usb *dev); int (*dev_get_capabilities)(struct kvaser_usb *dev); int (*dev_set_led)(struct kvaser_usb_net_priv *priv, enum kvaser_usb_led_state state,
u16 duration_ms); int (*dev_set_opt_mode)(conststruct kvaser_usb_net_priv *priv); int (*dev_start_chip)(struct kvaser_usb_net_priv *priv); int (*dev_stop_chip)(struct kvaser_usb_net_priv *priv); int (*dev_reset_chip)(struct kvaser_usb *dev, int channel); int (*dev_flush_queue)(struct kvaser_usb_net_priv *priv); void (*dev_read_bulk_callback)(struct kvaser_usb *dev, void *buf, int len); void *(*dev_frame_to_cmd)(conststruct kvaser_usb_net_priv *priv, conststruct sk_buff *skb, int *cmd_len,
u16 transid);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.