diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ed/if_ed.c | 38 | ||||
-rw-r--r-- | sys/dev/ed/if_ed_pccard.c | 44 | ||||
-rw-r--r-- | sys/dev/ed/if_edreg.h | 1 |
3 files changed, 44 insertions, 39 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index a7ca8db..f978954 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -902,44 +902,6 @@ ed_probe_3Com(dev, port_rid, flags) } /* - * Probe the Ethernet MAC addrees for PCMCIA Linksys EtherFast 10/100 - * and compatible cards (DL10019C Ethernet controller). - * - * Note: The PAO patches try to use more memory for the card, but that - * seems to fail for my card. A future optimization would add this back - * conditionally. - */ -int -ed_get_Linksys(dev) - device_t dev; -{ - struct ed_softc *sc = device_get_softc(dev); - u_char sum; - int i; - - /* - * Linksys registers(offset from ASIC base) - * - * 0x04-0x09 : Physical Address Register 0-5 (PAR0-PAR5) - * 0x0A : Card ID Register (CIR) - * 0x0B : Check Sum Register (SR) - */ - for (sum = 0, i = 0x04; i < 0x0c; i++) - sum += ed_asic_inb(sc, i); - if (sum != 0xff) - return (0); /* invalid DL10019C */ - for (i = 0; i < ETHER_ADDR_LEN; i++) { - sc->arpcom.ac_enaddr[i] = ed_asic_inb(sc, 0x04 + i); - } - - ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); - sc->isa16bit = 1; - sc->type = ED_TYPE_NE2000; - sc->type_str = "Linksys"; - return (1); -} - -/* * Probe and vendor-specific initialization routine for NE1000/2000 boards */ int diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index e9a6629..14848fa 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -63,6 +63,7 @@ static int ed_pccard_detach(device_t); static void ax88190_geteprom(struct ed_softc *); static int ed_pccard_memwrite(device_t dev, off_t offset, u_char byte); +static int ed_pccard_Linksys(device_t dev); static int linksys; static device_method_t ed_pccard_methods[] = { @@ -187,7 +188,11 @@ ed_pccard_probe(device_t dev) goto end2; end: - linksys = ed_get_Linksys(dev); + if (ED_FLAGS_GETTYPE(flags) & ED_FLAGS_LINKSYS) { + linksys = ed_pccard_Linksys(dev); + } else { + linksys = 0; + } end2: if (error == 0) error = ed_alloc_irq(dev, 0, 0); @@ -301,3 +306,40 @@ ed_pccard_memwrite(device_t dev, off_t offset, u_char byte) return (0); } + +/* + * Probe the Ethernet MAC addrees for PCMCIA Linksys EtherFast 10/100 + * and compatible cards (DL10019C Ethernet controller). + * + * Note: The PAO patches try to use more memory for the card, but that + * seems to fail for my card. A future optimization would add this back + * conditionally. + */ +static int +ed_pccard_Linksys(device_t dev) +{ + struct ed_softc *sc = device_get_softc(dev); + u_char sum; + int i; + + /* + * Linksys registers(offset from ASIC base) + * + * 0x04-0x09 : Physical Address Register 0-5 (PAR0-PAR5) + * 0x0A : Card ID Register (CIR) + * 0x0B : Check Sum Register (SR) + */ + for (sum = 0, i = 0x04; i < 0x0c; i++) + sum += ed_asic_inb(sc, i); + if (sum != 0xff) + return (0); /* invalid DL10019C */ + for (i = 0; i < ETHER_ADDR_LEN; i++) { + sc->arpcom.ac_enaddr[i] = ed_asic_inb(sc, 0x04 + i); + } + + ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); + sc->isa16bit = 1; + sc->type = ED_TYPE_NE2000; + sc->type_str = "Linksys"; + return (1); +} diff --git a/sys/dev/ed/if_edreg.h b/sys/dev/ed/if_edreg.h index c3b38cf..e42ef42d2 100644 --- a/sys/dev/ed/if_edreg.h +++ b/sys/dev/ed/if_edreg.h @@ -610,6 +610,7 @@ struct ed_ring { #define ED_FLAGS_TOSH_ETHER 0x10000 #define ED_FLAGS_GWETHER 0x20000 #define ED_FLAGS_AX88190 0x30000 +#define ED_FLAGS_LINKSYS 0x80000 #define ED_FLAGS_GETTYPE(flg) ((flg) & 0xff0000) |