]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/devcommon.c
Header-files cleanup and CAN queue edges and ends locking reimplemented.
[lincan.git] / lincan / src / devcommon.c
index 9cd29d00e2a398b101e278a430a4d4356ce868c6..dce205a620507805cf4ca1f3342041f820daeda8 100644 (file)
@@ -6,16 +6,8 @@
  * Version lincan-0.2  9 Jul 2003
  */
 
-#define __NO_VERSION__
-#include <linux/module.h>
-#include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
-#include <linux/malloc.h>
-#else
-#include <linux/slab.h>
-#endif
-#include <linux/wait.h>
 #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;
+}