#include "../include/can_iortl.h"
/* This is the 'Normal' read handler for normal transmission messages */
-static inline
-ssize_t can_std_read_rtl(struct canque_ends_t *qends, int nonblock_fl,
+static inline
+ssize_t can_std_read_rtl(struct canque_ends_t *qends, int nonblock_fl,
char *buffer, size_t length)
{
int ret;
int bytes_to_copy;
struct canque_edge_t *qedge;
struct canque_slot_t *slot;
-
+
ret=canque_test_outslot(qends, &qedge, &slot);
if(ret<0){
if (nonblock_fl) {
*(msg_buff++)=slot->msg;
canque_free_outslot(qends, qedge, slot);
bytes_to_copy = length-sizeof(struct canmsg_t);
-
+
while (bytes_to_copy > 0) {
ret=canque_test_outslot(qends, &qedge, &slot);
if(ret<0)
ssize_t can_read_rtl_posix(struct rtl_file *fptr, char *buffer,
size_t length, loff_t *ppos)
{
- struct canuser_t *canuser =
+ struct canuser_t *canuser =
(struct canuser_t *)can_get_rtl_file_private_data(fptr);
struct canque_ends_t *qends;
int ret;