Subject: Re: kern/20437: Intel EtherExpress16 should be able to autoconfigure (ix* in config)
To: None <netbsd-bugs@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 02/20/2003 07:52:46
> >Synopsis:       Intel EtherExpress16 should be able to autoconfigure (ix* in config)

> The fix is to change the config to:
> 
> ix*	at isa? port 0x300 irq ?   #EtherExpress/16

You must not put that into any of the standard config files
 
> ... and let the driver find the card.  Simple enough. Here's the diff:

Nope - the code below WILL do nasty things to other systems.

> ! 		/* No io address in config ? then scan for ee16 */
> ! 		num_ports = 9;

At least use (sizeof valid_ioaddr / sizeof valid_ioaddr[0]) not 9.

>              	/* XXX: reset any ee16 at the current iobase */
>              	bus_space_write_1(iot, ioh, IX_ECTRL, IX_RESET_ASIC);
>              	bus_space_write_1(iot, ioh, IX_ECTRL, 0);

You must not do the above, writing to random io addresses can be
disasterous.  

>              	/* now look for ee16. */
>              	board_id = id_var1 = id_var2 = 0;
> !            	for (j = 0; j < 4 ; j++) {
>              		id_var1 = bus_space_read_1(iot, ioh, IX_ID_PORT);
>              		id_var2 = ((id_var1 & 0x03) << 2);
>              		board_id |= (( id_var1 >> 4)  << id_var2);
>          	    }

You might get away with the above without the reset.

IMHO all the devices that are groped for using random IO cycles
should be removed from GENERIC.  This includes all the non-pnp isa
cards.

I've had systems in the part on which it was impossible to run the
manufacters DOS 'config' program to setupt an ethernet card because
the 'grope' sequence locked the system solid.
(Never mind the fact that some of them tried to copy files onto C:)

	David

-- 
David Laight: david@l8s.co.uk