Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Write MAC address high register before low regist...



details:   https://anonhg.NetBSD.org/src/rev/641ee062d59c
branches:  trunk
changeset: 362638:641ee062d59c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Jun 18 23:50:35 2018 +0000

description:
Write MAC address high register before low register. Apparently the
hardware updates the filter when the low register is written.

diffstat:

 sys/dev/ic/dwc_gmac.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r c585dd075982 -r 641ee062d59c sys/dev/ic/dwc_gmac.c
--- a/sys/dev/ic/dwc_gmac.c     Mon Jun 18 23:40:14 2018 +0000
+++ b/sys/dev/ic/dwc_gmac.c     Mon Jun 18 23:50:35 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.48 2018/06/18 22:57:18 jmcneill Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.49 2018/06/18 23:50:35 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.48 2018/06/18 22:57:18 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.49 2018/06/18 23:50:35 jmcneill Exp $");
 
 /* #define     DWC_GMAC_DEBUG  1 */
 
@@ -317,13 +317,13 @@
 dwc_gmac_write_hwaddr(struct dwc_gmac_softc *sc,
     uint8_t enaddr[ETHER_ADDR_LEN])
 {
-       uint32_t lo, hi;
+       uint32_t hi, lo;
 
+       hi = enaddr[4] | (enaddr[5] << 8);
        lo = enaddr[0] | (enaddr[1] << 8) | (enaddr[2] << 16)
            | (enaddr[3] << 24);
-       hi = enaddr[4] | (enaddr[5] << 8);
+       bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_ADDR0HI, hi);
        bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_ADDR0LO, lo);
-       bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_ADDR0HI, hi);
 }
 
 static int



Home | Main Index | Thread Index | Old Index