X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/d8365e7fd56ca15c05502848338017013e628a9d..258e4a224adc90317b3d11622a3076ba6d61b0d2:/lincan/src/virtual.c diff --git a/lincan/src/virtual.c b/lincan/src/virtual.c index d8818ab..67fc276 100644 --- a/lincan/src/virtual.c +++ b/lincan/src/virtual.c @@ -3,7 +3,7 @@ * Written for new CAN driver version by Pavel Pisa - OCERA team member * email:pisa@cmp.felk.cvut.cz * This software is released under the GPL-License. - * Version lincan-0.2 9 Jul 2003 + * Version lincan-0.3 17 Jun 2004 */ #include "../include/can.h" @@ -280,9 +280,9 @@ void virtual_irq_write_handler(struct chip_t *chip, struct msgobj_t *obj) * message queues. * File: src/virtual.c */ -can_irqreturn_t virtual_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +int virtual_irq_handler(int irq, struct chip_t *chip) { - return CAN_IRQ_HANDLED; + return CANCHIP_IRQ_HANDLED; } @@ -320,6 +320,9 @@ void virtual_do_tx_timeout(unsigned long data) struct msgobj_t *obj=(struct msgobj_t *)data; if(obj->tx_slot) { + /* fill CAN message timestamp */ + can_filltimestamp(&obj->tx_slot->msg.timestamp); + /* Deliver message to edges */ canque_filter_msg2edges(obj->qends, &obj->tx_slot->msg); /* Free transmitted slot */ @@ -337,6 +340,9 @@ void virtual_do_tx_timeout(unsigned long data) * @chip: pointer to chip state structure * @obj: pointer to message object structure * + * Function is responsible for initiating message transmition. + * It is responsible for clearing of object TX_REQUEST flag + * * Return Value: negative value reports error. * File: src/virtual.c */ @@ -348,12 +354,17 @@ int virtual_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj) struct canque_slot_t *slot; int cmd; + can_msgobj_clear_fl(obj,TX_REQUEST); + #ifndef CAN_WITH_RTL if(!virtual_bus_latency(obj)) { #endif /*CAN_WITH_RTL*/ /* Ensure delivery of all ready slots */ while((cmd=canque_test_outslot(obj->qends, &qedge, &slot)) >= 0){ if(cmd==0) { + /* fill CAN message timestamp */ + can_filltimestamp(&slot->msg.timestamp); + canque_filter_msg2edges(obj->qends, &slot->msg); DEBUGMSG("virtual: direct delivery\n"); }