Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Eliminate use of IFF_OACTIVE.
details: https://anonhg.NetBSD.org/src/rev/8c42771b2632
branches: trunk
changeset: 370118:8c42771b2632
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sat Sep 17 19:23:24 2022 +0000
description:
Eliminate use of IFF_OACTIVE.
diffstat:
sys/arch/amiga/dev/if_qn.c | 15 +++++++--------
sys/arch/arm/at91/at91emac.c | 13 ++++++-------
sys/arch/arm/at91/at91emacvar.h | 5 +++--
3 files changed, 16 insertions(+), 17 deletions(-)
diffs (138 lines):
diff -r e7fe8f418c36 -r 8c42771b2632 sys/arch/amiga/dev/if_qn.c
--- a/sys/arch/amiga/dev/if_qn.c Sat Sep 17 19:20:14 2022 +0000
+++ b/sys/arch/amiga/dev/if_qn.c Sat Sep 17 19:23:24 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_qn.c,v 1.52 2022/09/17 19:20:14 thorpej Exp $ */
+/* $NetBSD: if_qn.c,v 1.53 2022/09/17 19:23:24 thorpej Exp $ */
/*
* Copyright (c) 1995 Mika Kortelainen
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.52 2022/09/17 19:20:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.53 2022/09/17 19:23:24 thorpej Exp $");
#include "qn.h"
#if NQN > 0
@@ -276,7 +276,6 @@
CLLADDR(ifp->if_sadl)[i]);
ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
sc->transmit_pending = false;
qn_flush(sc);
@@ -386,7 +385,10 @@
int timout = 60000;
- if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+ if ((ifp->if_flags & IFF_RUNNING) == 0)
+ return;
+
+ if (sc->transmit_pending)
return;
IF_DEQUEUE(&ifp->if_snd, m);
@@ -426,7 +428,6 @@
sc->transmit_pending = true;
*sc->nic_t_mask = INT_TMT_OK | INT_SIXTEEN_COL;
- ifp->if_flags |= IFF_OACTIVE;
ifp->if_timer = 2;
}
@@ -763,8 +764,6 @@
/* Must return transmission interrupt mask. */
return_tintmask = 1;
} else {
- sc->sc_ethercom.ec_if.if_flags &= ~IFF_OACTIVE;
-
/* Clear watchdog timer. */
sc->sc_ethercom.ec_if.if_timer = 0;
}
@@ -777,7 +776,7 @@
if (rint != 0)
qn_rint(sc, rint);
- if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
+ if (!sc->transmit_pending)
if_schedule_deferred_start(&sc->sc_ethercom.ec_if);
else if (return_tintmask == 1)
*sc->nic_t_mask = tintmask;
diff -r e7fe8f418c36 -r 8c42771b2632 sys/arch/arm/at91/at91emac.c
--- a/sys/arch/arm/at91/at91emac.c Sat Sep 17 19:20:14 2022 +0000
+++ b/sys/arch/arm/at91/at91emac.c Sat Sep 17 19:23:24 2022 +0000
@@ -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 @@
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 @@
}
// 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 @@
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 @@
/* 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;
}
diff -r e7fe8f418c36 -r 8c42771b2632 sys/arch/arm/at91/at91emacvar.h
--- a/sys/arch/arm/at91/at91emacvar.h Sat Sep 17 19:20:14 2022 +0000
+++ b/sys/arch/arm/at91/at91emacvar.h Sat Sep 17 19:23:24 2022 +0000
@@ -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 @@
int txqi, txqc;
struct emac_qmeta txq[TX_QLEN];
callout_t emac_tick_ch;
+ bool tx_busy;
};
#endif /* _AT91EMACVAR_H_ */
Home |
Main Index |
Thread Index |
Old Index