[3c509] Re: [Fwd: Problem: EISA 3com card detection]
Andrew Morton
andrewm@uow.edu.au
Sun, 11 Mar 2001 23:21:50 +1100
> Hi,
> While trying to run Linux kernel on an EISA boards with two
> 3c592 EISA adapters I noticed that one of them is detected by both:
> 3c509 and 3c59x drivers.
This came to me...
We only check the manufacturer ID, not the device ID so yes,
the driver will detect 3c590's as well.
I think that rather than trying to match the "known" 3c509
device IDs, it's safer to just exclude the known 3c59x IDs.
You're the only person in the world who has an EISA
3c59x, let alone a 3c5x9 as well :)
Could you please test this patch?
--- linux-2.4.2-ac18/drivers/net/3c509.c Sun Mar 11 15:12:38 2001
+++ linux-ac/drivers/net/3c509.c Sun Mar 11 23:13:17 2001
@@ -216,6 +216,8 @@
if (EISA_bus) {
static int eisa_addr = 0x1000;
while (eisa_addr < 0x9000) {
+ int device_id;
+
ioaddr = eisa_addr;
eisa_addr += 0x1000;
@@ -223,6 +225,12 @@
if (inw(ioaddr + 0xC80) != 0x6d50)
continue;
+ /* Avoid conflict with 3c590, 3c592, 3c597, etc */
+ device_id = (inb(ioaddr + 0xC82)<<8) + inb(ioaddr + 0xC83);
+ if ((device_id & 0xFF00) == 0x5900) {
+ continue;
+ }
+
/* Change the register set to the configuration window 0. */
outw(SelectWindow | 0, ioaddr + 0xC80 + EL3_CMD);
@@ -460,7 +468,7 @@
{
const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
- printk("%s: 3c509 at %#3.3lx, %s port, address ",
+ printk("%s: 3c5x9 at %#3.3lx, %s port, address ",
dev->name, dev->base_addr, if_names[dev->if_port]);
}