summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-07-20 22:59:53 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-07-20 22:59:53 +0000
commit6161877a44213fd664a2a7657072914ad5f29573 (patch)
treec4c255535195d8db3fe0544b8f2bef959e80d59a /sys
parent9b5537f456108c0392f867001892a52da1723465 (diff)
fix setting the MAC address in rl_init() so that "ifconfig lladdr" works
as expected. From form@ via mpech@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/rtl81x9.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index 9f34fc6fbcb..8c13f0285d1 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.42 2005/07/02 23:20:05 brad Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.43 2005/07/20 22:59:52 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -961,7 +961,7 @@ void rl_init(xsc)
{
struct rl_softc *sc = xsc;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
- int s, i;
+ int s;
u_int32_t rxcfg = 0;
s = splimp();
@@ -972,9 +972,10 @@ void rl_init(xsc)
rl_stop(sc);
/* Init our MAC address */
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, RL_IDR0 + i, sc->sc_arpcom.ac_enaddr[i]);
- }
+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG);
+ CSR_WRITE_4(sc, RL_IDR0, *(u_int32_t *)(&sc->sc_arpcom.ac_enaddr[0]));
+ CSR_WRITE_4(sc, RL_IDR4, *(u_int32_t *)(&sc->sc_arpcom.ac_enaddr[4]));
+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
/* Init the RX buffer pointer register. */
CSR_WRITE_4(sc, RL_RXADDR, sc->rl_cdata.rl_rx_buf_pa);