#include "../include/ioctl.h"
#include "../include/write.h"
#include "../include/finish.h"
+#include "../include/fasync.h"
#define EXPORT_SYMTAB
*/
struct mem_addr *mem_head=NULL;
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,0))
-struct file_operations can_fops=
-{
- NULL, /* llseek */
- read: can_read,
- write: can_write,
- NULL, /* readdir */
- poll: can_poll,
- ioctl: can_ioctl,
- NULL, /* mmap */
- open: can_open,
- NULL, /* flush */
- release: can_close,
- NULL, /* fsync */
-};
-#else
struct file_operations can_fops=
{
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0))
owner: THIS_MODULE,
+ #endif
read: can_read,
write: can_write,
poll: can_poll,
ioctl: can_ioctl,
open: can_open,
release: can_close,
+ #ifdef CAN_ENABLE_KERN_FASYNC
+ fasync: can_fasync
+ #endif /*CAN_ENABLE_KERN_FASYNC*/
};
-#endif
EXPORT_SYMBOL(can_fops);
return -ENODEV;
}
+ #ifdef CAN_WITH_RTL
+ canqueue_rtl_initialize();
+ #endif /*CAN_WITH_RTL*/
+
for (i=0; i<hardware_p->nr_boards; i++) {
candev=hardware_p->candevice[i];
if (candev->hwspecops->request_io(candev))
goto reset_error;
}
- spin_lock_init(&hardware_p->rtr_lock);
+ can_spin_lock_init(&hardware_p->rtr_lock);
hardware_p->rtr_queue=NULL;
for (i=0; i<hardware_p->nr_boards; i++) {
for(j=0; j<candev->nr_all_chips; j++) {
if((chip=candev->chip[j])==NULL)
continue;
- if(!chip->chipspecops->irq_handler)
- continue;
-
- if (request_irq(chip->chip_irq,chip->chipspecops->irq_handler,SA_SHIRQ,DEVICE_NAME,chip))
+ if(can_chip_setup_irq(chip)<0) {
+ CANMSG("IRQ setup failed\n");
goto interrupt_error;
- else {
- DEBUGMSG("Registered interrupt %d\n",chip->chip_irq);
- chip->flags |= CHIP_IRQ_SETUP;
}
}
memory_error: ;
canhardware_done(hardware_p);
+ #ifdef CAN_WITH_RTL
+ canqueue_rtl_done();
+ #endif /*CAN_WITH_RTL*/
+
res=unregister_chrdev(major,DEVICE_NAME);
if (res<0)
CANMSG("Error unloading CAN driver, error: %d\n",res);
canhardware_done(hardware_p);
+ #ifdef CAN_WITH_RTL
+ canqueue_rtl_done();
+ #endif /*CAN_WITH_RTL*/
+
if ( can_del_mem_list() )
CANMSG("Error deallocating memory\n");