# nvnet or 3com in 2.6 kernels

## CaribbeanKnight

i've been playing around with the latest 2.6 test kernels, and it's all been working except for my network connection... i have an nforce2 mb with integrated nvidia & 3com network interfaces... but neither one of them is supported by the kernel, so i have to emerge nforce-net to get networking support for my nvidia interface... but this is where it goes wrong, emerge nforce-net stops and gives an error about files it can't find... so i think this module isn't compatible with the 2.6 kernels.... anything else i can do to get networking running?

----------

## whit

 *CaribbeanKnight wrote:*   

> i've been playing around with the latest 2.6 test kernels, and it's all been working except for my network connection... i have an nforce2 mb with integrated nvidia & 3com network interfaces

 

I was just asking the same question over at the the nV News Forums. What you need to do is apply the following patch:

It can also be downloaded from a link here: 

http://www.nvnews.net/vbulletin/showthread.php?s=&postid=180155#post180155 .

```

diff -Naur nvnet/Makefile nvnet-2.5/Makefile

--- nvnet/Makefile      2003-05-06 16:39:38.000000000 -0300

+++ nvnet-2.5/Makefile  2003-07-10 23:51:29.000000000 -0300

@@ -21,7 +21,7 @@

 #

 # Target

 #

-TARGET = $(MODULE_NAME).o

+TARGET = $(MODULE_NAME).ko

 #

 # Networking library

@@ -76,7 +76,8 @@

 CFLAGS = -c -Wall -DLINUX -DMODULE -DEXPORT_SYMTAB -D__KERNEL__ -O \

        -Wstrict-prototypes -DCONFIG_PM  -fno-strict-aliasing \

         -mpreferred-stack-boundary=2 -march=i686 $(ALIGN) \

-        -DMODULE -I$(SYSINCLUDE) $(ARCHDEFS)

+       -DKBUILD_BASENAME=nvnet -DKBUILD_MODNAME=nvnet -fno-common \

+        -DMODULE -I$(SYSINCLUDE) -I$(SYSINCLUDE)/asm/mach-default $(ARCHDEFS)

 #

 # Kernel version

@@ -103,10 +104,17 @@

 all: $(TARGET)

-$(TARGET): $(SRC) $(NVNETLIB) $(MCPINCLUDE)

+nvnet.o: $(SRC)

        $(CC) $(CFLAGS) $(SRC)

-       ld -r -o $(TEMP) $(OBJ) $(NVNETLIB)

-       $(OBJCOPY) --strip-symbol="gcc2_compiled." $(TEMP)

+

+nvnet.mod.c: nvnet.o

+       $(KERNSRC)/scripts/modpost nvnet.o

+

+nvnet.mod.o: nvnet.mod.c

+       $(CC) $(CFLAGS) nvnet.mod.c

+

+$(TARGET): nvnet.o nvnet.mod.o $(NVNETLIB)

+       ld -r -o $(TEMP) nvnet.o nvnet.mod.o $(NVNETLIB)

        cp $(TEMP) $(TARGET)

        rm $(TEMP)

 

@@ -139,4 +147,4 @@

 # Delete generated files

 #

 clean:

-       rm -f $(TARGET)

+       rm -f $(TARGET) nvnet.o *.mod.c *.mod.o

diff -Naur nvnet/nvnet.c nvnet-2.5/nvnet.c

--- nvnet/nvnet.c       2003-05-06 16:39:38.000000000 -0300

+++ nvnet-2.5/nvnet.c   2003-07-15 20:26:52.000000000 -0300

@@ -26,6 +26,9 @@

 char *common_hdO_version_string = HDO_VERSION_STRING;

 char *common_hdP_version_string = HDP_VERSION_STRING;

 

+// fix for common symbol exported by nvnetlib.o

+char* aPhyAddrAndId[256];

+

 /*

  * Driver information

  */ 

@@ -753,7 +756,7 @@

 }

  

  

-static void nvnet_interrupt(int irq, void *dev_instance, struct pt_regs *regs)

+static irqreturn_t nvnet_interrupt(int irq, void *dev_instance, struct pt_regs *regs)

 {

     struct net_device *dev;

     struct nvnet_private *priv;

@@ -765,7 +768,7 @@

                  irq, dev_instance, regs);

 

     if(!dev)

-        return;

+        return IRQ_NONE;

 

     if(priv->hwapi->pfnQueryInterrupt(priv->hwapi->pADCX))

     {   

@@ -776,6 +779,8 @@

 

     PRINTK(DEBUG_INTR, "nvnet_interrupt -  Out\n");

 

+    return IRQ_HANDLED;

+

 }

  

 static int nvnet_close(struct net_device *dev)

@@ -1127,6 +1132,7 @@

     priv->pdev     = pdev;

 

     SET_MODULE_OWNER(dev);

+    SET_NETDEV_DEV(dev, &pdev->dev);

     priv->regs = (char *)memptr;

     pci_set_master(pdev);

 

@@ -1245,7 +1251,7 @@

  */

 static void __devexit nvnet_remove(struct pci_dev *pdev)

 {

-    struct net_device *dev = pdev->driver_data;

+    struct net_device *dev = pci_get_drvdata (pdev);

     struct nvnet_private *priv = dev->priv;

     int i;

 

diff -Naur nvnet/nvnet.h nvnet-2.5/nvnet.h

--- nvnet/nvnet.h       2003-05-06 16:39:38.000000000 -0300

+++ nvnet-2.5/nvnet.h   2003-06-14 12:36:47.000000000 -0300

@@ -104,7 +104,7 @@

 static struct net_device_stats *nvnet_stats(struct net_device *dev);

 static int nvnet_config(struct net_device *dev, struct ifmap *map); 

 static int nvnet_init(struct net_device *dev);

-static void nvnet_interrupt(int irq, void *dev_instance, struct pt_regs *regs);

+static irqreturn_t nvnet_interrupt(int irq, void *dev_instance, struct pt_regs *regs);

 static void nvnet_multicast(struct net_device *dev);

 

 typedef enum {fail, pass} result; /* Boolean pass/fail results */

```

Haven't worked out how to do this with the e-build. but if you download NVIDIA_nforce-1.0-0261.tar.gz from nvidia.com, untar it ("tar zxpvf ..."), go to the nforce/nvnet directory, run "patch -p1 < /path/to/patch", then run "make" in that directory, then "make install", then "insmod nvnet.ko", you should be set - worked for me for the onboard nV NIC. I also have a 3com in the system, but it's a card, not on the motherboard, and standard 3com support works for that.

----------

## Tiny_Guy

It doesn't work for me.  I am using the latest test kernel.  2.6.0-test4-mm2.  It says unknown symbol.  The alternative driver for my nforce2 board is the 3com.  I heard the nvidia card is better, so I would like to try it out.   Unfortunately, because of that error, I can't load the driver on 2.6 kernels.  Please help me out.  Maybe the patch needs to be updated for later test kernels.

----------

## Tiny_Guy

This is the error I get with inserting the module.  I did use the patch.  Does it make a difference that I'm using 2.6.0-test4-mm2 instead of an earlier version?  Please help me solve this.

 *Quote:*   

> 
> 
> FATAL: Error inserting nvnet (/lib/modules/2.6.0-test4-mm2/kernel/drivers/net/nvnet.o): Unknown symbol in module, or unknown parameter (see dmesg)
> 
> 

 

----------

## phill_20x6

Patch worked great here!   :Laughing: 

EpoX 8RDA+ nforce2 mobo

----------

## Tiny_Guy

maybe i can try it with mm4.

----------

## Tiny_Guy

Here is some more output if it will be any help.

 *Quote:*   

> 
> 
> nvnet: no version magic, tainting kernel.
> 
> nvnet: module license 'NVIDIA' taints kernel.
> ...

 

It's from dmesg.  I would like to get this working in 2.6

----------

## Tiny_Guy

It works fine for me.  What I did was manually patch and compile it.

----------

