fd = open (can_path, O_RDWR);
if (fd == -1) {
- ERROR ("could not open /dev/can%u\n", params->net);
+ FRESCAN_ERROR ("could not open /dev/can%u\n", params->net);
return -1;
}
ret = ioctl(fd, CAN_IOCTL_SET_FILTERS, &ioctl_filters);
if (ret == -1) {
- ERROR ("ioctl CAN_IOCTL_SET_FILTERS failed /dev/can%u\n",
+ FRESCAN_ERROR ("ioctl CAN_IOCTL_SET_FILTERS failed /dev/can%u\n",
params->net);
return -1;
}
ret = ioctl(fd, CAN_IOCTL_SET_TX_HOOK, frescan_hook_frame_sent);
if (ret == -1) {
- ERROR ("ioctl CAN_IOCTL_SET_TX_HOOK failed /dev/can%u\n",
+ FRESCAN_ERROR ("ioctl CAN_IOCTL_SET_TX_HOOK failed /dev/can%u\n",
params->net);
return -1;
}
ret = ioctl(fd, CAN_IOCTL_SET_RX_HOOK, frescan_hook_frame_recv);
if (ret == -1) {
- ERROR ("ioctl CAN_IOCTL_SET_RX_HOOK failed /dev/can%u\n",
+ FRESCAN_ERROR ("ioctl CAN_IOCTL_SET_RX_HOOK failed /dev/can%u\n",
params->net);
return -1;
}
ret = ioctl(fd, CAN_IOCTL_SET_AB_HOOK, frescan_hook_frame_aborted);
if (ret == -1) {
- ERROR ("ioctl CAN_IOCTL_SET_AB_HOOK failed /dev/can%u\n",
+ FRESCAN_ERROR ("ioctl CAN_IOCTL_SET_AB_HOOK failed /dev/can%u\n",
params->net);
return -1;
}
ret = frescan_data_init(fd, params);
if (ret != 0) {
- ERROR("could not initialize the global data\n");
+ FRESCAN_ERROR("could not initialize the global data\n");
return -1;
}
ret = frescan_packets_init();
if (ret != 0) {
- ERROR("could not initialize the packets pool\n");
+ FRESCAN_ERROR("could not initialize the packets pool\n");
return -1;
}
ret = frescan_queues_init(&the_networks[params->net].queues, params);
if (ret != 0) {
- ERROR("could not initialize the queues\n");
+ FRESCAN_ERROR("could not initialize the queues\n");
return -1;
}
ret = frescan_servers_init(params->net);
if (ret != 0) {
- ERROR("could not initialize the servers\n");
+ FRESCAN_ERROR("could not initialize the servers\n");
return -1;
}
"checking arguments (msg size=%d)\n", size);
if ((params == NULL) || (msg == NULL) || (size == 0)) {
- ERROR("arguments are not ok\n");
+ FRESCAN_ERROR("arguments are not ok\n");
return -1;
}
FRESCAN_RELEASE_LOCK(&the_networks[params->net].lock);
if (packet == NULL) {
- ERROR("could not allocate packet\n");
+ FRESCAN_ERROR("could not allocate packet\n");
return -1;
}
packet->flags = params->flags; // set the flags (to remember them)
FRESCAN_RELEASE_LOCK(&the_networks[params->net].lock);
if (packet->frame == NULL) {
- ERROR("could not allocate frame\n");
+ FRESCAN_ERROR("could not allocate frame\n");
return -1;
}
FRESCAN_RELEASE_LOCK(&the_networks[params->net].lock);
if (ret != 0) {
- ERROR("could not enqueue the packet\n");
+ FRESCAN_ERROR("could not enqueue the packet\n");
return -1;
}
} else {
FRESCAN_RELEASE_LOCK(&the_networks[params->net].lock);
if (ret != 0) {
- ERROR("could not enqueue the packet\n");
+ FRESCAN_ERROR("could not enqueue the packet\n");
return -1;
}
}
FRESCAN_RELEASE_LOCK(&the_networks[params->net].lock);
if (ret != 0) {
- ERROR("could not update hw buffer\n");
+ FRESCAN_ERROR("could not update hw buffer\n");
return -1;
}
ret = frescan_pqueue_dequeue(pqueue, &head, prio, blocking);
if (ret != 0) {
- ERROR ("could not dequeue packet\n");
+ FRESCAN_ERROR ("could not dequeue packet\n");
return -1;
}
*recv_bytes = 0;
return 0;
} else {
- ERROR ("blocking true, and packet = null\n");
+ FRESCAN_ERROR ("blocking true, and packet = null\n");
return -1;
}
}
ret = can_framespool_free(packet->frame);
if (ret != 0) {
- ERROR("could not free frame\n");
+ FRESCAN_ERROR("could not free frame\n");
return -1;
}
ret = frescan_packets_free(packet);
if (ret != 0) {
- ERROR("could not free packet\n");
+ FRESCAN_ERROR("could not free packet\n");
return -1;
}
}
FRESCAN_RELEASE_LOCK(&the_networks[params->net].lock);
if (ret != 0) {
- ERROR("could not free head packet\n");
+ FRESCAN_ERROR("could not free head packet\n");
return -1;
}
pqueue = the_networks[net].queues.rx_channel_queues[channel];
ret = frescan_pqueue_enqueue(pqueue, head, prio);
if (ret != 0) {
- ERROR("could not enqueue message in channel queue\n");
+ FRESCAN_ERROR("could not enqueue message in channel queue\n");
return -1;
}
ret = frescan_servers_frame_sent(chip->minor, id, packet);
if (ret != 0) {
- ERROR("could not let the server a frame was sent\n");
+ FRESCAN_ERROR("could not let the server a frame was sent\n");
return -1;
}
}
pqueue = the_networks[chip->minor].queues.tx_fp_queue;
ret = frescan_pqueue_requeue(pqueue, packet, prio);
if (ret != 0) {
- ERROR("could not requeue the packet\n");
+ FRESCAN_ERROR("could not requeue the packet\n");
return -1;
}
} else if (packet->flags & FRESCAN_SS) {
"requeue server %u packet\n", id);
ret = frescan_servers_requeue(chip->minor, id, packet);
if (ret != 0) {
- ERROR("could not requeue the packet\n");
+ FRESCAN_ERROR("could not requeue the packet\n");
return -1;
}
} else {
- ERROR("flags are not correct\n");
+ FRESCAN_ERROR("flags are not correct\n");
return -1;
}
} else {
ret = can_framespool_free(packet->frame);
if (ret != 0) {
- ERROR ("could not free the frame\n");
+ FRESCAN_ERROR ("could not free the frame\n");
return ret;
}
ret = frescan_packets_free(packet);
if (ret != 0) {
- ERROR ("could not free the packet\n");
+ FRESCAN_ERROR ("could not free the packet\n");
return ret;
}
ret = frescan_hw_buffer_update(chip->minor);
if (ret != 0) {
- ERROR("could not update hw buffer\n");
+ FRESCAN_ERROR("could not update hw buffer\n");
return -1;
}
pqueue = the_networks[chip->minor].queues.tx_fp_queue;
ret = frescan_pqueue_requeue(pqueue, packet, prio);
if (ret != 0) {
- ERROR("could not requeue the packet\n");
+ FRESCAN_ERROR("could not requeue the packet\n");
return -1;
}
} else if (packet->flags & FRESCAN_SS) {
ret = frescan_servers_requeue(chip->minor, id, packet);
if (ret != 0) {
- ERROR("could not requeue the packet\n");
+ FRESCAN_ERROR("could not requeue the packet\n");
return -1;
}
} else {
- ERROR("flags are not correct\n");
+ FRESCAN_ERROR("flags are not correct\n");
return -1;
}
ret = frescan_hw_buffer_update(chip->minor);
if (ret != 0) {
- ERROR("could not update hw buffer\n");
+ FRESCAN_ERROR("could not update hw buffer\n");
return -1;
}