1 /* devcommon.c - common device code
2 * Linux CAN-bus device driver.
3 * New CAN queues by Pavel Pisa - OCERA team member
4 * email:pisa@cmp.felk.cvut.cz
5 * This software is released under the GPL-License.
6 * Version lincan-0.2 9 Jul 2003
9 #include "../include/can.h"
10 #include "../include/can_sysdep.h"
11 #include "../include/can_queue.h"
12 #include "../include/main.h"
13 #include "../include/devcommon.h"
15 void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qedge, int what)
17 struct chip_t *chip=qends->endinfo.chipinfo.chip;
18 struct msgobj_t *obj=qends->endinfo.chipinfo.msgobj;
20 DEBUGMSG("canqueue_notify_chip for edge %d and event %d\n",qedge->edge_num,what);
22 /*case CANQUEUE_NOTIFY_EMPTY:*/
23 /*case CANQUEUE_NOTIFY_SPACE:*/
24 /*case CANQUEUE_NOTIFY_NOUSR:
25 wake_up(&qends->endinfo.chipinfo.daemonq);
27 case CANQUEUE_NOTIFY_PROC:
28 /*wake_up(&qends->endinfo.chipinfo.daemonq);*/
29 chip->chipspecops->wakeup_tx(chip, obj);
31 case CANQUEUE_NOTIFY_DEAD_WANTED:
32 case CANQUEUE_NOTIFY_DEAD:
33 if(canque_fifo_test_and_clear_fl(&qedge->fifo, READY))
34 canque_edge_decref(qedge);
36 case CANQUEUE_NOTIFY_ATTACH:
42 int canqueue_ends_init_chip(struct canque_ends_t *qends, struct chip_t *chip, struct msgobj_t *obj)
45 ret=canqueue_ends_init_gen(qends);
49 init_waitqueue_head(&qends->endinfo.chipinfo.daemonq);
50 qends->endinfo.chipinfo.chip=chip;
51 qends->endinfo.chipinfo.msgobj=obj;
52 qends->notify=canqueue_notify_chip;
54 DEBUGMSG("canqueue_ends_init_chip\n");
59 int canqueue_ends_done_chip(struct canque_ends_t *qends)