Don't execute MAC address initialization for non-pccard sn devices.

This commit is contained in:
Tatsumi Hosokawa 2000-01-22 17:24:16 +00:00
parent 2a090474ae
commit 19fdaeba95
4 changed files with 19 additions and 7 deletions

View File

@ -190,13 +190,14 @@ sn_attach(device_t dev)
i = inw(BASE + CONFIG_REG_W);
printf(i & CR_AUI_SELECT ? "AUI" : "UTP");
for (j = 0; j < 3; j++) {
u_short w;
if (sc->pccard_enaddr)
for (j = 0; j < 3; j++) {
u_short w;
w = (u_short)sc->arpcom.ac_enaddr[j * 2] |
(((u_short)sc->arpcom.ac_enaddr[j * 2 + 1]) << 8);
outw(BASE + IAR_ADDR0_REG_W + j * 2, w);
}
w = (u_short)sc->arpcom.ac_enaddr[j * 2] |
(((u_short)sc->arpcom.ac_enaddr[j * 2 + 1]) << 8);
outw(BASE + IAR_ADDR0_REG_W + j * 2, w);
}
/*
* Read the station address from the chip. The MAC address is bank 1,

View File

@ -70,6 +70,13 @@ sn_isa_probe (device_t dev)
static int
sn_isa_attach (device_t dev)
{
#if 0 /* currently not tested */
struct sn_softc *sc = device_get_softc(dev);
#endif
#if 0 /* currently not tested */
sc->pccard_enaddr = 0;
#endif
return (0);
}

View File

@ -72,11 +72,14 @@ sn_pccard_attach(device_t dev)
u_char sum;
u_char ether_addr[ETHER_ADDR_LEN];
sc->pccard_enaddr = 0;
pccard_get_ether(dev, ether_addr);
for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
sum |= ether_addr[i];
if (sum)
if (sum) {
sc->pccard_enaddr = 1;
bcopy(ether_addr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
}
return (sn_attach(dev));
}

View File

@ -47,6 +47,7 @@ struct sn_softc {
int irq_rid;
struct resource *port_res;
int port_rid;
int pccard_enaddr; /* MAC address in pccard CIS tupple */
};
int sn_probe(device_t, int);