Rev 11 | Rev 44 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11 | Rev 43 | ||
---|---|---|---|
Line 114... | Line 114... | ||
114 | } |
114 | } |
115 | 115 | ||
116 | return result; |
116 | return result; |
117 | } |
117 | } |
118 | 118 | ||
119 | static irqreturn_t pcivme_irqhandler(int irq, void *dev_id |
119 | static irqreturn_t pcivme_irqhandler(int irq, void *dev_id ) |
120 | { |
120 | { |
121 | DEVICE_OBJ *pd = (DEVICE_OBJ *)dev_id; |
121 | DEVICE_OBJ *pd = (DEVICE_OBJ *)dev_id; |
122 | 122 | ||
123 | if (pd) |
123 | if (pd) |
124 | { |
124 | { |
Line 365... | Line 365... | ||
365 | } |
365 | } |
366 | 366 | ||
367 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
367 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
368 | static int pcivme_read_proc(char *buf, char **start, off_t offset, int len) |
368 | static int pcivme_read_proc(char *buf, char **start, off_t offset, int len) |
369 | #else |
369 | #else |
370 |
|
370 | //static int pcivme_read_proc(char *buf, char **start, off_t offset, int len, int *eof, void *data) |
- | 371 | static int pcivme_read_proc(struct file *filp,char *buf,size_t count,loff_t *offp ) |
|
371 | #endif |
372 | #endif |
372 | { |
373 | { |
373 | int pos = 0; |
374 | int pos = 0; |
374 | DEVICE_OBJ *pd; |
375 | DEVICE_OBJ *pd; |
375 | PCIConfig *ch; |
376 | PCIConfig *ch; |
Line 418... | Line 419... | ||
418 | } |
419 | } |
419 | 420 | ||
420 | pos += sprintf(buf + pos, "\n"); |
421 | pos += sprintf(buf + pos, "\n"); |
421 | 422 | ||
422 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) |
423 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) |
423 |
|
424 | //*eof = 1; |
424 | #endif |
425 | #endif |
425 | 426 | ||
426 | return pos; |
427 | return pos; |
427 | } |
428 | } |
- | 429 | ||
- | 430 | ||
- | 431 | ||
428 | 432 | ||
429 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
433 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
430 | struct proc_dir_entry pcimod_proc_entry = |
434 | struct proc_dir_entry pcimod_proc_entry = |
431 | { |
435 | { |
432 | namelen: 7, /* len of name */ |
436 | namelen: 7, /* len of name */ |
433 | name: DEVICE_NAME, /* entry name */ |
437 | name: DEVICE_NAME, /* entry name */ |
434 | mode: S_IFREG | S_IRUGO, /* mode */ |
438 | mode: S_IFREG | S_IRUGO, /* mode */ |
435 | nlink: 1, /* nlinks */ |
439 | nlink: 1, /* nlinks */ |
436 | get_info: pcivme_read_proc, /* function used to read data */ |
440 | get_info: pcivme_read_proc, /* function used to read data */ |
- | 441 | }; |
|
- | 442 | #else |
|
- | 443 | struct file_operations proc_fops = { |
|
- | 444 | read: pcivme_read_proc |
|
437 | }; |
445 | }; |
438 | #endif |
446 | #endif |
439 | 447 | ||
440 | static void deleteMyLists(void) |
448 | static void deleteMyLists(void) |
441 | { |
449 | { |
Line 571... | Line 579... | ||
571 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
579 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
572 | proc_register_dynamic(&proc_root, &pcimod_proc_entry); |
580 | proc_register_dynamic(&proc_root, &pcimod_proc_entry); |
573 | 581 | ||
574 | return 0; |
582 | return 0; |
575 | #else |
583 | #else |
- | 584 | // create_proc_read_entry is depricated since kernel 3.10 |
|
576 |
|
585 | //return create_proc_read_entry(DEVICE_NAME, 0, NULL, pcivme_read_proc, NULL) ? 0 : -ENODEV; |
- | 586 | return proc_create_data(DEVICE_NAME, 0, NULL, &pcivme_fops, NULL) ? 0 : -ENODEV; |
|
577 | #endif |
587 | #endif |
578 | } |
588 | } |
579 | 589 | ||
580 | void cleanup_module(void) |
590 | void cleanup_module(void) |
581 | { |
591 | { |