Only try to detect Linksys PCMCIA cards when we are in a pccard
environment. This fixes the breakage to ISA ethernet cards. Reviewed by: peter
This commit is contained in:
parent
1dea2d58f0
commit
898e18b849
@ -100,8 +100,6 @@ static void ed_setrcr __P((struct ed_softc *));
|
||||
|
||||
static u_long ds_crc __P((u_char *ep));
|
||||
|
||||
static u_short ed_get_Linksys __P((struct ed_softc *));
|
||||
|
||||
/*
|
||||
* Interrupt conversion table for WD/SMC ASIC/83C584
|
||||
*/
|
||||
@ -893,7 +891,7 @@ ed_probe_3Com(dev)
|
||||
* seems to fail for my card. A future optimization would add this back
|
||||
* conditionally.
|
||||
*/
|
||||
static u_short
|
||||
int
|
||||
ed_get_Linksys(sc)
|
||||
struct ed_softc *sc;
|
||||
{
|
||||
@ -914,6 +912,11 @@ ed_get_Linksys(sc)
|
||||
for (i = 0; i < ETHER_ADDR_LEN; i++) {
|
||||
sc->arpcom.ac_enaddr[i] = inb(sc->asic_addr + 0x04 + i);
|
||||
}
|
||||
|
||||
outb(sc->nic_addr + 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);
|
||||
}
|
||||
|
||||
@ -931,7 +934,6 @@ ed_probe_Novell_generic(dev, port_rid, flags)
|
||||
u_char romdata[16], tmp;
|
||||
static char test_pattern[32] = "THIS is A memory TEST pattern";
|
||||
char test_buffer[32];
|
||||
int linksys = 0;
|
||||
int error;
|
||||
|
||||
error = ed_alloc_port(dev, port_rid, ED_NOVELL_IO_PORTS);
|
||||
@ -1006,14 +1008,7 @@ ed_probe_Novell_generic(dev, port_rid, flags)
|
||||
ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern));
|
||||
ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern));
|
||||
|
||||
/* Check for Linksys first. */
|
||||
linksys = ed_get_Linksys(sc);
|
||||
if (linksys) {
|
||||
outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
|
||||
sc->isa16bit = 1;
|
||||
sc->type = ED_TYPE_NE2000;
|
||||
sc->type_str = "Linksys";
|
||||
} else if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
|
||||
if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
|
||||
sc->type = ED_TYPE_NE1000;
|
||||
sc->type_str = "NE1000";
|
||||
} else {
|
||||
@ -1134,11 +1129,9 @@ ed_probe_Novell_generic(dev, port_rid, flags)
|
||||
|
||||
sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE;
|
||||
|
||||
if (!linksys) {
|
||||
ed_pio_readmem(sc, 0, romdata, 16);
|
||||
for (n = 0; n < ETHER_ADDR_LEN; n++)
|
||||
sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
|
||||
}
|
||||
ed_pio_readmem(sc, 0, romdata, 16);
|
||||
for (n = 0; n < ETHER_ADDR_LEN; n++)
|
||||
sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
|
||||
|
||||
#ifdef GWETHER
|
||||
if (sc->arpcom.ac_enaddr[2] == 0x86) {
|
||||
|
@ -150,11 +150,13 @@ ed_pccard_attach(device_t dev)
|
||||
return (error);
|
||||
}
|
||||
|
||||
pccard_get_ether(dev, ether_addr);
|
||||
for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
|
||||
sum |= ether_addr[i];
|
||||
if (sum)
|
||||
bcopy(ether_addr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
|
||||
if (ed_get_Linksys(sc) == 0) {
|
||||
pccard_get_ether(dev, ether_addr);
|
||||
for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
|
||||
sum |= ether_addr[i];
|
||||
if (sum)
|
||||
bcopy(ether_addr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
|
||||
}
|
||||
|
||||
error = ed_attach(sc, device_get_unit(dev), flags);
|
||||
return (error);
|
||||
|
@ -100,6 +100,7 @@ int ed_probe_3Com __P((device_t));
|
||||
int ed_probe_Novell __P((device_t));
|
||||
int ed_probe_Novell_generic __P((device_t, int, int));
|
||||
int ed_probe_HP_pclanp __P((device_t));
|
||||
int ed_get_Linksys __P((struct ed_softc *));
|
||||
|
||||
int ed_attach __P((struct ed_softc *, int, int));
|
||||
void ed_stop __P((struct ed_softc *));
|
||||
|
Loading…
Reference in New Issue
Block a user