Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 43 → Rev 44

/pcivme-3.2/driver/main.c
100,6 → 100,9
/*--- LOCALS ------------------------------------------------------------------------------*/
 
/*--- FUNCTIONS ---------------------------------------------------------------------------*/
 
struct proc_dir_entry *proc;
 
static int my_interrupt(u16 intCSR)
{
int result = NOT_MY_INTERRUPT;
377,7 → 380,9
u16 cntrl;
char *cause = "none";
struct list_head *ptr;
 
PRINTK(KERN_DEBUG "%s : pcivme_read_proc()\n",DEVICE_NAME);
if (*offp != 0) return 0;
pos += sprintf(buf + pos, "\nPCIVME information. Version %d.%d of %s from Klaus Hitschler.\n", VERSION_HI, VERSION_LO, __DATE__);
 
pos += sprintf(buf + pos, " ---------------------\n");
419,11 → 424,16
}
 
pos += sprintf(buf + pos, "\n");
 
if (pos>count) {
buf[count-1]=0;
pos=count;
}
PRINTK(KERN_DEBUG "%s : pcivme_read_proc() end count=%d\n",DEVICE_NAME, pos);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
//*eof = 1;
#endif
 
*offp = pos;
return pos;
}
 
440,7 → 450,7
get_info: pcivme_read_proc, /* function used to read data */
};
#else
struct file_operations proc_fops = {
struct file_operations pcivme_read_proc_fops = {
read: pcivme_read_proc
};
#endif
460,7 → 470,7
DeletePCIConfig(&drv);
}
 
int init_module(void)
int pcivme_module_init(void)
{
PCIConfig *ch;
DEVICE_OBJ *pd;
576,18 → 586,15
}
 
/* register the proc device */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
proc_register_dynamic(&proc_root, &pcimod_proc_entry);
 
return 0;
#else
// create_proc_read_entry is depricated since kernel 3.10
//return create_proc_read_entry(DEVICE_NAME, 0, NULL, pcivme_read_proc, NULL) ? 0 : -ENODEV;
return proc_create_data(DEVICE_NAME, 0, NULL, &pcivme_fops, NULL) ? 0 : -ENODEV;
#endif
//return create_proc_read_entry(DEVICE_NAME, 0, NULL, pcivme_read_proc, NULL) ? 0 : -ENODEV;
proc = proc_create_data(DEVICE_NAME, 0, NULL, &pcivme_read_proc_fops, NULL);
return (proc) ? 0 : -ENODEV;
 
}
 
void cleanup_module(void)
void pcivme_module_exit(void)
{
PCIConfig *ch;
DEVICE_OBJ *pd;
626,3 → 633,6
return;
}
 
module_init(pcivme_module_init);
module_exit(pcivme_module_exit);