diff options
author | 2005-07-20 22:59:52 +0000 | |
---|---|---|
committer | 2005-07-20 22:59:52 +0000 | |
commit | 66903340aad95ac5313cce4d4921deb34e859df4 (patch) | |
tree | 1194973c96a7fcea8f3ac2c87faf5a24e2e38d33 /sys | |
parent | Always do the netisr_dispatch dance, rather than trying to be smart and use a (diff) | |
download | wireguard-openbsd-66903340aad95ac5313cce4d4921deb34e859df4.tar.xz wireguard-openbsd-66903340aad95ac5313cce4d4921deb34e859df4.zip |
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.c | 11 |
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); |