]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/devcommon.c
Ensure, that chip wakeup_tx function is not called for not fully setup CAN channel.
[lincan.git] / lincan / src / devcommon.c
index 83412549ad89a94e9f3b76949a860f158aa48a52..bc4157defe2b9438d605eef8e2a9065821a724d5 100644 (file)
@@ -59,7 +59,10 @@ void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qed
                case CANQUEUE_NOTIFY_PROC:
                    #ifndef CAN_WITH_RTL
                        /*wake_up(&qends->endinfo.chipinfo.daemonq);*/
-                       chip->chipspecops->wakeup_tx(chip, obj);
+                       if(canque_fifo_test_fl(&qedge->fifo, READY)){
+                               if ((chip) && (chip->flags & CHIP_ATTACHED))
+                                       chip->chipspecops->wakeup_tx(chip, obj);
+                       }
                    #else /*CAN_WITH_RTL*/
                        can_msgobj_set_fl(obj,TX_REQUEST);
                        canqueue_wake_chip_worker(qends, chip, obj);