]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Added glue required for RTL hardware filters updates.
authorppisa <ppisa>
Sun, 21 Mar 2004 18:48:04 +0000 (18:48 +0000)
committerppisa <ppisa>
Sun, 21 Mar 2004 18:48:04 +0000 (18:48 +0000)
lincan/src/can_devrtl.c
lincan/src/devcommon.c
lincan/src/i82527.c
lincan/src/sja1000p.c
lincan/src/virtual.c

index 37bbbf1c023fb54f4769669d04c97f9422475005..559c2db9a0882e99fa41bfbc0bfea293a7ddd7c5 100644 (file)
@@ -111,10 +111,15 @@ void * can_chip_worker_thread(void *arg)
                        for(i=0;i<chip->max_objects;i++){
                                if((obj=chip->msgobj[i])==NULL)
                                        continue;
                        for(i=0;i<chip->max_objects;i++){
                                if((obj=chip->msgobj[i])==NULL)
                                        continue;
-                               if(!can_msgobj_test_and_clear_fl(obj,TX_REQUEST))
-                                       continue;
-                               DEBUGMSG("Calling wakeup_tx\n");
-                               chip->chipspecops->wakeup_tx(chip, obj);
+                               if(can_msgobj_test_fl(obj,TX_REQUEST)) {
+                                       DEBUGMSG("Calling wakeup_tx\n");
+                                       chip->chipspecops->wakeup_tx(chip, obj);
+                               }
+                               if(can_msgobj_test_fl(obj,FILTCH_REQUEST)) {
+                                       DEBUGMSG("Calling filtch_rq\n");
+                                       if(chip->chipspecops->filtch_rq)
+                                               chip->chipspecops->filtch_rq(chip, obj);
+                               }
                        }
                        continue;
                }
                        }
                        continue;
                }
index 16d21db148191e0f5cba1a1057a5dc65fd887e95..bf6585a42adf4d6e511224474f698b5e05511bbd 100644 (file)
 #include "../include/main.h"
 #include "../include/devcommon.h"
 
 #include "../include/main.h"
 #include "../include/devcommon.h"
 
+#ifdef CAN_WITH_RTL
+static inline
+void canqueue_wake_chip_worker(struct canque_ends_t *qends, struct chip_t *chip, struct msgobj_t *obj)
+{
+       if(qends->endinfo.chipinfo.worker_thread){
+               can_msgobj_set_fl(obj,WORKER_WAKE);
+               pthread_kill(qends->endinfo.chipinfo.worker_thread,RTL_SIGNAL_WAKEUP);
+               rtl_schedule();
+       } else {
+               set_bit(MSGOBJ_TX_REQUEST_b,&chip->pend_flags);
+               if(chip->worker_thread) {
+                       set_bit(MSGOBJ_WORKER_WAKE_b,&chip->pend_flags);
+                       pthread_kill(chip->worker_thread,RTL_SIGNAL_WAKEUP);
+                       rtl_schedule();
+               }
+       }
+}
+
+#endif /*CAN_WITH_RTL*/
+
+
 /**
  * canqueue_notify_chip - notification callback handler for CAN chips ends of queues
  * @qends: pointer to the callback side ends structure
 /**
  * canqueue_notify_chip - notification callback handler for CAN chips ends of queues
  * @qends: pointer to the callback side ends structure
@@ -41,19 +62,7 @@ void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qed
                        chip->chipspecops->wakeup_tx(chip, obj);
                    #else /*CAN_WITH_RTL*/
                        can_msgobj_set_fl(obj,TX_REQUEST);
                        chip->chipspecops->wakeup_tx(chip, obj);
                    #else /*CAN_WITH_RTL*/
                        can_msgobj_set_fl(obj,TX_REQUEST);
-                       if(qends->endinfo.chipinfo.worker_thread){
-                               can_msgobj_set_fl(obj,WORKER_WAKE);
-                               pthread_kill(qends->endinfo.chipinfo.worker_thread,RTL_SIGNAL_WAKEUP);
-                               rtl_schedule();
-                       } else {
-                               set_bit(MSGOBJ_TX_REQUEST_b,&chip->pend_flags);
-
-                               if(chip->worker_thread) {
-                                       set_bit(MSGOBJ_WORKER_WAKE_b,&chip->pend_flags);
-                                       pthread_kill(chip->worker_thread,RTL_SIGNAL_WAKEUP);
-                                       rtl_schedule();
-                               }
-                       }
+                       canqueue_wake_chip_worker(qends, chip, obj);
                    #endif /*CAN_WITH_RTL*/
                        break;
                case CANQUEUE_NOTIFY_DEAD_WANTED:
                    #endif /*CAN_WITH_RTL*/
                        break;
                case CANQUEUE_NOTIFY_DEAD_WANTED:
@@ -69,6 +78,8 @@ void canqueue_notify_chip(struct canque_ends_t *qends, struct canque_edge_t *qed
                    #ifndef CAN_WITH_RTL
                        chip->chipspecops->filtch_rq(chip, obj);
                    #else /*CAN_WITH_RTL*/
                    #ifndef CAN_WITH_RTL
                        chip->chipspecops->filtch_rq(chip, obj);
                    #else /*CAN_WITH_RTL*/
+                       can_msgobj_set_fl(obj,FILTCH_REQUEST);
+                       canqueue_wake_chip_worker(qends, chip, obj);
                    #endif /*CAN_WITH_RTL*/
                        
                        break;
                    #endif /*CAN_WITH_RTL*/
                        
                        break;
index 68feef7ecdf4cd1b765785f3735c8429ed1a5473..68979489e8095731baa5c0670ee54a948c77be61 100644 (file)
@@ -681,6 +681,17 @@ void i82527_irq_rtr_handler(struct chip_t *chip, struct msgobj_t *obj,
                wake_up(&rtr_search->rtr_wq);
 }
 
                wake_up(&rtr_search->rtr_wq);
 }
 
+/**
+ * i82527_wakeup_tx: - wakeups TX processing
+ * @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/i82527.c
+ */
 int i82527_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj)
 {
        can_preempt_disable();
 int i82527_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj)
 {
        can_preempt_disable();
index eafed8a83912b32872ec9eacc27c659fc3b26018..57b33c85a21e968ae0af8df5391978a44b4e0a66 100644 (file)
@@ -685,6 +685,9 @@ can_irqreturn_t sja1000p_irq_handler(int irq, void *dev_id, struct pt_regs *regs
  * @chip: pointer to chip state structure
  * @obj: pointer to message object structure
  *
  * @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/sja1000p.c
  */
  * Return Value: negative value reports error.
  * File: src/sja1000p.c
  */
index d8818abb60b5a3589ad92d635c730f2c25283172..05a12f9d5026e69ca65f12702fcb4c9484a1f719 100644 (file)
@@ -337,6 +337,9 @@ void virtual_do_tx_timeout(unsigned long data)
  * @chip: pointer to chip state structure
  * @obj: pointer to message object structure
  *
  * @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
  */
  * Return Value: negative value reports error.
  * File: src/virtual.c
  */
@@ -348,6 +351,8 @@ int virtual_wakeup_tx(struct chip_t *chip, struct msgobj_t *obj)
        struct canque_slot_t *slot;
        int cmd;
 
        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*/
     #ifndef CAN_WITH_RTL
        if(!virtual_bus_latency(obj)) {
     #endif /*CAN_WITH_RTL*/