Thu Mar 3 05:47:43 2022 UTC ()
usbnet: Don't check if_flags for IFF_RUNNING in usbnet_rxeof.

This can only run after we start the pipes in usbnet_init_rx_tx, and
before we abort the pipes in usbnet_stop, during which time if_flags
& IFF_RUNNING is stably set.


(riastradh)
diff -r1.51 -r1.52 src/sys/dev/usb/usbnet.c

cvs diff -r1.51 -r1.52 src/sys/dev/usb/usbnet.c (expand / switch to context diff)
--- src/sys/dev/usb/usbnet.c 2022/03/03 05:47:36 1.51
+++ src/sys/dev/usb/usbnet.c 2022/03/03 05:47:43 1.52
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.51 2022/03/03 05:47:36 riastradh Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.52 2022/03/03 05:47:43 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.51 2022/03/03 05:47:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.52 2022/03/03 05:47:43 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -337,7 +337,6 @@
 	struct usbnet_chain * const c = priv;
 	struct usbnet * const un = c->unc_un;
 	struct usbnet_private * const unp = un->un_pri;
-	struct ifnet * const ifp = usbnet_ifp(un);
 	uint32_t total_len;
 
 	USBNETHIST_CALLARGSN(5, "%jd: enter: status %#jx xfer %#jx",
@@ -347,7 +346,7 @@
 
 	if (unp->unp_dying || unp->unp_stopping ||
 	    status == USBD_INVAL || status == USBD_NOT_STARTED ||
-	    status == USBD_CANCELLED || !(ifp->if_flags & IFF_RUNNING))
+	    status == USBD_CANCELLED)
 		goto out;
 
 	if (status != USBD_NORMAL_COMPLETION) {