Small patch for the latest nvidia nforce 1.0-261 nvnet drivers with kernel 2.5.
--- CUT HERE ---
diff -Naurb nforce-1.0-0261-2.4/nvnet/Makefile nforce-1.0-0261-2.5/nvnet/Makefile
--- nforce-1.0-0261-2.4/nvnet/Makefile 2003-05-06 20:39:38.000000000 +0100
+++ nforce-1.0-0261-2.5/nvnet/Makefile 2003-07-26 22:53:27.000000000 +0100
@@ -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)
+ -DMODULE -I$(SYSINCLUDE) $(ARCHDEFS) \
+ -I$(KERNSRC)/include/asm/mach-default -DKBUILD_MODNAME=nvnet
#
# 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 -Naurb nforce-1.0-0261-2.4/nvnet/nvnet.c nforce-1.0-0261-2.5/nvnet/nvnet.c
--- nforce-1.0-0261-2.4/nvnet/nvnet.c 2003-05-06 20:39:38.000000000 +0100
+++ nforce-1.0-0261-2.5/nvnet/nvnet.c 2003-07-26 23:03:55.000000000 +0100
@@ -26,6 +26,10 @@
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 +757,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 +769,7 @@
irq, dev_instance, regs);
if(!dev)
- return;
+ return IRQ_NONE;
if(priv->hwapi->pfnQueryInterrupt(priv->hwapi->pADCX))
{
@@ -776,6 +780,7 @@
PRINTK(DEBUG_INTR, "nvnet_interrupt - Out\n");
+ return IRQ_HANDLED;
}
static int nvnet_close(struct net_device *dev)
@@ -1245,7 +1250,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 -Naurb nforce-1.0-0261-2.4/nvnet/nvnet.h nforce-1.0-0261-2.5/nvnet/nvnet.h
--- nforce-1.0-0261-2.4/nvnet/nvnet.h 2003-05-06 20:39:38.000000000 +0100
+++ nforce-1.0-0261-2.5/nvnet/nvnet.h 2003-07-26 22:55:49.000000000 +0100
@@ -42,7 +42,6 @@
#include <asm/io.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
-#include <asm/irq.h> /* For NR_IRQS only. */
#include <linux/spinlock.h>
#include <linux/proc_fs.h>
@@ -104,7 +103,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 */
--- CUT HERE ---
Andrew de Quincey wrote:
> Small patch for the latest nvidia nforce 1.0-261 nvnet drivers with kernel 2.5.
<snip>
I sent a similar patch based on your older one to the Gentoo maintainers
a couple of days ago. Did you notice how the module reference counting
(MOD_INC/MOD_DEC) seems to have moved out of their wrapper into the
binary module (possible GPL violation) or removed completely (oops
waiting to happen)? I wonder why.
To be safe, I added the refcounting back where it was in previous
versions. Anyway, thanks for making these patches.
-Rahul
Andrew de Quincey wrote:
> Small patch for the latest nvidia nforce 1.0-261 nvnet drivers with kernel 2.5.
Further nvnet musings (cc:ing Jeff as net driver maintainer and
knowledgeable person).
As I reported here a few days earlier, I tried using the AMD8111 driver
with my NForce2 ethernet a few days ago, with the result that no MAC
address was being assigned to the card. I suspect that the MAC address
is being assigned by the Nvidia driver. Does that make sense?
If so, then using the option in the BIOS to manually set the MAC address
might make the AMD driver work. Unfortunately, I have no idea what I
should set it to without stomping on the MAC address for other devices.
Any ideas? I hate to rely on a binary only module for something as
"simple" as a 10/100 ethernet card.
Thanks,
Rahul
Hi,
>From nvnet.c:
/*
* Mac address is loaded at boot time into h/w reg, but it's loaded
backwards
* we get the address, save it, and reverse it. The saved value is loaded
* back into address at close time.
*/
PRINTK(DEBUG_INIT, "nvnet_init - get mac address\n");
priv->hwapi->pfnGetNodeAddress(priv->hwapi->pADCX, priv-
>original_mac_addr);
But I don't think the only thing missing is the MAC address. You could try to
manually set it in the source itself and see if anything works.
Marcelo Penna Guerra
On Sunday 27 July 2003 01:56, Rahul Karnik wrote:
> Andrew de Quincey wrote:
> > Small patch for the latest nvidia nforce 1.0-261 nvnet drivers with
> > kernel 2.5.
>
> Further nvnet musings (cc:ing Jeff as net driver maintainer and
> knowledgeable person).
>
> As I reported here a few days earlier, I tried using the AMD8111 driver
> with my NForce2 ethernet a few days ago, with the result that no MAC
> address was being assigned to the card. I suspect that the MAC address
> is being assigned by the Nvidia driver. Does that make sense?
>
> If so, then using the option in the BIOS to manually set the MAC address
> might make the AMD driver work. Unfortunately, I have no idea what I
> should set it to without stomping on the MAC address for other devices.
>
> Any ideas? I hate to rely on a binary only module for something as
> "simple" as a 10/100 ethernet card.
>
> Thanks,
> Rahul
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
Marcelo Penna Guerra wrote:
> Hi,
>
>>From nvnet.c:
>
> /*
> * Mac address is loaded at boot time into h/w reg, but it's loaded
> backwards
> * we get the address, save it, and reverse it. The saved value is loaded
> * back into address at close time.
> */
>
> PRINTK(DEBUG_INIT, "nvnet_init - get mac address\n");
> priv->hwapi->pfnGetNodeAddress(priv->hwapi->pADCX, priv-
>
>>original_mac_addr);
Well, I wanted to reload the module with debug on, so I tried:
# modprobe -r nvnet
Segmentation fault
#lsmod
At this point lsmod just hung.
Tried shutting down the computer, and it was stuck during shutdown.
Seems like the refcounting is not really working, or perhaps there are
too many cycles happening. What happens if you do the following with a
module:
try_module_get
MOD_INC_USE_COUNT
MOD_DEC_USE_COUNT
module_put
> But I don't think the only thing missing is the MAC address. You could try to
> manually set it in the source itself and see if anything works.
I'll just add it in BIOS and try with AMD8111. No desire to futz around
with the nvnet source, where half of what is going on is a complete
black box (priv->hwapi, "priv" is definitely *private*).
Thanks,
Rahul
On Saturday 26 July 2003 11:56 pm, Rahul Karnik wrote:
> Andrew de Quincey wrote:
> > Small patch for the latest nvidia nforce 1.0-261 nvnet drivers with
> > kernel 2.5.
>
> Further nvnet musings (cc:ing Jeff as net driver maintainer and
> knowledgeable person).
>
> As I reported here a few days earlier, I tried using the AMD8111 driver
> with my NForce2 ethernet a few days ago, with the result that no MAC
> address was being assigned to the card. I suspect that the MAC address
> is being assigned by the Nvidia driver. Does that make sense?
>
> If so, then using the option in the BIOS to manually set the MAC address
> might make the AMD driver work. Unfortunately, I have no idea what I
> should set it to without stomping on the MAC address for other devices.
my mac address is printed on a little sticker on top of the parallel port
(inside the case) on a leadtek NCR18Gpro(?)
--Brian Jackson
>
> Any ideas? I hate to rely on a binary only module for something as
> "simple" as a 10/100 ethernet card.
>
> Thanks,
> Rahul
--
OpenGFS -- http://opengfs.sourceforge.net
Home -- http://www.brianandsara.net
Did you guys try out the patch for nvnet which can be found here:
http://www.nforcershq.com/forum/viewtopic.php?t=24127&sid=c91eb257d6f67e0346a33b9664cea22f
This one worked flawless for me, dhcpcd (which is MAC dependend here)
worked fine aswell.
Laurens
Laurens wrote:
> Did you guys try out the patch for nvnet which can be found here:
>
> http://www.nforcershq.com/forum/viewtopic.php?t=24127&sid=c91eb257d6f67e0346a33b9664cea22f
>
> This one worked flawless for me, dhcpcd (which is MAC dependend here)
> worked fine aswell.
Just to clarify, the issue is not with the binary Nvidia module, which
works fine when patched. We would just rather not use the binary module,
when all other parts of the Nforce2 chipset (all that I use, anyway) are
supported by mainline kernels.
Thanks,
Rahul
On Sunday 27 July 2003 06:59, Rahul Karnik wrote:
> Marcelo Penna Guerra wrote:
> > Hi,
> >
> >>From nvnet.c:
> >
> > /*
> > * Mac address is loaded at boot time into h/w reg, but it's loaded
> > backwards
> > * we get the address, save it, and reverse it. The saved value is
> > loaded * back into address at close time.
> > */
> >
> > PRINTK(DEBUG_INIT, "nvnet_init - get mac address\n");
> > priv->hwapi->pfnGetNodeAddress(priv->hwapi->pADCX, priv-
> >
> >>original_mac_addr);
>
> Well, I wanted to reload the module with debug on, so I tried:
>
> # modprobe -r nvnet
> Segmentation fault
>
> #lsmod
>
> At this point lsmod just hung.
>
> Tried shutting down the computer, and it was stuck during shutdown.
> Seems like the refcounting is not really working, or perhaps there are
> too many cycles happening. What happens if you do the following with a
> module:
>
> try_module_get
> MOD_INC_USE_COUNT
> MOD_DEC_USE_COUNT
> module_put
>
> > But I don't think the only thing missing is the MAC address. You could
> > try to manually set it in the source itself and see if anything works.
>
> I'll just add it in BIOS and try with AMD8111. No desire to futz around
> with the nvnet source, where half of what is going on is a complete
> black box (priv->hwapi, "priv" is definitely *private*).
>
> Thanks,
> Rahul
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
> Tried shutting down the computer, and it was stuck during shutdown.
> Seems like the refcounting is not really working, or perhaps there are
> too many cycles happening. What happens if you do the following with a
> module:
>
> try_module_get
> MOD_INC_USE_COUNT
> MOD_DEC_USE_COUNT
> module_put
Thanks for pointing this out, they seem to have removed the module reference
counting. But really, I don't care whether it can unload or not. I just need
it to work. I'm not really interested in perfecting a quick hack to a
proprietary driver.
> > But I don't think the only thing missing is the MAC address. You could
> > try to manually set it in the source itself and see if anything works.
>
> I'll just add it in BIOS and try with AMD8111. No desire to futz around
> with the nvnet source, where half of what is going on is a complete
> black box (priv->hwapi, "priv" is definitely *private*).
Ah, so THATS who they licensed it from. I didn't think nividia would go to the
bother of designing their own ethernet hardware. I'll have a poke about and
see if I can find anything out about the MAC address
Andrew de Quincey wrote:
> Ah, so THATS who they licensed it from. I didn't think nividia would go to the
> bother of designing their own ethernet hardware.
Actually, this is not certain, but it is one of the guesses. So far,
Nforce2 = AMD IDE + Intel sound + <unknown> ethernet.
-Rahul
On Sunday 27 July 2003 12:48, Rahul Karnik wrote:
> Andrew de Quincey wrote:
> > Ah, so THATS who they licensed it from. I didn't think nividia would go
> > to the bother of designing their own ethernet hardware.
>
> Actually, this is not certain, but it is one of the guesses. So far,
> Nforce2 = AMD IDE + Intel sound + <unknown> ethernet.
It certainly loads "better" than the VIA drivers; I'd already tried hacking
the PCI IDs into them.
On Sunday 27 July 2003 12:48, Rahul Karnik wrote:
> Andrew de Quincey wrote:
> > Ah, so THATS who they licensed it from. I didn't think nividia would go
> > to the bother of designing their own ethernet hardware.
>
> Actually, this is not certain, but it is one of the guesses. So far,
> Nforce2 = AMD IDE + Intel sound + <unknown> ethernet.
Hmm, the MAC address is in a different place on the nvidia hardware.
I've just dumped the mmapped IO space on mine. The MAC address shows up at
offset 0xa8, but the amd8111e driver is looking for it at 0x160 (there's just
loads of 0x00 there).
Andrew de Quincey wrote:
> I've just dumped the mmapped IO space on mine. The MAC address shows up at
> offset 0xa8, but the amd8111e driver is looking for it at 0x160 (there's just
> loads of 0x00 there).
Also, as Marcelo -- no, not that one, the other one :) -- there is some
funky reversing of the MAC address needed. See the reverse loop in
nvnet.c where the MAC address is being read from the registers.
Thanks,
Rahul
--
Rahul Karnik
[email protected]
Andrew de Quincey wrote:
> I've just dumped the mmapped IO space on mine. The MAC address shows up at
> offset 0xa8, but the amd8111e driver is looking for it at 0x160 (there's just
> loads of 0x00 there).
Hmmmm, with this info I am able to get amd8111e to read the correct MAC
address, but the network connection does not seem to work anyway. How
would we know if this is the right driver anyway?
-Rahul
--
Rahul Karnik
[email protected]
On Sunday 27 July 2003 15:01, Rahul Karnik wrote:
> Andrew de Quincey wrote:
> > I've just dumped the mmapped IO space on mine. The MAC address shows up
> > at offset 0xa8, but the amd8111e driver is looking for it at 0x160
> > (there's just loads of 0x00 there).
>
> Hmmmm, with this info I am able to get amd8111e to read the correct MAC
> address, but the network connection does not seem to work anyway. How
> would we know if this is the right driver anyway?
Hmm, I have a suspicion it is not unfortunately, given the change in location
of the MAC address. Or maybe nvidia have displaced the configuration
registers by some amount?
Andrew de Quincey wrote:
> Hmm, I have a suspicion it is not unfortunately, given the change in location
> of the MAC address. Or maybe nvidia have displaced the configuration
> registers by some amount?
Dunno. Look in the list archives for earlier discussions on the topic.
It seems AMD audio is a clone of Intel audio, which is why Intel audio
works for NForce. Since both audio and ethernet match, it seems unlikely
that Nvidia would license a completely different ethernet chip, but who
knows?
Anyway, I want to put as much info out there as possible for someone to
use as they wish. So here's another tip:
00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet
Controller (rev a1)
00: de 10 66 00 07 00 b0 00 a1 00 00 02 00 00 00 00
10: 00 00 00 e0 01 c4 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 62 14 0c 57
30: 00 00 00 00 44 00 00 00 00 00 00 00 0b 01 01 14
40: 62 14 0c 57 01 00 02 fe 00 01 00 00 04 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Note the first row reads:
00: de 10 66 00 07 00 b0 00 a1 00 00 02 00 00 00 00
Before nvnet loads, the same row reads:
00: de 10 66 00 03 00 b0 00 a1 00 00 02 00 00 00 00
Don't know if that is significant.
-Rahul
--
Rahul Karnik
[email protected]
On Sul, 2003-07-27 at 15:44, Rahul Karnik wrote:
> Dunno. Look in the list archives for earlier discussions on the topic.
> It seems AMD audio is a clone of Intel audio, which is why Intel audio
> works for NForce. Since both audio and ethernet match, it seems unlikely
> that Nvidia would license a completely different ethernet chip, but who
> knows?
AMD's older network component is the AMD PCnet32, which is a very
different chip.
Alan Cox wrote:
> On Sul, 2003-07-27 at 15:44, Rahul Karnik wrote:
>
>>Dunno. Look in the list archives for earlier discussions on the topic.
>>It seems AMD audio is a clone of Intel audio, which is why Intel audio
>>works for NForce. Since both audio and ethernet match, it seems unlikely
s/ethernet/IDE, oops.
>>that Nvidia would license a completely different ethernet chip, but who
>>knows?
>
>
> AMD's older network component is the AMD PCnet32, which is a very
> different chip.
Yes we tried that as well, with no success. See:
http://marc.theaimsgroup.com/?l=linux-kernel&m=105831948827945&w=2
As far as I can tell, NForce is based on AMD8111, at least for IDE and
sound. Unfortunately, ethernet is a no-go so far with amd8111e.
Thanks,
Rahul
--
Rahul Karnik
[email protected]
One can set the MAC address manually via ifconfig.
So, try modprobing amd8111e with the nforce pci ids, then manually
setting the MAC address, and see if that works.
(just make sure the MAC address you make up is unique)
Jeff
I read somewhere that this NIC is supposed to be based on the realtek
fast ethernet NIC (rtl8139), could that be worth looking into?
I did modprobe that driver when I first tested 2.6, it loaded without
errors but nothing happened.
Laurens
No luck here, Jeff ... if the hardware is really based on AMD8111 as it
appears to be (i2c and ide are similar), they surelly changed more registers.
It'll take some time to RE it.
And I don't know how important is this information, but it doesn't get the
iobase addr either and it can't be manually set in ifconfig.
Marcelo Penna Guerra
On Sunday 27 July 2003 22:09, Jeff Garzik wrote:
> One can set the MAC address manually via ifconfig.
>
> So, try modprobing amd8111e with the nforce pci ids, then manually
> setting the MAC address, and see if that works.
>
> (just make sure the MAC address you make up is unique)
>
> Jeff
On Monday 28 July 2003 00:11, Marcelo Penna Guerra wrote:
> No luck here, Jeff ... if the hardware is really based on AMD8111 as it
> appears to be (i2c and ide are similar), they surelly changed more
> registers. It'll take some time to RE it.
Hmm, If they had licensed it, I don't see why they would have changed the
registers that much; they didn't for the other hardware they licensed.
Judging by the size of nvnetlib.o, there isn't really that much to it (which
is nice from an RE point of view)
from various hardware source the NVNET hardware is probably this:
MCP integrated NVIDIA^R MAC + Realtek^R 8201BL PHY
The specs on asus and epox refer to using the nvnet on the some fo
their boards, in the detailed specs you get the above detail
Hope it helps
I could be persuaded to do some testing if required