The SJA1000 interrupt support modified to provide more robust error recovery handling.
authorppisa <ppisa>
Wed, 3 May 2006 02:36:13 +0000 (02:36 +0000)
committerppisa <ppisa>
Wed, 3 May 2006 02:36:13 +0000 (02:36 +0000)
lincan/src/sja1000p.c

index 36319a1..ffadb6c 100644 (file)
@@ -767,7 +767,8 @@ int sja1000p_irq_handler(int irq, struct canchip_t *chip)
 
                /* (irq_register & sjaIR_TI) */
                /*      old variant using SJAIR, collides with intended use with irq_accept */
-               if ((status & sjaSR_TBS) && can_msgobj_test_fl(obj,TX_PENDING)) {
+               if (((status & sjaSR_TBS) && can_msgobj_test_fl(obj,TX_PENDING))||
+                   (can_msgobj_test_fl(obj,TX_REQUEST))) {
                        DEBUGMSG("sja1000_irq_handler: TI or TX_PENDING and TBS\n");
                        obj->ret = 0;
                        can_msgobj_set_fl(obj,TX_REQUEST);
@@ -824,7 +825,7 @@ int sja1000p_irq_handler(int irq, struct canchip_t *chip)
                         can_msgobj_set_fl(obj,TX_REQUEST);
 
        } while((irq_register & (sjaIR_BEI|sjaIR_EPI|sjaIR_DOI|sjaIR_EI|sjaIR_RI)) ||
-               (can_msgobj_test_fl(obj,TX_PENDING) && !can_msgobj_test_fl(obj,TX_LOCK)) ||
+               (can_msgobj_test_fl(obj,TX_REQUEST) && !can_msgobj_test_fl(obj,TX_LOCK)) ||
                (status & sjaSR_RBS));
 
        return CANCHIP_IRQ_HANDLED;