Module Name:    src
Committed By:   thorpej
Date:           Sat Aug 20 16:47:01 UTC 2022

Modified Files:
        src/sys/arch/amiga/dev: if_es.c

Log Message:
esstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/amiga/dev/if_es.c

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/amiga/dev/if_es.c
diff -u src/sys/arch/amiga/dev/if_es.c:1.66 src/sys/arch/amiga/dev/if_es.c:1.67
--- src/sys/arch/amiga/dev/if_es.c:1.66	Tue May 24 20:50:18 2022
+++ src/sys/arch/amiga/dev/if_es.c	Sat Aug 20 16:47:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_es.c,v 1.66 2022/05/24 20:50:18 andvar Exp $ */
+/*	$NetBSD: if_es.c,v 1.67 2022/08/20 16:47:01 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Michael L. Hitch
@@ -33,7 +33,7 @@
 #include "opt_ns.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.66 2022/05/24 20:50:18 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.67 2022/08/20 16:47:01 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -780,7 +780,7 @@ esstart(struct ifnet *ifp)
 		 * Sneak a peek at the next packet to get the length
 		 * and see if the SMC 91C90 can accept it.
 		 */
-		m = sc->sc_ethercom.ec_if.if_snd.ifq_head;
+		IF_POLL(&sc->sc_ethercom.ec_if.if_snd, m);
 		if (!m)
 			break;
 #ifdef ESDEBUG
@@ -815,7 +815,6 @@ esstart(struct ifnet *ifp)
 			smc->b2.bsr = BSR_BANK2;
 		}
 #endif
-		IF_DEQUEUE(&sc->sc_ethercom.ec_if.if_snd, m);
 		smc->b2.ptr = PTR_AUTOINCR;
 		(void) smc->b2.mmucr;
 		data = (volatile u_short *)&smc->b2.data;
@@ -912,10 +911,10 @@ esstart(struct ifnet *ifp)
 			    start_ptr, end_ptr, SWAP(smc->b2.ptr));
 			--sc->sc_smcbusy;
 #endif
-			IF_PREPEND(&sc->sc_ethercom.ec_if.if_snd, m0);
 			esinit(sc);	/* It's really hosed - reset */
 			return;
 		}
+		IF_DEQUEUE(&sc->sc_ethercom.ec_if.if_snd, m);
 		smc->b2.mmucr = MMUCR_ENQ_TX;
 		if (smc->b2.pnr != active_pnr)
 			printf("%s: esstart - PNR changed %x->%x\n",

Reply via email to