Module Name: src
Committed By: martin
Date: Tue Dec 9 19:17:50 UTC 2014
Modified Files:
src/sys/dev/ic [netbsd-7]: dwc_gmac.c
Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #300):
sys/dev/ic/dwc_gmac.c: revision 1.29
if we dont have a mac address, make one up
To generate a diff of this commit:
cvs rdiff -u -r1.24.2.3 -r1.24.2.4 src/sys/dev/ic/dwc_gmac.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.24.2.3 src/sys/dev/ic/dwc_gmac.c:1.24.2.4
--- src/sys/dev/ic/dwc_gmac.c:1.24.2.3 Tue Nov 25 07:58:07 2014
+++ src/sys/dev/ic/dwc_gmac.c Tue Dec 9 19:17:50 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.24.2.3 2014/11/25 07:58:07 snj Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.24.2.4 2014/12/09 19:17:50 martin Exp $ */
/*-
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.24.2.3 2014/11/25 07:58:07 snj Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.24.2.4 2014/12/09 19:17:50 martin Exp $");
/* #define DWC_GMAC_DEBUG 1 */
@@ -53,6 +53,7 @@ __KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v
#include <sys/intr.h>
#include <sys/systm.h>
#include <sys/sockio.h>
+#include <sys/cprng.h>
#include <net/if.h>
#include <net/if_ether.h>
@@ -162,9 +163,9 @@ dwc_gmac_attach(struct dwc_gmac_softc *s
AWIN_GMAC_MAC_ADDR0HI);
if (maclo == 0xffffffff && (machi & 0xffff) == 0xffff) {
- aprint_error_dev(sc->sc_dev,
- "couldn't read MAC address\n");
- return;
+ /* fake MAC address */
+ maclo = 0x00f2 | (cprng_strong32() << 16);
+ machi = cprng_strong32();
}
enaddr[0] = maclo & 0x0ff;