Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Fix MII setup and interrupt handling, from Robert...



details:   https://anonhg.NetBSD.org/src/rev/16e6a8d6d8ae
branches:  trunk
changeset: 802297:16e6a8d6d8ae
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Sep 09 07:18:35 2014 +0000

description:
Fix MII setup and interrupt handling, from Robert Swindell.

diffstat:

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

diffs (33 lines):

diff -r 8f56b7b09044 -r 16e6a8d6d8ae sys/dev/ic/dwc_gmac.c
--- a/sys/dev/ic/dwc_gmac.c     Tue Sep 09 06:51:00 2014 +0000
+++ b/sys/dev/ic/dwc_gmac.c     Tue Sep 09 07:18:35 2014 +0000
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.1 2014/09/08 14:24:32 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.2 2014/09/09 07:18:35 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -162,6 +162,7 @@
        /*
         * Attach MII subdevices
         */
+       sc->sc_ec.ec_mii = &sc->sc_mii;
        ifmedia_init(&mii->mii_media, 0, ether_mediachange, ether_mediastatus);
         mii->mii_ifp = ifp;
         mii->mii_readreg = dwc_gmac_miibus_read_reg;
@@ -793,9 +794,11 @@
        uint32_t status, dma_status;
 
        status = bus_space_read_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_INTR);
-       if (status & AWIN_GMAC_MII_IRQ)
+       if (status & AWIN_GMAC_MII_IRQ) {
                (void)bus_space_read_4(sc->sc_bst, sc->sc_bsh,
                    AWIN_GMAC_MII_STATUS);
+               mii_pollstat(&sc->sc_mii);
+       }
 
        dma_status = bus_space_read_4(sc->sc_bst, sc->sc_bsh,
            AWIN_GMAC_DMA_STATUS);



Home | Main Index | Thread Index | Old Index