summaryrefslogtreecommitdiffstats
path: root/sys/dev/sn
diff options
context:
space:
mode:
authorhosokawa <hosokawa@FreeBSD.org>2000-01-22 17:24:16 +0000
committerhosokawa <hosokawa@FreeBSD.org>2000-01-22 17:24:16 +0000
commit022a33775582d842aa03f4fc145ab90b8746b89b (patch)
tree813e7cb1238d527988ad0544aaf04d831e3b8e2e /sys/dev/sn
parenteb811cc37f6a34fc0b5e6ca86c626360129daf16 (diff)
downloadFreeBSD-src-022a33775582d842aa03f4fc145ab90b8746b89b.zip
FreeBSD-src-022a33775582d842aa03f4fc145ab90b8746b89b.tar.gz
Don't execute MAC address initialization for non-pccard sn devices.
Diffstat (limited to 'sys/dev/sn')
-rw-r--r--sys/dev/sn/if_sn.c13
-rw-r--r--sys/dev/sn/if_sn_isa.c7
-rw-r--r--sys/dev/sn/if_sn_pccard.c5
-rw-r--r--sys/dev/sn/if_snvar.h1
4 files changed, 19 insertions, 7 deletions
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c
index e03e868..cbc18d9 100644
--- a/sys/dev/sn/if_sn.c
+++ b/sys/dev/sn/if_sn.c
@@ -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,
diff --git a/sys/dev/sn/if_sn_isa.c b/sys/dev/sn/if_sn_isa.c
index 0922d44..1ff9de4 100644
--- a/sys/dev/sn/if_sn_isa.c
+++ b/sys/dev/sn/if_sn_isa.c
@@ -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);
}
diff --git a/sys/dev/sn/if_sn_pccard.c b/sys/dev/sn/if_sn_pccard.c
index 5af8405..018646e 100644
--- a/sys/dev/sn/if_sn_pccard.c
+++ b/sys/dev/sn/if_sn_pccard.c
@@ -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));
}
diff --git a/sys/dev/sn/if_snvar.h b/sys/dev/sn/if_snvar.h
index 105a84d..4d7b1d8 100644
--- a/sys/dev/sn/if_snvar.h
+++ b/sys/dev/sn/if_snvar.h
@@ -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);
OpenPOWER on IntegriCloud