X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/cb551cc1582f3b51cf17e80730bee3c2f0701c3f..258e4a224adc90317b3d11622a3076ba6d61b0d2:/lincan/src/c_can_irq.c diff --git a/lincan/src/c_can_irq.c b/lincan/src/c_can_irq.c index 5257d0f..71e84fc 100644 --- a/lincan/src/c_can_irq.c +++ b/lincan/src/c_can_irq.c @@ -6,7 +6,7 @@ * Rewritten for new CAN queues 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" @@ -52,6 +52,9 @@ inline void c_can_irq_write_handler( struct chip_t *pchip, int idxobj) if(pmsgobj->tx_slot){ /* Do local transmitted message distribution if enabled */ if (processlocal){ + /* fill CAN message timestamp */ + can_filltimestamp(&pmsgobj->tx_slot->msg.timestamp); + pmsgobj->tx_slot->msg.flags |= MSG_LOCAL; canque_filter_msg2edges(pmsgobj->qends, &pmsgobj->tx_slot->msg); } @@ -140,13 +143,16 @@ inline void c_can_irq_read_handler( struct chip_t *pchip, } DEBUGMSG("(c%dm%d)Received Message:\n", pchip->chip_idx, pmsgobj->object); - DEBUGMSG(" id = %d\n", + DEBUGMSG(" id = %ld\n", pmsgobj->rx_msg.id); DEBUGMSG(" length = %d\n", pmsgobj->rx_msg.length); for ( i=0; i < pmsgobj->rx_msg.length; i++ ) DEBUGMSG(" data[%d] = 0x%.2x\n", i, pmsgobj->rx_msg.data[i]); + /* fill CAN message timestamp */ + can_filltimestamp(&pmsgobj->rx_msg.timestamp); + canque_filter_msg2edges(pmsgobj->qends, &pmsgobj->rx_msg); #ifdef CAN_WITH_STATISTICS @@ -208,10 +214,9 @@ void c_can_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj) // c_can_irq_handler // -can_irqreturn_t c_can_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +int c_can_irq_handler(int irq, struct chip_t *chip) { struct rtr_id *rtr_search = hardware_p->rtr_queue; - struct chip_t *pchip = (struct chip_t *)dev_id; u16 chip_status; int id0=0, id1=0; u16 errcount = 0; @@ -233,13 +238,13 @@ can_irqreturn_t c_can_irq_handler(int irq, void *dev_id, struct pt_regs *regs) if(!irqreg) { DEBUGMSG( "\n(c%d)IRQ handler: addr=%.8lx spurious interrupt\n", pchip->chip_idx, - (long)( pchip->/*v*/base_addr/* + CCSR*/)); - return CAN_IRQ_NONE; + (long)( pchip->/*v*/chip_base_addr/* + CCSR*/)); + return CANCHIP_IRQ_NONE; } DEBUGMSG( "\n(c%d)IRQ handler: addr=%.8lx irqreg=0x%.4x\n", pchip->chip_idx, - (long)( pchip->/*v*/base_addr/* + CCSR*/), + (long)( pchip->/*v*/chip_base_addr/* + CCSR*/), irqreg); @@ -470,7 +475,7 @@ can_irqreturn_t c_can_irq_handler(int irq, void *dev_id, struct pt_regs *regs) // Get irq status again irqreg = c_can_read_reg_w( pchip, CCINTR ); } - return CAN_IRQ_HANDLED; + return CANCHIP_IRQ_HANDLED; } ///////////////////////////////////////////////////////////////////////////////