linux/drivers/net/can/usb/etas_es58x/es58x_fd.c

// SPDX-License-Identifier: GPL-2.0

/* Driver for ETAS GmbH ES58X USB CAN(-FD) Bus Interfaces.
 *
 * File es58x_fd.c: Adds support to ETAS ES582.1 and ES584.1 (naming
 * convention: we use the term "ES58X FD" when referring to those two
 * variants together).
 *
 * Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved.
 * Copyright (c) 2020 ETAS K.K.. All rights reserved.
 * Copyright (c) 2020-2022 Vincent Mailhol <[email protected]>
 */

#include <asm/unaligned.h>
#include <linux/kernel.h>
#include <linux/units.h>

#include "es58x_core.h"
#include "es58x_fd.h"

/**
 * es58x_fd_sizeof_rx_tx_msg() - Calculate the actual length of the
 *	structure of a rx or tx message.
 * @msg: message of variable length, must have a dlc and a len fields.
 *
 * Even if RTR frames have actually no payload, the ES58X devices
 * still expect it. Must be a macro in order to accept several types
 * (struct es58x_fd_tx_can_msg and struct es58x_fd_rx_can_msg) as an
 * input.
 *
 * Return: length of the message.
 */
#define es58x_fd_sizeof_rx_tx_msg(msg)

static enum es58x_fd_cmd_type es58x_fd_cmd_type(struct net_device *netdev)
{}

static u16 es58x_fd_get_msg_len(const union es58x_urb_cmd *urb_cmd)
{}

static int es58x_fd_echo_msg(struct net_device *netdev,
			     const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd)
{}

static int es58x_fd_rx_can_msg(struct net_device *netdev,
			       const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd)
{}

static int es58x_fd_rx_event_msg(struct net_device *netdev,
				 const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd)
{}

static int es58x_fd_rx_cmd_ret_u32(struct net_device *netdev,
				   const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd,
				   enum es58x_ret_type cmd_ret_type)
{}

static int es58x_fd_tx_ack_msg(struct net_device *netdev,
			       const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd)
{}

static int es58x_fd_can_cmd_id(struct es58x_device *es58x_dev,
			       const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd)
{}

static int es58x_fd_device_cmd_id(struct es58x_device *es58x_dev,
				  const struct es58x_fd_urb_cmd *es58x_fd_urb_cmd)
{}

static int es58x_fd_handle_urb_cmd(struct es58x_device *es58x_dev,
				   const union es58x_urb_cmd *urb_cmd)
{}

static void es58x_fd_fill_urb_header(union es58x_urb_cmd *urb_cmd, u8 cmd_type,
				     u8 cmd_id, u8 channel_idx, u16 msg_len)
{}

static int es58x_fd_tx_can_msg(struct es58x_priv *priv,
			       const struct sk_buff *skb)
{}

static void es58x_fd_convert_bittiming(struct es58x_fd_bittiming *es58x_fd_bt,
				       struct can_bittiming *bt)
{}

static int es58x_fd_enable_channel(struct es58x_priv *priv)
{}

static int es58x_fd_disable_channel(struct es58x_priv *priv)
{}

static int es58x_fd_get_timestamp(struct es58x_device *es58x_dev)
{}

/* Nominal bittiming constants for ES582.1 and ES584.1 as specified in
 * the microcontroller datasheet: "SAM E70/S70/V70/V71 Family" section
 * 49.6.8 "MCAN Nominal Bit Timing and Prescaler Register" from
 * Microchip.
 *
 * The values from the specification are the hardware register
 * values. To convert them to the functional values, all ranges were
 * incremented by 1 (e.g. range [0..n-1] changed to [1..n]).
 */
static const struct can_bittiming_const es58x_fd_nom_bittiming_const =;

/* Data bittiming constants for ES582.1 and ES584.1 as specified in
 * the microcontroller datasheet: "SAM E70/S70/V70/V71 Family" section
 * 49.6.4 "MCAN Data Bit Timing and Prescaler Register" from
 * Microchip.
 */
static const struct can_bittiming_const es58x_fd_data_bittiming_const =;

/* Transmission Delay Compensation constants for ES582.1 and ES584.1
 * as specified in the microcontroller datasheet: "SAM E70/S70/V70/V71
 * Family" section 49.6.15 "MCAN Transmitter Delay Compensation
 * Register" from Microchip.
 */
static const struct can_tdc_const es58x_tdc_const =;

const struct es58x_parameters es58x_fd_param =;

const struct es58x_operators es58x_fd_ops =;