RTEMS CAN/CAN FD Stack
|
This file is part of CAN/CAN FD bus common support and implements CAN FIFOs and generic hubs/ends for chip and caracter driver interface sides. More...
#include <string.h>
#include <stdlib.h>
#include <rtems/malloc.h>
#include <rtems/timespec.h>
#include <dev/can/can.h>
#include <dev/can/can-helpers.h>
#include <dev/can/can-devcommon.h>
#include <dev/can/can-impl.h>
Macros | |
#define | CAN_DEAD_FUNC_PRIORITY 120 |
#define | CAN_KERN_INITIALIZED ( 1 << 0 ) |
Functions | |
void | rtems_can_queue_edge_do_dead (struct rtems_can_queue_edge *qedge) |
This function disconnects the edge. | |
int | rtems_can_queue_ends_init_user (struct rtems_can_queue_ends_user_t *qends_user) |
Userspace clients specific ends initialization. | |
int | rtems_can_queue_sync_wait_kern (struct rtems_can_queue_ends *qends, struct rtems_can_queue_edge *qedge, bool nowait, rtems_interval timeout) |
This function waits for all slots processing. | |
int | rtems_can_queue_fifo_init_kern (struct rtems_can_queue_fifo *fifo, int allocated_slot_count, int max_data_length) |
This function initializes one CAN FIFO. | |
int | rtems_can_queue_fifo_done_kern (struct rtems_can_queue_fifo *fifo) |
This function frees slots allocated for CAN FIFO. | |
struct rtems_can_queue_edge * | rtems_can_queue_new_edge_kern (int allocated_slot_count, int max_data_length) |
This function allocates new edge structure. | |
int | rtems_can_queue_ends_sync_all_kern (struct rtems_can_queue_ends *qends, struct timespec *ts) |
This function waits for all ends to TX their messages. | |
int | rtems_can_queue_ends_dispose_kern (struct rtems_can_queue_ends *qends, bool nonblock) |
This function provides finalizing of the ends structure for clients. | |
int | rtems_can_queue_kern_initialize (void) |
This function provides initialization of kernel queue side. | |
This file is part of CAN/CAN FD bus common support and implements CAN FIFOs and generic hubs/ends for chip and caracter driver interface sides.
void rtems_can_queue_edge_do_dead | ( | struct rtems_can_queue_edge * | qedge | ) |
This function disconnects the edge.
qedge | Pointer to the edge to be disconnected. |
int rtems_can_queue_ends_dispose_kern | ( | struct rtems_can_queue_ends * | qends, |
bool | nonblock | ||
) |
This function provides finalizing of the ends structure for clients.
qends | Pointer to ends structure. |
nonblock | Flag indicating that user does not want to wait for processing of all remaining messages. |
int rtems_can_queue_ends_init_user | ( | struct rtems_can_queue_ends_user_t * | qends | ) |
Userspace clients specific ends initialization.
qends_user | Pointer to rtems_can_queue_ends_user_t structure. |
int rtems_can_queue_ends_sync_all_kern | ( | struct rtems_can_queue_ends * | qends, |
struct timespec * | ts | ||
) |
This function waits for all ends to TX their messages.
qends | Pointer to ends structure. |
ts | Absolute time againts CLOCK_MONOTONIC that informs rtems_can_queue_sync_wait_kern how long to wait. |
int rtems_can_queue_fifo_done_kern | ( | struct rtems_can_queue_fifo * | fifo | ) |
This function frees slots allocated for CAN FIFO.
fifo | Pointer to the FIFO structure. |
int rtems_can_queue_fifo_init_kern | ( | struct rtems_can_queue_fifo * | fifo, |
int | allocated_slot_count, | ||
int | max_data_length | ||
) |
This function initializes one CAN FIFO.
fifo | Pointer to the FIFO structure. |
allocated_slot_count | Number of requested slots. |
max_data_length | Maximum size of data in one slot/frame. |
int rtems_can_queue_kern_initialize | ( | void | ) |
This function provides initialization of kernel queue side.
struct rtems_can_queue_edge * rtems_can_queue_new_edge_kern | ( | int | allocated_slot_countm, |
int | max_data_length | ||
) |
This function allocates new edge structure.
allocated_slot_count | Required number of slots in the newly allocated edge structure. |
max_data_length | Maximul data length of one CAN frame. |
int rtems_can_queue_sync_wait_kern | ( | struct rtems_can_queue_ends * | qends, |
struct rtems_can_queue_edge * | qedge, | ||
bool | nowait, | ||
rtems_interval | timeout | ||
) |
This function waits for all slots processing.
qends | Ends structure belonging to calling communication object. |
qedge | Pointer to edge. |
nowait | True if semaphore should not wait |
timeout | Number of clock ticks to wait for semaphore. Passing zero indicates an infinite timeout. |