2003-07-14 14:55:11

by Lars Duesing

[permalink] [raw]
Subject: 2.6.0-test1: include/linux/pci.h inconsistency?

Hi people!
After having problems compiling nforce2-drivers for 2.6.0-test1, I had a
look after include/linux/pci.h.
There is some inconsistency in there:

pci_driver->driver_data is not there any more BUT in pci_dynids it is
referenced:

unsigned int use_driver_data:1; /* pci_driver->driver_data is
used */

attached a dirty patch:


diff -u linux-2.6.0-test1/include/linux/pci.h
linux-2.6.0-test1.new/include/linux/pci.h
--- linux-2.6.0-test1/include/linux/pci.h 2003-07-14
05:34:02.000000000 +0200
+++ linux-2.6.0-test1.new/include/linux/pci.h 2003-07-14
16:48:30.000000000 +0200
@@ -501,7 +501,7 @@
struct pci_dynids {
spinlock_t lock; /* protects list, index */
struct list_head list; /* for IDs added at runtime */
- unsigned int use_driver_data:1; /* pci_driver->driver_data is
used */
+ unsigned int use_driver_data:0; /* pci_driver->driver_data is
NOT there any more */
};


btw: this driver_data is used by the networking part of the
nforce2-driver. If anybody knows a hint, tell me.
Else I will try to wake up someone at nvidia.

Greetings,

Lars Duesing
Munich University Of Applied Sciences, Students' Council


2003-07-14 15:27:43

by Jeff Garzik

[permalink] [raw]
Subject: Re: 2.6.0-test1: include/linux/pci.h inconsistency?

On Mon, Jul 14, 2003 at 05:06:06PM +0200, Lars Duesing wrote:
> btw: this driver_data is used by the networking part of the
> nforce2-driver. If anybody knows a hint, tell me.

If nVidia had a clue, they would have used the portability wrappers
created specifically for this purpose: pci_{get,dev}_drvdata. This
works in 2.4, 2.5, and with the kcompat[1] toolkit, 2.2 also.


> Else I will try to wake up someone at nvidia.

Wake up someone at nVidia and get them to work with open source
net drivers.

I bet it works with amd8111e.c with a little modification, for example.

Jeff



[1] http://sf.net/projects/gkernel/

2003-07-15 13:13:25

by Marcelo Penna Guerra

[permalink] [raw]
Subject: Re: 2.6.0-test1: include/linux/pci.h inconsistency?

Hi Lars,

On Monday 14 July 2003 12:06, Lars Duesing wrote:
> btw: this driver_data is used by the networking part of the
> nforce2-driver. If anybody knows a hint, tell me.
> Else I will try to wake up someone at nvidia.

There are patches for nvnet to work with 2.5.x. I'm using it right now with
2.6.0-test1.

Step by in http://www.nforcershq.com and join us in the linux forum.

Marcelo Penna Guerra

2003-07-15 14:27:23

by Jeff Garzik

[permalink] [raw]
Subject: Re: 2.6.0-test1: include/linux/pci.h inconsistency?

On Tue, Jul 15, 2003 at 10:27:06AM -0300, Marcelo Penna Guerra wrote:
> Hi Lars,
>
> On Monday 14 July 2003 12:06, Lars Duesing wrote:
> > btw: this driver_data is used by the networking part of the
> > nforce2-driver. If anybody knows a hint, tell me.
> > Else I will try to wake up someone at nvidia.
>
> There are patches for nvnet to work with 2.5.x. I'm using it right now with
> 2.6.0-test1.
>
> Step by in http://www.nforcershq.com and join us in the linux forum.


I really would love some person with an nForce NIC to try and use
amd8111e.c or pcnet32.c with their nForce2 NIC, and see what happens.

(you would need to add PCI ids, obviously, and perhaps turn on debugging
to see what happens)

Jeff



2003-07-15 17:11:45

by Lars Duesing

[permalink] [raw]
Subject: Re: 2.6.0-test1: include/linux/pci.h inconsistency?

Hi Jeff,

As I am since now in holidays I could not do this before July, 30. (I
don't have this chipset here, only at work.)
But if someone gets on with it, any information is greatly appreciated.
If nobody gets on, I will try on/after July, 30.

greetings from hot south-east germany :)

Lars


Jeff Garzik <[email protected]> wrote:

>I really would love some person with an nForce NIC to try and use
>amd8111e.c or pcnet32.c with their nForce2 NIC, and see what
>happens.



2003-07-15 23:56:55

by Marcelo Penna Guerra

[permalink] [raw]
Subject: Re: 2.6.0-test1: include/linux/pci.h inconsistency?

Hi Jeff,

I tried adding the PCI ids from the nvnet "source" to amd8111e.c, but it
didn't work. I didn't do any debugging. I'll try with pcnet32 now to see what
happens and do some debugging later.

Thank you for the tip,

Marcelo Penna Guerra

On Tuesday 15 July 2003 11:42, Jeff Garzik wrote:
> On Tue, Jul 15, 2003 at 10:27:06AM -0300, Marcelo Penna Guerra wrote:
> I really would love some person with an nForce NIC to try and use
> amd8111e.c or pcnet32.c with their nForce2 NIC, and see what happens.
>
> (you would need to add PCI ids, obviously, and perhaps turn on debugging
> to see what happens)
>
> Jeff

2003-07-16 01:21:18

by Rahul Karnik

[permalink] [raw]
Subject: Re: 2.6.0-test1: include/linux/pci.h inconsistency?

Jeff Garzik wrote:

> I really would love some person with an nForce NIC to try and use
> amd8111e.c or pcnet32.c with their nForce2 NIC, and see what happens.

Added the IDs (0066 in my case, one of three according to Nvidia
sources) to pci_ids.h and to the drivers. Assuming that is all that is
needed, here's what happened:

amd8111e.c:

PCI: Setting latency timer of device 0000:00:04.0 to 64
eth1: AMD-8111e Driver Version: 3.0.3
eth1: [ Rev 0 ] PCI 10/100BaseT Ethernet 00:00:00:00:00:00

Loaded fine, but note the incorrect MAC address.

pcnet32.c (with debug=7):

PCI: Setting latency timer of device 0000:00:04.0 to 64
pcnet32.c:v1.27b 01.10.2002 [email protected]
PCI: Setting latency timer of device 0000:00:04.0 to 64
pcnet32: io address range already allocated
pcnet32.c:v1.27b 01.10.2002 [email protected]
kobject_register failed for pcnet32 (-17)
Call Trace:
[<c01ab94c>] kobject_register+0x4c/0x60
[<c01d93d4>] bus_add_driver+0x54/0xc0
[<c01d9891>] driver_register+0x31/0x40
[<c01b27ef>] pci_register_driver+0x6f/0xa0
[<fc8b8044>] pcnet32_init_module+0x44/0x9e [pcnet32]
[<c01310ca>] sys_init_module+0x14a/0x2a0
[<c010930b>] syscall_call+0x7/0xb

Any other likely candidates? Is there any way to probe this?

Thanks,
Rahul