pthread_t thread=NULL;
DEBUGMSG("can_rtl_isr invoked for irq %d\n",irq_num);
-
+
/* I hate next loop, but RT-Linux does not provide context to ISR */
for (board_nr=hardware_p->nr_boards; board_nr--; ) {
if((candev=hardware_p->candevice[board_nr])==NULL)
RTL_MARK_SUSPENDED(pthread_self());
return rtl_schedule();
can_enable_irq
-can_disable_irq
+can_disable_irq
rtl_critical( state )
rtl_end_critical( state )
-rtl_request_global_irq( irq, isr );
+rtl_request_global_irq( irq, isr );
rtl_free_global_irq( irq )
*/
int ret, i;
int loop_cnt;
rtl_irqstate_t flags;
-
+
if(!chip) return 0;
-
-
+
+
if (!(chip->flags & CHIP_CONFIGURED)){
if (chip->chipspecops->chip_config(chip))
CANMSG("Error configuring chip.\n");
else
- chip->flags |= CHIP_CONFIGURED;
+ chip->flags |= CHIP_CONFIGURED;
if((chip->msgobj[0])!=NULL)
if (chip->chipspecops->pre_read_config(chip,chip->msgobj[0])<0)
CANMSG("Error initializing chip for receiving\n");
-
+
} /* End of chip configuration */
set_bit(MSGOBJ_IRQ_REQUEST_b,&chip->pend_flags);
-
+
while (1) {
DEBUGMSG("Worker thread for chip %d active\n",chip->chip_idx);
*
* irq_accept added to the LinCAN driver now,
* and above workaround should not be required.
- * Enable rtl_hard_enable_irq() at line
+ * Enable rtl_hard_enable_irq() at line
* ca91c042.c:1045
*/
#endif /*CAN_ENABLE_VME_SUPPORT*/
struct sched_param sched_param;
pthread_attr_t attrib;
pthread_attr_t *attrib_p=NULL;
-
+
if(chip==NULL)
return -1;
-
+
if(can_rtl_priority>=0){
pthread_attr_init(&attrib);
sched_param.sched_priority = can_rtl_priority;
/* pthread_attr_setschedpolicy(&attrib, SCHED_FIFO); */
attrib_p=&attrib;
}
-
+
if(chip->chipspecops->irq_handler && !(chip->flags & CHIP_IRQ_CUSTOM)){
int (*my_request_irq)(unsigned int vector, unsigned int (*rtl_handler)(unsigned int irq, struct pt_regs *regs));
#ifdef CAN_ENABLE_VME_SUPPORT
}
ret=pthread_create(&chip->worker_thread, attrib_p, can_chip_worker_thread, chip);
if(ret<0) chip->worker_thread=NULL;
-
+
return ret;
}