]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/can_devrtl.c
To prevent future name collisions "chip_t" changed to "canchip_t"
[lincan.git] / lincan / src / can_devrtl.c
index 5db8b82e8ed298a50b92839d21f9ff73b3982dd4..4557531d38dfa08e5a0bbfc177b04d634b1b7986 100644 (file)
@@ -26,7 +26,7 @@ can_spinlock_t can_irq_manipulation_lock;
 
 unsigned int can_rtl_isr( unsigned int irq_num, struct pt_regs *r )
 {
-       struct chip_t *chip;
+       struct canchip_t *chip;
        struct candevice_t *candev;
        int board_nr;
        int chip_nr;
@@ -80,7 +80,7 @@ rtl_free_global_irq( irq )
 
 void * can_chip_worker_thread(void *arg)
 {
-       struct chip_t *chip = (struct chip_t *) arg;
+       struct canchip_t *chip = (struct canchip_t *) arg;
        struct msgobj_t *obj;
        int ret, i;
        int loop_cnt;
@@ -132,8 +132,15 @@ void * can_chip_worker_thread(void *arg)
 
                /*re-enable chip IRQ, I am not sure, if this is required,
                  but it seems to not work without that */
-               if(chip->chip_irq>=0)
-                       can_enable_irq(chip->chip_irq);
+               if(chip->chip_irq>=0) {
+                       if ((chip->flags & CHIP_IRQ_VME) == 0) can_enable_irq(chip->chip_irq);
+                   #ifdef CAN_ENABLE_VME_SUPPORT
+                       else tundra_rtl_enable_pci_irq(); 
+                       /* FIXME: Bad practice. Doesn't work with more
+                        * than one card. */
+                   #endif /*CAN_ENABLE_VME_SUPPORT*/
+
+               }
 
                RTL_MARK_SUSPENDED(pthread_self());
                if(test_and_clear_bit(MSGOBJ_WORKER_WAKE_b,&chip->pend_flags)){
@@ -147,7 +154,7 @@ void * can_chip_worker_thread(void *arg)
 }
 
 
-int can_chip_setup_irq(struct chip_t *chip)
+int can_chip_setup_irq(struct canchip_t *chip)
 {
        int ret;
         struct sched_param sched_param;
@@ -188,7 +195,7 @@ int can_chip_setup_irq(struct chip_t *chip)
 }
 
 
-void can_chip_free_irq(struct chip_t *chip)
+void can_chip_free_irq(struct canchip_t *chip)
 {
        if(chip->worker_thread)
                pthread_delete_np(chip->worker_thread);