Module Name: src Committed By: thorpej Date: Sat Sep 17 19:32:01 UTC 2022
Modified Files: src/sys/arch/arm/at91: at91emac.c at91emacvar.h Log Message: Eliminate use of IFF_OACTIVE. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/at91/at91emac.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91emacvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/at91/at91emac.c diff -u src/sys/arch/arm/at91/at91emac.c:1.33 src/sys/arch/arm/at91/at91emac.c:1.34 --- src/sys/arch/arm/at91/at91emac.c:1.33 Thu Nov 4 06:57:51 2021 +++ src/sys/arch/arm/at91/at91emac.c Sat Sep 17 19:32:01 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: at91emac.c,v 1.33 2021/11/04 06:57:51 skrll Exp $ */ +/* $NetBSD: at91emac.c,v 1.34 2022/09/17 19:32:01 thorpej Exp $ */ /* * Copyright (c) 2007 Embedtronics Oy @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.33 2021/11/04 06:57:51 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.34 2022/09/17 19:32:01 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -180,7 +180,6 @@ emac_attach(device_t parent, device_t se static int emac_gctx(struct emac_softc *sc) { - struct ifnet * ifp = &sc->sc_ec.ec_if; uint32_t tsr; tsr = EMAC_READ(ETH_TSR); @@ -204,8 +203,8 @@ emac_gctx(struct emac_softc *sc) } // mark we're free - if (ifp->if_flags & IFF_OACTIVE) { - ifp->if_flags &= ~IFF_OACTIVE; + if (sc->tx_busy) { + sc->tx_busy = false; /* Disable transmit-buffer-free interrupt */ /*EMAC_WRITE(ETH_IDR, ETH_ISR_TBRE);*/ } @@ -615,7 +614,7 @@ start: if (emac_gctx(sc) == 0) { /* Enable transmit-buffer-free interrupt */ EMAC_WRITE(ETH_IER, ETH_ISR_TBRE); - ifp->if_flags |= IFF_OACTIVE; + sc->tx_busy = true; ifp->if_timer = 10; splx(s); return; @@ -754,7 +753,7 @@ emac_ifstop(struct ifnet *ifp, int disab /* Down the MII. */ mii_down(&sc->sc_mii); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_flags &= ~IFF_RUNNING; ifp->if_timer = 0; sc->sc_mii.mii_media_status &= ~IFM_ACTIVE; } Index: src/sys/arch/arm/at91/at91emacvar.h diff -u src/sys/arch/arm/at91/at91emacvar.h:1.3 src/sys/arch/arm/at91/at91emacvar.h:1.4 --- src/sys/arch/arm/at91/at91emacvar.h:1.3 Fri Oct 23 06:53:13 2009 +++ src/sys/arch/arm/at91/at91emacvar.h Sat Sep 17 19:32:01 2022 @@ -1,5 +1,5 @@ -/* $Id: at91emacvar.h,v 1.3 2009/10/23 06:53:13 snj Exp $ */ -/* $NetBSD: at91emacvar.h,v 1.3 2009/10/23 06:53:13 snj Exp $ */ +/* $Id: at91emacvar.h,v 1.4 2022/09/17 19:32:01 thorpej Exp $ */ +/* $NetBSD: at91emacvar.h,v 1.4 2022/09/17 19:32:01 thorpej Exp $ */ /*- * Copyright (c) 2007 Embedtronics Oy * All rights reserved @@ -63,6 +63,7 @@ struct emac_softc { int txqi, txqc; struct emac_qmeta txq[TX_QLEN]; callout_t emac_tick_ch; + bool tx_busy; }; #endif /* _AT91EMACVAR_H_ */