From 0aac485864603a9e612c34bd2918dd84479ab699 Mon Sep 17 00:00:00 2001
From: Aaron Campbell <aaron@cvs.openbsd.org>
Date: Sun, 24 Jun 2001 22:38:48 +0000
Subject: Program the address filter in vr_init(). Apparently the rhine cards
 are smart enough to read their own Ethernet address from the EEPROM and
 program their unicast filters automatically, but to support setting the
 Ethernet address with ifconfig on vr(4) cards we need to do this. From
 FreeBSD.

---
 sys/dev/pci/if_vr.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'sys/dev/pci')

diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index f095cb9b426..f4d2ead0bd8 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: if_vr.c,v 1.16 2001/06/24 20:27:02 fgsch Exp $	*/
+/*	$OpenBSD: if_vr.c,v 1.17 2001/06/24 22:38:47 aaron Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -1348,7 +1348,7 @@ vr_init(xsc)
 	struct vr_softc		*sc = xsc;
 	struct ifnet		*ifp = &sc->arpcom.ac_if;
 	struct mii_data		*mii = &sc->sc_mii;
-	int			s;
+	int			s, i;
 
 	s = splimp();
 
@@ -1358,6 +1358,12 @@ vr_init(xsc)
 	vr_stop(sc);
 	vr_reset(sc);
 
+	/*
+	 * Set our station address.
+	 */
+	for (i = 0; i < ETHER_ADDR_LEN; i++)
+		CSR_WRITE_1(sc, VR_PAR0 + i, sc->arpcom.ac_enaddr[i]);
+
 	VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_THRESH);
 	VR_SETBIT(sc, VR_RXCFG, VR_RXTHRESH_STORENFWD);
 
-- 
cgit v1.2.3