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 37bbbf1..559c2db 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;
-                               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;
                }
index 16d21db..bf6585a 100644 (file)
 #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
@@ -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);
-                       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:
@@ -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*/
+                       can_msgobj_set_fl(obj,FILTCH_REQUEST);
+                       canqueue_wake_chip_worker(qends, chip, obj);
                    #endif /*CAN_WITH_RTL*/
                        
                        break;
index 68feef7..6897948 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);
 }
 
+/**
+ * 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();
index eafed8a..57b33c8 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
  *
+ * 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
  */
index d8818ab..05a12f9 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
  *
+ * 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,6 +351,8 @@ 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*/