X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/102b0fcc467c77d0a8f82cfee060353e3cf17261..c6d6f58c34e1b6a4c03d1e86d1abf48eeb6f5624:/lincan/src/devcommon.c diff --git a/lincan/src/devcommon.c b/lincan/src/devcommon.c index 9cd29d0..dce205a 100644 --- a/lincan/src/devcommon.c +++ b/lincan/src/devcommon.c @@ -6,16 +6,8 @@ * Version lincan-0.2 9 Jul 2003 */ -#define __NO_VERSION__ -#include -#include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) -#include -#else -#include -#endif -#include #include "../include/can.h" +#include "../include/can_sysdep.h" #include "../include/can_queue.h" #include "../include/main.h" #include "../include/devcommon.h" @@ -30,18 +22,18 @@ void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qed /*case CANQUEUE_NOTIFY_EMPTY:*/ /*case CANQUEUE_NOTIFY_SPACE:*/ /*case CANQUEUE_NOTIFY_NOUSR: - wake_up_interruptible(&qends->endinfo.chipinfo.daemonq); + wake_up(&qends->endinfo.chipinfo.daemonq); break;*/ case CANQUEUE_NOTIFY_PROC: - /*wake_up_interruptible(&qends->endinfo.chipinfo.daemonq);*/ + /*wake_up(&qends->endinfo.chipinfo.daemonq);*/ chip->chipspecops->wakeup_tx(chip, obj); break; + case CANQUEUE_NOTIFY_DEAD_WANTED: case CANQUEUE_NOTIFY_DEAD: - if(atomic_read(&qedge->edge_used)>0) - atomic_dec(&qedge->edge_used); + if(canque_fifo_test_and_clear_fl(&qedge->fifo, READY)) + canque_edge_decref(qedge); break; - case CANQUEUE_NOTIFY_ATACH: - atomic_inc(&qedge->edge_used); + case CANQUEUE_NOTIFY_ATTACH: break; } } @@ -64,3 +56,7 @@ int canqueue_ends_init_chip(struct canque_ends_t *qends, struct chip_t *chip, st } +int canqueue_ends_done_chip(struct canque_ends_t *qends) +{ + return 0; +}