Line
Link Here
|
0 |
-- usr/src/nv/nv.c.orig |
0 |
++ usr/src/nv/nv.c |
Lines 15-20
Link Here
|
15 |
#include "nv_compiler.h" |
15 |
#include "nv_compiler.h" |
16 |
#include "os-agp.h" |
16 |
#include "os-agp.h" |
17 |
#include "nv-vm.h" |
17 |
#include "nv-vm.h" |
|
|
18 |
#include <linux/version.h> |
18 |
|
19 |
|
19 |
#ifdef MODULE_ALIAS_CHARDEV_MAJOR |
20 |
#ifdef MODULE_ALIAS_CHARDEV_MAJOR |
20 |
MODULE_ALIAS_CHARDEV_MAJOR(NV_MAJOR_DEVICE_NUMBER); |
21 |
MODULE_ALIAS_CHARDEV_MAJOR(NV_MAJOR_DEVICE_NUMBER); |
Lines 499-508
Link Here
|
499 |
* Set the module owner to ensure that the reference |
500 |
* Set the module owner to ensure that the reference |
500 |
* count reflects accesses to the proc files. |
501 |
* count reflects accesses to the proc files. |
501 |
*/ |
502 |
*/ |
|
|
503 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
502 |
proc_nvidia->owner = THIS_MODULE; |
504 |
proc_nvidia->owner = THIS_MODULE; |
503 |
proc_nvidia_cards->owner = THIS_MODULE; |
505 |
proc_nvidia_cards->owner = THIS_MODULE; |
504 |
proc_nvidia_warnings->owner = THIS_MODULE; |
506 |
proc_nvidia_warnings->owner = THIS_MODULE; |
505 |
|
507 |
|
|
|
508 |
#endif |
506 |
for (j = 0; j < num_nv_devices; j++) |
509 |
for (j = 0; j < num_nv_devices; j++) |
507 |
{ |
510 |
{ |
508 |
nvl = &nv_linux_devices[j]; |
511 |
nvl = &nv_linux_devices[j]; |
Lines 521-527
Link Here
|
521 |
|
524 |
|
522 |
entry->data = nv; |
525 |
entry->data = nv; |
523 |
entry->read_proc = nv_kern_read_cardinfo; |
526 |
entry->read_proc = nv_kern_read_cardinfo; |
|
|
527 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
524 |
entry->owner = THIS_MODULE; |
528 |
entry->owner = THIS_MODULE; |
|
|
529 |
#endif |
525 |
|
530 |
|
526 |
if (nvos_find_agp_capability(dev)) { |
531 |
if (nvos_find_agp_capability(dev)) { |
527 |
/* |
532 |
/* |
Lines 534-540
Link Here
|
534 |
goto failed; |
539 |
goto failed; |
535 |
} |
540 |
} |
536 |
|
541 |
|
|
|
542 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
537 |
entry->owner = THIS_MODULE; |
543 |
entry->owner = THIS_MODULE; |
|
|
544 |
#endif |
538 |
proc_nvidia_agp = entry; |
545 |
proc_nvidia_agp = entry; |
539 |
|
546 |
|
540 |
entry = create_proc_entry("status", flags, proc_nvidia_agp); |
547 |
entry = create_proc_entry("status", flags, proc_nvidia_agp); |
Lines 545-551
Link Here
|
545 |
|
552 |
|
546 |
entry->data = nv; |
553 |
entry->data = nv; |
547 |
entry->read_proc = nv_kern_read_status; |
554 |
entry->read_proc = nv_kern_read_status; |
|
|
555 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
548 |
entry->owner = THIS_MODULE; |
556 |
entry->owner = THIS_MODULE; |
|
|
557 |
#endif |
549 |
|
558 |
|
550 |
entry = create_proc_entry("host-bridge", flags, proc_nvidia_agp); |
559 |
entry = create_proc_entry("host-bridge", flags, proc_nvidia_agp); |
551 |
if (!entry) { |
560 |
if (!entry) { |
Lines 555-562
Link Here
|
555 |
|
564 |
|
556 |
entry->data = NULL; |
565 |
entry->data = NULL; |
557 |
entry->read_proc = nv_kern_read_agpinfo; |
566 |
entry->read_proc = nv_kern_read_agpinfo; |
|
|
567 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
558 |
entry->owner = THIS_MODULE; |
568 |
entry->owner = THIS_MODULE; |
559 |
|
569 |
#endif |
560 |
entry = create_proc_entry("card", flags, proc_nvidia_agp); |
570 |
entry = create_proc_entry("card", flags, proc_nvidia_agp); |
561 |
if (!entry) { |
571 |
if (!entry) { |
562 |
NV_PCI_DEV_PUT(dev); |
572 |
NV_PCI_DEV_PUT(dev); |
Lines 565-571
Link Here
|
565 |
|
575 |
|
566 |
entry->data = nv; |
576 |
entry->data = nv; |
567 |
entry->read_proc = nv_kern_read_agpinfo; |
577 |
entry->read_proc = nv_kern_read_agpinfo; |
|
|
578 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
568 |
entry->owner = THIS_MODULE; |
579 |
entry->owner = THIS_MODULE; |
|
|
580 |
#endif |
569 |
} |
581 |
} |
570 |
|
582 |
|
571 |
NV_PCI_DEV_PUT(dev); |
583 |
NV_PCI_DEV_PUT(dev); |
Lines 576-589
Link Here
|
576 |
goto failed; |
588 |
goto failed; |
577 |
|
589 |
|
578 |
entry->read_proc = nv_kern_read_version; |
590 |
entry->read_proc = nv_kern_read_version; |
|
|
591 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
579 |
entry->owner = THIS_MODULE; |
592 |
entry->owner = THIS_MODULE; |
|
|
593 |
#endif |
580 |
|
594 |
|
581 |
entry = create_proc_entry("registry", flags, proc_nvidia); |
595 |
entry = create_proc_entry("registry", flags, proc_nvidia); |
582 |
if (!entry) |
596 |
if (!entry) |
583 |
goto failed; |
597 |
goto failed; |
584 |
|
598 |
|
585 |
entry->read_proc = nv_kern_read_registry; |
599 |
entry->read_proc = nv_kern_read_registry; |
|
|
600 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
586 |
entry->owner = THIS_MODULE; |
601 |
entry->owner = THIS_MODULE; |
|
|
602 |
#endif |
587 |
|
603 |
|
588 |
return; |
604 |
return; |
589 |
|
605 |
|
Lines 610-616
Link Here
|
610 |
|
626 |
|
611 |
entry->data = (void *)message; |
627 |
entry->data = (void *)message; |
612 |
entry->read_proc = nv_kern_read_warning; |
628 |
entry->read_proc = nv_kern_read_warning; |
|
|
629 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) |
613 |
entry->owner = THIS_MODULE; |
630 |
entry->owner = THIS_MODULE; |
|
|
631 |
#endif |
614 |
#endif |
632 |
#endif |
615 |
} |
633 |
} |
616 |
|
634 |
|