summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2009-05-13 21:01:10 +0000
committerstas <stas@FreeBSD.org>2009-05-13 21:01:10 +0000
commit6432689ead36e7f45edff2fa2fc770a30b5e5a6e (patch)
tree4eebfb877cc5a499dbcaa634a621a1faf2f8a5b8
parent5f97b44dec532de025fd9b0d8596ebd06bcbc37b (diff)
downloadFreeBSD-src-6432689ead36e7f45edff2fa2fc770a30b5e5a6e.zip
FreeBSD-src-6432689ead36e7f45edff2fa2fc770a30b5e5a6e.tar.gz
- Set MAC address in ateinit, so it can be changed later.
-rw-r--r--sys/arm/at91/if_ate.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c
index 12fbb7a..36400a9 100644
--- a/sys/arm/at91/if_ate.c
+++ b/sys/arm/at91/if_ate.c
@@ -256,7 +256,6 @@ ate_attach(device_t dev)
eaddr[4] = (rnd >> 8) & 0xff;
eaddr[5] = rnd & 0xff;
}
- ate_set_mac(sc, eaddr);
sc->ifp = ifp = if_alloc(IFT_ETHER);
if (mii_phy_probe(dev, &sc->miibus, ate_ifmedia_upd, ate_ifmedia_sts)) {
@@ -841,6 +840,7 @@ ateinit_locked(void *xsc)
struct ate_softc *sc = xsc;
struct ifnet *ifp = sc->ifp;
struct mii_data *mii;
+ uint8_t eaddr[ETHER_ADDR_LEN];
uint32_t reg;
ATE_ASSERT_LOCKED(sc);
@@ -870,17 +870,16 @@ ateinit_locked(void *xsc)
ate_rxfilter(sc);
/*
- * Turn on MACs and interrupt processing.
+ * Set the chip MAC address.
*/
- WR4(sc, ETH_CTL, RD4(sc, ETH_CTL) | ETH_CTL_TE | ETH_CTL_RE);
- WR4(sc, ETH_IER, ETH_ISR_RCOM | ETH_ISR_TCOM | ETH_ISR_RBNA);
+ bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN);
+ ate_set_mac(sc, eaddr);
/*
- * Boot loader fills in MAC address. If that's not the case, then
- * we should set SA1L and SA1H here to the appropriate value. Note:
- * the byte order is big endian, not little endian, so we have some
- * swapping to do. Again, if we need it (which I don't think we do).
+ * Turn on MACs and interrupt processing.
*/
+ WR4(sc, ETH_CTL, RD4(sc, ETH_CTL) | ETH_CTL_TE | ETH_CTL_RE);
+ WR4(sc, ETH_IER, ETH_ISR_RCOM | ETH_ISR_TCOM | ETH_ISR_RBNA);
/* Enable big packets. */
WR4(sc, ETH_CFG, RD4(sc, ETH_CFG) | ETH_CFG_BIG);
OpenPOWER on IntegriCloud