2.4.0-test2: multiple 3c509s problem and dumb fix

pete@redbricks.org.uk
Tue, 27 Jun 2000 20:00:45 +0100


Hi,

I've been booting with the test2 kernel on a P133 box with two
ISA (I think non-PnP) 3c509s in it. It boots up fine, but the 3c509
driver is reporting if_port as BNC when it is 10BaseT (and correctly
reported as that by the normal running kernel, 2.2.12) This appears
to stem from a change in the value of dev->mem_start when first used
by the 3c509 driver, in particular the expression

(dev->mem_start & 0x1f)

whch is used in initialising if_port seems to be incorrect.

Booting with
append = "ether=10,0x300,eth0 ether=5,0x210,eth1"

the 2.2.12 boot message is:

eth0: 3c509 at 0x300 tag 1, 10baseT port, address 00 20 af 2d 54 1a, IRQ 10.
3c509.c:1.16 2/3/98 becker@cesdis.gsfc.nasa.gov
eth1: 3c509 at 0x210 tag 2, 10baseT port, address 00 20 af ac 9e bf, IRQ 5.
3c509.c:1.16 2/3/98 becker@cesdis.gsfc.nasa.gov

and 2.4.0-test2 reports:

eth0: 3c509 at 0x300, BNC port, address 00 20 af 2d 54 1a, IRQ 10.
3c509.c:1.16 (2.2) 2/3/98 becker@cesdis.gsfc.nasa.gov.
eth1: 3c509 at 0x210, BNC port, address 00 20 af ac 9e bf, IRQ 5.
3c509.c:1.16 (2.2) 2/3/98 becker@cesdis.gsfc.nasa.gov.

On trying to use the network under 2.4.0-test2 I can't send any packets
out the 3c509 (tcpdump shows them going out, and also shows me the other
packets on the network, but sniffing on another box shows they're not
really getting out ... ping and arp both fail.)

Having looked in drivers/net/3c509.c I altered the line (around 449)

dev->if_port = (dev->mem_start & 0x1f) ? dev->mem_start & 3 : if_port;

to

dev->if_port = 0; /* force 10BaseT ??? */

and added a line:

printk("%s: 3c509 driver reports mem_start as %06x ", dev->name, dev->mem_start);

so I could see the source of the problem. On rebooting, the network now
works and the driver signon reports:

eth0: 3c509 driver reports mem_start as ffffffff
eth0: 3c509 at 0x300, 10baseT port, address 00 20 af 2d 54 1a, IRQ 10.
3c509.c:1.16 (2.2) 2/3/98 becker@cesdis.gsfc.nasa.gov.
eth1: 3c509 driver reports mem_start as ffffffff
eth1: 3c509 at 0x210, 10baseT port, address 00 20 af ac 9e bf, IRQ 5.
3c509.c:1.16 (2.2) 2/3/98 becker@cesdis.gsfc.nasa.gov.

I'm unversed in the kernel code, but I guess something must have changed
in the way mem_start is handled, making the 'dev->mem_start & 0x1f'
bogus.

Strangely enough I didn't have this problem on a k6-3 box with one
3c509 in it. Also ifconfig on that box doesn't report a shared
memory address, which is also true on the P133 booted under 2.2.12.
But under 2.4.0-test2 (both with and without my primitive fix), ifconfig
outputs:

eth0 Link encap:Ethernet HWaddr 00:20:AF:2D:54:1A
inet addr:195.226.46.6 Bcast:195.226.46.15 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1272 errors:0 dropped:0 overruns:0 frame:0
TX packets:623 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:10 Base address:0x300 Memory:ffffffff-ffffffff

^^^^^^^^^^^^^^^^

which I've never seen before... so I imagine the real patch is higher up
the tree somewhere...

Hope this is some use to someone (and kind of hope it hasn't already
been fixed :-)

- Pete.

--
email: pete@redbricks.org.uk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/