diff -rau work-orig/kernel/conftest.sh work/kernel/conftest.sh --- work-orig/kernel/conftest.sh 2010-11-13 08:16:22.000000000 +0100 +++ work/kernel/conftest.sh 2010-11-13 10:36:48.000000000 +0100 @@ -1104,6 +1104,60 @@ fi ;; + file_operations) + # + # Determine if the 'file_operations' structure has + # 'ioctl', 'unlocked_ioctl' and 'compat_ioctl' fields. + # + echo "$CONFTEST_PREAMBLE + #include + int conftest_file_operations(void) { + return offsetof(struct file_operations, ioctl); + }" > conftest$$.c + + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 + rm -f conftest$$.c + + if [ -f conftest$$.o ]; then + echo "#define NV_FILE_OPERATIONS_HAS_IOCTL" >> conftest.h + rm -f conftest$$.o + else + echo "#undef NV_FILE_OPERATIONS_HAS_IOCTL" >> conftest.h + fi + + echo "$CONFTEST_PREAMBLE + #include + int conftest_file_operations(void) { + return offsetof(struct file_operations, unlocked_ioctl); + }" > conftest$$.c + + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 + rm -f conftest$$.c + + if [ -f conftest$$.o ]; then + echo "#define NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL" >> conftest.h + rm -f conftest$$.o + else + echo "#undef NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL" >> conftest.h + fi + + echo "$CONFTEST_PREAMBLE + #include + int conftest_file_operations(void) { + return offsetof(struct file_operations, compat_ioctl); + }" > conftest$$.c + + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 + rm -f conftest$$.c + + if [ -f conftest$$.o ]; then + echo "#define NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" >> conftest.h + rm -f conftest$$.o + else + echo "#undef NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" >> conftest.h + fi + ;; + pci_domain_nr) # # Determine if the pci_domain_nr() function is present. diff -rau work-orig/kernel/Makefile.kbuild work/kernel/Makefile.kbuild --- work-orig/kernel/Makefile.kbuild 2010-11-13 08:16:22.000000000 +0100 +++ work/kernel/Makefile.kbuild 2010-11-13 10:32:11.000000000 +0100 @@ -156,6 +156,7 @@ acpi_device_ops \ acpi_device_id \ acquire_console_sem \ + file_operations \ kmem_cache_create \ on_each_cpu \ smp_call_function \ diff -rau work-orig/kernel/Makefile.nvidia work/kernel/Makefile.nvidia --- work-orig/kernel/Makefile.nvidia 2010-08-28 05:28:03.000000000 +0200 +++ work/kernel/Makefile.nvidia 2010-11-13 10:32:11.000000000 +0100 @@ -56,6 +56,7 @@ i2c_adapter \ smp_call_function \ acpi_evaluate_integer \ + file_operations \ proc_dir_entry \ scatterlist diff -rau work-orig/kernel/nv.c work/kernel/nv.c --- work-orig/kernel/nv.c 2010-11-13 08:22:55.000000000 +0100 +++ work/kernel/nv.c 2010-11-13 10:32:11.000000000 +0100 @@ -423,11 +423,13 @@ static struct file_operations nv_fops = { .owner = THIS_MODULE, .poll = nv_kern_poll, +#if defined(NV_FILE_OPERATIONS_HAS_IOCTL) .ioctl = nv_kern_ioctl, -#if defined(HAVE_UNLOCKED_IOCTL) +#endif +#if defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL) .unlocked_ioctl = nv_kern_unlocked_ioctl, #endif -#if defined(NVCPU_X86_64) && defined(HAVE_COMPAT_IOCTL) +#if defined(NVCPU_X86_64) && defined(NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL) .compat_ioctl = nv_kern_compat_ioctl, #endif #ifndef NV_USER_MAP diff -rau work-orig/kernel/nv-linux.h work/kernel/nv-linux.h --- work-orig/kernel/nv-linux.h 2010-08-28 05:28:03.000000000 +0200 +++ work/kernel/nv-linux.h 2010-11-13 10:32:11.000000000 +0100 @@ -112,6 +112,11 @@ #include /* sys_ioctl() (ioctl32) */ #endif +#if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \ + !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL) +#error "struct file_operations compile test likely failed!" +#endif + #if defined(CONFIG_VGA_ARB) #include #endif