eth*_dev changes in 2.3.27+ breaks multiple ISA NICs

cbuchana@navtechinc.com
Mon, 3 Jan 2000 06:14:43 +0200


I have two ISA NE2000 clones in one of my boxes. When the eth*_dev
structures and related code were changed in 2.3.27, it broke my ability
to use more than one cards. The change in question is that the structure
in Space.c now contains a bunch of "eth%d" entries, which are then later
changed to eth0, eth1, etc. via dev_alloc_name. There seems to be two
problems with this. The first is that when eth_setup parses the command
line, it has no device entry in the net_device structure to assign the
IRQ and address to because the name hasn't been assigned yet. So in this
case my ether=10,0x240,eth1 is ignored because there is no eth1 entry
in the list at this time. When it is finally created, the init function
for that device is immediately called, which fails because that entry in
the struct list has an address of NOPROBE, and not the one I assigned.
Simply put, it's a cart before the horse problem.

The second thing I came across when looking at this is that the compiler
(at least mine) is being too smart for its own good. When optimising
Space.c, it seems to be deciding that all those "eth%d" should really
be one string, instead of eight separate ones. So when dev_alloc_name
creates a new name for the device, it happily writes it in the
memory already allocated for the device name, which happens to be
the same space allocated for all the other device names, which is bad.

-- 
Chris Buchanan
Intermediate Software Developer
Navtech Inc., Waterloo, Ontario, Canada

- 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/