diff --git a/sys/dev/ic/wi.c b/sys/dev/ic/wi.c index 614db341dc36..f7bcb5abb504 100644 --- a/sys/dev/ic/wi.c +++ b/sys/dev/ic/wi.c @@ -1,4 +1,4 @@ -/* $NetBSD: wi.c,v 1.194 2005/01/17 01:48:56 dyoung Exp $ */ +/* $NetBSD: wi.c,v 1.195 2005/02/13 07:33:06 dyoung Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.194 2005/01/17 01:48:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.195 2005/02/13 07:33:06 dyoung Exp $"); #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -320,16 +320,17 @@ wi_attach(struct wi_softc *sc, const u_int8_t *macaddr) return 1; } - if (!macaddr) { - if (wi_read_xrid(sc, WI_RID_MAC_NODE, ic->ic_myaddr, - IEEE80211_ADDR_LEN) != 0 || - IEEE80211_ADDR_EQ(ic->ic_myaddr, empty_macaddr)) { + if (wi_read_xrid(sc, WI_RID_MAC_NODE, ic->ic_myaddr, + IEEE80211_ADDR_LEN) != 0 || + IEEE80211_ADDR_EQ(ic->ic_myaddr, empty_macaddr)) { + if (macaddr != NULL) + memcpy(ic->ic_myaddr, macaddr, IEEE80211_ADDR_LEN); + else { printf(" could not get mac address, attach failed\n"); splx(s); return 1; } - } else - memcpy(ic->ic_myaddr, macaddr, IEEE80211_ADDR_LEN); + } printf(" 802.11 address %s\n", ether_sprintf(ic->ic_myaddr));