diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-05-07 14:11:46 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-05-07 14:11:46 +0000 |
commit | c7206c2dd294e57a7914f0d667cbf629bcf6152e (patch) | |
tree | ae180d48946413af0117647f8c65f10b39309db6 /sys | |
parent | fcff1b912e56d39c541a16080ce22a8a3a070b9f (diff) |
Program hardware address in dwc_gmac_init() instead of dwc_gmac_attach()
such that "ifconfig dwge0 lladdr 00:11:22:33:44:55" actually works.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/dwc_gmac.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/ic/dwc_gmac.c b/sys/dev/ic/dwc_gmac.c index 7b47cb20415..95001cab214 100644 --- a/sys/dev/ic/dwc_gmac.c +++ b/sys/dev/ic/dwc_gmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwc_gmac.c,v 1.5 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: dwc_gmac.c,v 1.6 2017/05/07 14:11:45 kettenis Exp $ */ /* $NetBSD: dwc_gmac.c,v 1.34 2015/08/21 20:12:29 jmcneill Exp $ */ /*- @@ -173,13 +173,10 @@ dwc_gmac_attach(struct dwc_gmac_softc *sc, uint32_t mii_clk, int phyloc) enaddr[5] = (machi >> 8) & 0x0ff; } - /* - * Init chip and do initial setup - */ if (dwc_gmac_reset(sc) != 0) return; /* not much to cleanup, haven't attached yet */ - dwc_gmac_write_hwaddr(sc, enaddr); - printf("%s: Ethernet address: %s\n", sc->sc_dev.dv_xname, + + printf("%s: address: %s\n", sc->sc_dev.dv_xname, ether_sprintf(enaddr)); memcpy(sc->sc_ac.ac_enaddr, enaddr, ETHER_ADDR_LEN); @@ -760,8 +757,9 @@ dwc_gmac_init(struct ifnet *ifp) 2 << GMAC_BUSMODE_PBL_SHIFT); /* - * Program promiscuous mode and multicast filters + * Program address filters */ + dwc_gmac_write_hwaddr(sc, sc->sc_ac.ac_enaddr); dwc_gmac_iff(sc); /* |