3c509 and SB16PNP fix

Richard Schulz (rschulz@Camarilla.RWSystems.net)
Wed, 28 Jan 1998 01:03:56 -0600 (CST)


I happen to be one of those poor soles who has both a 3c509(b) and
an SB16PNP. As a result I have struggled with PnP, modules, etc to get the
two of them working over the course of several kernels.

For those that didn't already know, Creative put a "StereoEnhance"
device on the SB16PNP with a default port at 0x100h. This also happens to
be the first ID/Wake-up port for the 3c509(b). This isn't supposed to be a
problem, because the 3c509 will respond to any port in the range
0x100h-0x1e0h.

Unfortunately, the 0xffh byte the Linux 3c509 driver uses to "ID"
the card happens to be a byte the SB16PNP device will happily return/echo.
The soulution is to change 0xffh to 0xfeh. The SB16PNP will also
echo/return this byte. However, a 3c509 will return 0xffh.

--- linux-2.1.82/drivers/net/3c509.c Mon Nov 3 11:29:30 1997
+++ linux/drivers/net/3c509.c Wed Jan 28 01:02:41 1998
@@ -28,6 +28,7 @@
Alan Cox: Removed the 'Unexpected interrupt' bug.
Michael Meskes: Upgraded to Donald Becker's version 1.07.
Phil Blundell: Media selection support.
+ Richard Schulz: Fix ID conflict with SB16PNP.
*/

static char *version = "3c509.c:1.07 6/15/95 becker@cesdis.gsfc.nasa.gov\n";
@@ -205,7 +206,7 @@
/* Select an open I/O location at 0x1*0 to do contention select. */
for (id_port = 0x100; id_port < 0x200; id_port += 0x10) {
outb(0x00, id_port);
- outb(0xff, id_port);
+ outb(0xfe, id_port);
if (inb(id_port) & 0x01)
break;
}