Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Apply deferred if_start to more drivers...



details:   https://anonhg.NetBSD.org/src/rev/1af399620b29
branches:  trunk
changeset: 351627:1af399620b29
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Feb 20 08:25:57 2017 +0000

description:
Apply deferred if_start to more drivers...

diffstat:

 sys/arch/arm/at91/at91emac.c          |  12 ++++++------
 sys/arch/arm/gemini/if_gmc.c          |   7 ++++---
 sys/arch/arm/rockchip/rockchip_emac.c |   7 ++++---
 sys/arch/mips/ralink/ralink_eth.c     |   7 ++++---
 sys/arch/mips/sibyte/dev/sbmac.c      |   7 ++++---
 5 files changed, 22 insertions(+), 18 deletions(-)

diffs (179 lines):

diff -r 1c129aac7ba5 -r 1af399620b29 sys/arch/arm/at91/at91emac.c
--- a/sys/arch/arm/at91/at91emac.c      Mon Feb 20 07:43:29 2017 +0000
+++ b/sys/arch/arm/at91/at91emac.c      Mon Feb 20 08:25:57 2017 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91emac.c,v 1.18 2016/12/15 09:28:02 ozaki-r Exp $        */
-/*     $NetBSD: at91emac.c,v 1.18 2016/12/15 09:28:02 ozaki-r Exp $    */
+/*     $Id: at91emac.c,v 1.19 2017/02/20 08:25:57 ozaki-r Exp $        */
+/*     $NetBSD: at91emac.c,v 1.19 2017/02/20 08:25:57 ozaki-r Exp $    */
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.18 2016/12/15 09:28:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.19 2017/02/20 08:25:57 ozaki-r Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -312,9 +312,8 @@
 //             bus_dmamap_sync(sc->sc_dmat, sc->rbqpage_dmamap, 0, sc->rbqlen, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
        }
 
-       if (emac_gctx(sc) > 0 && IFQ_IS_EMPTY(&ifp->if_snd) == 0) {
-               emac_ifstart(ifp);
-       } 
+       if (emac_gctx(sc) > 0)
+               if_schedule_deferred_start(ifp);
 #if 0 // reloop
        irq = EMAC_READ(IntStsC);
        if ((irq & (IntSts_RxSQ|IntSts_ECI)) != 0)
@@ -496,6 +495,7 @@
        ifp->if_softc = sc;
         IFQ_SET_READY(&ifp->if_snd);
         if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
         ether_ifattach(ifp, (sc)->sc_enaddr);
 }
 
diff -r 1c129aac7ba5 -r 1af399620b29 sys/arch/arm/gemini/if_gmc.c
--- a/sys/arch/arm/gemini/if_gmc.c      Mon Feb 20 07:43:29 2017 +0000
+++ b/sys/arch/arm/gemini/if_gmc.c      Mon Feb 20 08:25:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gmc.c,v 1.6 2013/06/11 16:57:05 msaitoh Exp $ */
+/* $NetBSD: if_gmc.c,v 1.7 2017/02/20 08:25:57 ozaki-r Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -47,7 +47,7 @@
 #include <net/if_ether.h>
 #include <net/if_dl.h>
 
-__KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.6 2013/06/11 16:57:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.7 2017/02/20 08:25:57 ozaki-r Exp $");
 
 #define        MAX_TXSEG       32
 
@@ -711,7 +711,7 @@
        bus_space_write_4(sc->sc_iot, sc->sc_ioh, GMAC_INT4_STATUS, status);
 
        if (do_ifstart)
-               gmc_ifstart(&sc->sc_if);
+               if_schedule_deferred_start(&sc->sc_if);
 
        aprint_debug_dev(sc->sc_dev, "gmac_intr: sts=%#x/%#x/%#x/%#x/%#x\n",
            bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT0_STATUS),
@@ -795,6 +795,7 @@
           gmc_mediastatus);
 
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, eaddrs[gma->gma_port]);
        mii_attach(sc->sc_dev, &sc->sc_mii, 0xffffffff,
            gma->gma_phy, MII_OFFSET_ANY, 0);
diff -r 1c129aac7ba5 -r 1af399620b29 sys/arch/arm/rockchip/rockchip_emac.c
--- a/sys/arch/arm/rockchip/rockchip_emac.c     Mon Feb 20 07:43:29 2017 +0000
+++ b/sys/arch/arm/rockchip/rockchip_emac.c     Mon Feb 20 08:25:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_emac.c,v 1.16 2016/12/15 09:28:02 ozaki-r Exp $ */
+/* $NetBSD: rockchip_emac.c,v 1.17 2017/02/20 08:25:57 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_rkemac.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rockchip_emac.c,v 1.16 2016/12/15 09:28:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_emac.c,v 1.17 2017/02/20 08:25:57 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -275,6 +275,7 @@
        ifmedia_set(&mii->mii_media, IFM_ETHER|IFM_AUTO);
 
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, enaddr);
 
        EMAC_WRITE(sc, EMAC_ENABLE_REG, RKEMAC_ENABLE_INTR);
@@ -401,7 +402,7 @@
                ifp->if_oerrors++;
 
        if (stat & (EMAC_STAT_TXINT|EMAC_STAT_RXINT))
-               rkemac_start(ifp);
+               if_schedule_deferred_start(ifp);
 
        return 1;
 }
diff -r 1c129aac7ba5 -r 1af399620b29 sys/arch/mips/ralink/ralink_eth.c
--- a/sys/arch/mips/ralink/ralink_eth.c Mon Feb 20 07:43:29 2017 +0000
+++ b/sys/arch/mips/ralink/ralink_eth.c Mon Feb 20 08:25:57 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_eth.c,v 1.12 2016/12/15 09:28:03 ozaki-r Exp $  */
+/*     $NetBSD: ralink_eth.c,v 1.13 2017/02/20 08:25:57 ozaki-r Exp $  */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ralink_eth.c -- Ralink Ethernet Driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.12 2016/12/15 09:28:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.13 2017/02/20 08:25:57 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -524,6 +524,7 @@
 
        /* Attach the interface. */
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, enaddr);
 
        /* init our mii ticker */
@@ -1446,7 +1447,7 @@
        }
 
        /* Try to get more packets going. */
-       ralink_eth_start(&sc->sc_ethercom.ec_if);
+       if_schedule_deferred_start(&sc->sc_ethercom.ec_if);
 
        return 1;
 }
diff -r 1c129aac7ba5 -r 1af399620b29 sys/arch/mips/sibyte/dev/sbmac.c
--- a/sys/arch/mips/sibyte/dev/sbmac.c  Mon Feb 20 07:43:29 2017 +0000
+++ b/sys/arch/mips/sibyte/dev/sbmac.c  Mon Feb 20 08:25:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbmac.c,v 1.47 2016/12/15 09:28:03 ozaki-r Exp $ */
+/* $NetBSD: sbmac.c,v 1.48 2017/02/20 08:25:57 ozaki-r Exp $ */
 
 /*
  * Copyright 2000, 2001, 2004
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.47 2016/12/15 09:28:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.48 2017/02/20 08:25:57 ozaki-r Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -1754,7 +1754,7 @@
        }
 
        /* try to get more packets going */
-       sbmac_start(ifp);
+       if_schedule_deferred_start(ifp);
 }
 
 
@@ -2353,5 +2353,6 @@
         * Call MI attach routines.
         */
        if_attach(ifp);
+       if_deferred_start_init(ifp, NULL);
        ether_ifattach(ifp, eaddr);
 }



Home | Main Index | Thread Index | Old Index