![]() |
RTEMS 7.0-rc1
|
This structure represents CAN controller operations. These provides interface from IOCTL calls to controller functions and should be registered during controller initialization. More...
#include <can-devcommon.h>
Data Fields | |
| int(* | start_chip )(struct rtems_can_chip *chip) |
| Starts the chip. Called with RTEMS_CAN_CHIP_START ioctl. | |
| int(* | stop_chip )(struct rtems_can_chip *chip, struct timespec *ts) |
| Stops the chip. Called with RTEMS_CAN_CHIP_STOP ioctl. | |
| int(* | chip_ioctl )(struct rtems_can_chip *chip, ioctl_command_t command, void *arg) |
| Unrecognized ioctl calls are passed to chip specific function to handle them. This way chip specific ioctl calls can be implemented. | |
| int(* | get_chip_timestamp )(struct rtems_can_chip *chip, uint64_t *timestamp) |
| Obtains timestamp from the controller. Called with RTEMS_CAN_CHIP_GET_TIMESTAMP ioctl. | |
| int(* | get_chip_info )(struct rtems_can_chip *chip, int what) |
| Obtains controller's information specified by input integer argument. Called with RTEMS_CAN_CHIP_GET_INFO ioctl. | |
| int(* | calc_bittiming )(struct rtems_can_chip *chip, int type, struct rtems_can_bittiming *bt) |
| Calculates bit timing from given bit rate and saves the values to controller's registers. Called with RTEMS_CAN_SET_BITRATE ioctl if RTEMS_CAN_BITTIME_FROM_BITRATE is set. | |
| int(* | check_and_set_bittiming )(struct rtems_can_chip *chip, int type, struct rtems_can_bittiming *bt) |
| Checks bit timing given by user and saves it to controller's registers. Called with RTEMS_CAN_SET_BITRATE ioctl if RTEMS_CAN_BITTIME_FROM_PRECOMPUTED is set. | |
| int(* | set_chip_mode )(struct rtems_can_chip *chip, uint32_t mode) |
| Sets controller mode defined in input argument. Called with RTEMS_CAN_CHIP_SET_MODE. | |
This structure represents CAN controller operations. These provides interface from IOCTL calls to controller functions and should be registered during controller initialization.
| int(* rtems_can_chip_ops::calc_bittiming) (struct rtems_can_chip *chip, int type, struct rtems_can_bittiming *bt) |
Calculates bit timing from given bit rate and saves the values to controller's registers. Called with RTEMS_CAN_SET_BITRATE ioctl if RTEMS_CAN_BITTIME_FROM_BITRATE is set.
| chip | Pointer to chip structure. |
| type | Bittiming type (nominal, FD) |
| bt | Pointer to rtems_can_bittiming structure |
| -EPERM | Chip is already started, cannot change bittiming. |
| -EINVAL | Incorrect bit time type. |
| int(* rtems_can_chip_ops::check_and_set_bittiming) (struct rtems_can_chip *chip, int type, struct rtems_can_bittiming *bt) |
Checks bit timing given by user and saves it to controller's registers. Called with RTEMS_CAN_SET_BITRATE ioctl if RTEMS_CAN_BITTIME_FROM_PRECOMPUTED is set.
| chip | Pointer to chip structure. |
| type | Bittiming type (nominal, FD) |
| bt | Pointer to rtems_can_bittiming structure |
| -EPERM | Chip is already started, cannot change bittiming. |
| -EINVAL | Incorrect bit time type. |
| int(* rtems_can_chip_ops::chip_ioctl) (struct rtems_can_chip *chip, ioctl_command_t command, void *arg) |
Unrecognized ioctl calls are passed to chip specific function to handle them. This way chip specific ioctl calls can be implemented.
| chip | Pointer to chip structure. |
| command | IOCTL command |
| arg | Void pointer to IOCL argument |
| int(* rtems_can_chip_ops::get_chip_info) (struct rtems_can_chip *chip, int what) |
Obtains controller's information specified by input integer argument. Called with RTEMS_CAN_CHIP_GET_INFO ioctl.
| chip | Pointer to chip structure. |
| what | Integer specifying what info should be retrieved. Refer to CANChip info defines. |
| int(* rtems_can_chip_ops::get_chip_timestamp) (struct rtems_can_chip *chip, uint64_t *timestamp) |
Obtains timestamp from the controller. Called with RTEMS_CAN_CHIP_GET_TIMESTAMP ioctl.
| chip | Pointer to chip structure. |
| timestamp | Pointer to uint64_t integer where timestamp is stored |
| int(* rtems_can_chip_ops::set_chip_mode) (struct rtems_can_chip *chip, uint32_t mode) |
Sets controller mode defined in input argument. Called with RTEMS_CAN_CHIP_SET_MODE.
| chip | Pointer to chip structure. |
| mode | Modes to be set. |
| int(* rtems_can_chip_ops::start_chip) (struct rtems_can_chip *chip) |
Starts the chip. Called with RTEMS_CAN_CHIP_START ioctl.
The function should atomically set RTEMS_CAN_CHIP_RUNNING flag in flags field of rtems_can_chip structure and abort all currently filled HW buffers.
| chip | Pointer to chip structure. |
| int(* rtems_can_chip_ops::stop_chip) (struct rtems_can_chip *chip, struct timespec *ts) |
Stops the chip. Called with RTEMS_CAN_CHIP_STOP ioctl.
The function should atomically clear RTEMS_CAN_CHIP_RUNNING flag in flags field of rtems_can_chip structure.
The function is blocking and passed with an option argument that provides the timeout (not blocking at all if argument is NULL). The function should abort all outgoing TX frames and clear the FIFO queues, returning the frames to the user as TX error frames. The flush takes places if those frames are not returned within the specified timeout.
| chip | Pointer to rtems_can_chip structure. |
| ts | Pointer to the stop operation timeout. |