linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Hastie <ianh@iahastie.clara.net>
To: linux-kernel@vger.kernel.org
Subject: Re: 2.6.0-test1 + nvidia 4363 driver
Date: Mon, 14 Jul 2003 16:01:30 +0100	[thread overview]
Message-ID: <200307141601.38041.ianh@iahastie.local.net> (raw)
In-Reply-To: <20030714162056.27616c6c.martin.zwickel@technotrend.de>

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

On Monday 14 Jul 2003 15:20, Martin Zwickel wrote:
> Hi there!
>
> Anybody got a working patch for nvidia 4363 to let it work with the
> 2.6.0-test1 kernel?
> The 2.5 nvidia patch doesn't work for the 2.6 kernel.

Just a quick hack to the official unofficial patch!  It's working OK for me 
right now.  You'll need to apply the 2.5 patch then this one afterwards.

-- 
Ian.

[-- Attachment #2: NVIDIA_kernel-1.0-4363-2.5-2.6.diff --]
[-- Type: text/x-diff, Size: 3815 bytes --]

--- NVIDIA_kernel-1.0-4363/nv-linux.h.old	2003-07-14 15:39:35.000000000 +0100
+++ NVIDIA_kernel-1.0-4363/nv-linux.h	2003-07-14 15:47:54.000000000 +0100
@@ -32,6 +32,8 @@
 #  define KERNEL_2_4
 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 #  define KERNEL_2_5
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0)
+#  define KERNEL_2_6
 #else
 #  error This driver does not support development kernels!
 #endif
@@ -46,7 +48,7 @@
 #define __SMP__
 #endif
 
-#if defined (MODVERSIONS) && !defined (KERNEL_2_5)
+#if defined (MODVERSIONS) && !(defined (KERNEL_2_5) || defined(KERNEL_2_6))
 #include <linux/modversions.h>
 #endif
 
@@ -62,7 +64,7 @@
 #include <linux/poll.h>             /* poll_wait                        */
 #include <linux/delay.h>            /* mdelay, udelay                   */
 
-#ifdef KERNEL_2_5
+#if defined(KERNEL_2_5) || defined(KERNEL_2_6)
 #include <linux/sched.h>            /* suser(), capable() replacement   */
 #include <linux/moduleparam.h>      /* module_param()                   */
 #include <linux/smp_lock.h>         /* kernel_locked                    */
@@ -126,7 +128,7 @@
 #define PUT_MODULE_SYMBOL(sym)        inter_module_put((char *) sym)
 #define NV_VMA_PRIVATE(vma)           ((vma)->vm_private_data)
 
-#ifdef KERNEL_2_5
+#if defined(KERNEL_2_5) || defined(KERNEL_2_6)
 #  define NV_DEVICE_NUMBER(_minor)      ((kdev_val(_minor)) & 0x0f)
 #  define NV_IS_CONTROL_DEVICE(_minor)  (((kdev_val(_minor)) & 0xff) == 0xff)
 #  define NV_IS_SUSER()                 capable(CAP_SYS_ADMIN)
@@ -150,7 +152,7 @@
 #  define NV_MODULE_PARAMETER(x)        MODULE_PARM(x, "i")
 #endif
 
-#ifndef KERNEL_2_5
+#if !defined(KERNEL_2_5) && !defined(KERNEL_2_6)
   typedef void irqreturn_t;
 # define IRQ_NONE
 # define IRQ_RETVAL(x)
@@ -163,7 +165,7 @@
   typedef void* devfs_handle_t;
 #endif
 
-#ifdef KERNEL_2_5
+#if defined(KERNEL_2_5) || defined(KERNEL_2_6)
 #define NV_DEVFS_REGISTER(_name, _minor)                            \
 ({                                                                  \
     devfs_handle_t __handle = NULL;                                 \
@@ -193,7 +195,7 @@
  * relevant releases to date use it. This version was backported to 2.4 by
  * RedHat without means to identify the change, hence this hack.
  */
-#ifdef KERNEL_2_5
+#if defined(KERNEL_2_5) || defined(KERNEL_2_6)
 #define NV_REMAP_PAGE_RANGE(a, b...)    remap_page_range(vma, a, ## b)
 #else
 #if defined(REMAP_PAGE_RANGE_5)
--- NVIDIA_kernel-1.0-4363/nv.c.old	2003-07-14 15:51:39.000000000 +0100
+++ NVIDIA_kernel-1.0-4363/nv.c	2003-07-14 15:49:48.000000000 +0100
@@ -720,7 +720,7 @@
 
     nv_printf(NV_DBG_ERRORS, "nvidia: loading %s\n", pNVRM_ID);
 
-#if defined(CONFIG_DEVFS_FS) && !defined(KERNEL_2_5)
+#if defined(CONFIG_DEVFS_FS) && !(defined(KERNEL_2_5) || defined(KERNEL_2_6))
     rc = devfs_register_chrdev(nv_major, "nvidia", &nv_fops);
 #else
     rc = register_chrdev(nv_major, "nvidia", &nv_fops);
@@ -806,7 +806,7 @@
     return 0;
 
  failed:
-#if defined(CONFIG_DEVFS_FS) && !defined(KERNEL_2_5)
+#if defined(CONFIG_DEVFS_FS) && !(defined(KERNEL_2_5) || defined(KERNEL_2_6))
     devfs_unregister_chrdev(nv_major, "nvidia");
 #else
     unregister_chrdev(nv_major, "nvidia");
@@ -856,7 +856,7 @@
         }
     }
 
-#if defined(CONFIG_DEVFS_FS) && !defined(KERNEL_2_5)
+#if defined(CONFIG_DEVFS_FS) && !(defined(KERNEL_2_5) || defined(KERNEL_2_6))
     rc = devfs_unregister_chrdev(nv_major, "nvidia");
 #else
     rc = unregister_chrdev(nv_major, "nvidia");
@@ -1461,7 +1461,7 @@
 
     switch (_IOC_NR(cmd))
     {
-#if !defined(KERNEL_2_5)
+#if !defined(KERNEL_2_5) && !defined(KERNEL_2_6)
         /* debug tool; zap the module use count so we can unload driver */
         /*             even if it is confused */
         case _IOC_NR(NV_IOCTL_MODULE_RESET):

  reply	other threads:[~2003-07-14 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-14 14:20 2.6.0-test1 + nvidia 4363 driver Martin Zwickel
2003-07-14 15:01 ` Ian Hastie [this message]
2003-07-16 17:39 ` Joshua Schmidlkofer
2003-07-16 22:41   ` Fernando Sanchez
2003-07-17  0:31     ` oford
2003-07-17  0:38       ` oford
2003-07-17  0:40         ` Fernando Sanchez
2003-07-17  8:01       ` Martin Schlemmer
2003-07-14 19:34 Anich Gregor
2003-07-14 20:36 ` Ian Hastie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200307141601.38041.ianh@iahastie.local.net \
    --to=ianh@iahastie.clara.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).