Module Name:    src
Committed By:   pgoyette
Date:           Wed Jun  1 12:40:03 UTC 2016

Modified Files:
        src/sys/dev/ic: rtl81x9.c

Log Message:
Enable writing to the EPROM before trying to change our MAC address.

>From PR kern/44433


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/ic/rtl81x9.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/rtl81x9.c
diff -u src/sys/dev/ic/rtl81x9.c:1.97 src/sys/dev/ic/rtl81x9.c:1.98
--- src/sys/dev/ic/rtl81x9.c:1.97	Tue Feb  9 08:32:10 2016
+++ src/sys/dev/ic/rtl81x9.c	Wed Jun  1 12:40:03 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl81x9.c,v 1.97 2016/02/09 08:32:10 ozaki-r Exp $	*/
+/*	$NetBSD: rtl81x9.c,v 1.98 2016/06/01 12:40:03 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.97 2016/02/09 08:32:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.98 2016/06/01 12:40:03 pgoyette Exp $");
 
 
 #include <sys/param.h>
@@ -1339,9 +1339,11 @@ rtk_init(struct ifnet *ifp)
 	rtk_stop(ifp, 0);
 
 	/* Init our MAC address */
+	CSR_WRITE_1(sc, RTK_EECMD, RTK_EEMODE_WRITECFG);
 	for (i = 0; i < ETHER_ADDR_LEN; i++) {
 		CSR_WRITE_1(sc, RTK_IDR0 + i, CLLADDR(ifp->if_sadl)[i]);
 	}
+	CSR_WRITE_1(sc, RTK_EECMD, RTK_EEMODE_OFF);
 
 	/* Init the RX buffer pointer register. */
 	bus_dmamap_sync(sc->sc_dmat, sc->recv_dmamap, 0,

Reply via email to