Module Name:    src
Committed By:   riastradh
Date:           Thu Mar  3 05:55:38 UTC 2022

Modified Files:
        src/sys/dev/usb: if_axe.c if_mos.c if_smsc.c

Log Message:
usbnet drivers: Omit redundant device reset via *_uno_stop on init.

Only those drivers where *_uno_stop is just *_reset, and *_uno_init
immediately calls *_reset afterward, are affected.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/if_mos.c
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/usb/if_smsc.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/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.147 src/sys/dev/usb/if_axe.c:1.148
--- src/sys/dev/usb/if_axe.c:1.147	Thu Mar  3 05:55:29 2022
+++ src/sys/dev/usb/if_axe.c	Thu Mar  3 05:55:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.147 2022/03/03 05:55:29 riastradh Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.148 2022/03/03 05:55:38 riastradh Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.147 2022/03/03 05:55:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.148 2022/03/03 05:55:38 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1211,9 +1211,6 @@ axe_uno_init(struct ifnet *ifp)
 	struct axe_softc * const sc = usbnet_softc(un);
 	int rxmode;
 
-	/* Cancel pending I/O */
-	axe_uno_stop(ifp, 1);
-
 	/* Reset the ethernet interface. */
 	axe_reset(un);
 

Index: src/sys/dev/usb/if_mos.c
diff -u src/sys/dev/usb/if_mos.c:1.19 src/sys/dev/usb/if_mos.c:1.20
--- src/sys/dev/usb/if_mos.c:1.19	Thu Mar  3 05:55:29 2022
+++ src/sys/dev/usb/if_mos.c	Thu Mar  3 05:55:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mos.c,v 1.19 2022/03/03 05:55:29 riastradh Exp $	*/
+/*	$NetBSD: if_mos.c,v 1.20 2022/03/03 05:55:38 riastradh Exp $	*/
 /*	$OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $	*/
 
 /*
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.19 2022/03/03 05:55:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.20 2022/03/03 05:55:38 riastradh Exp $");
 
 #include <sys/param.h>
 
@@ -732,9 +732,6 @@ mos_uno_init(struct ifnet *ifp)
 	u_int8_t		rxmode;
 	unsigned char		ipgs[2];
 
-	/* Cancel pending I/O */
-	mos_uno_stop(ifp, 1);
-
 	/* Reset the ethernet interface. */
 	mos_reset(un);
 

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.89 src/sys/dev/usb/if_smsc.c:1.90
--- src/sys/dev/usb/if_smsc.c:1.89	Thu Mar  3 05:55:29 2022
+++ src/sys/dev/usb/if_smsc.c	Thu Mar  3 05:55:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.89 2022/03/03 05:55:29 riastradh Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.90 2022/03/03 05:55:38 riastradh Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.89 2022/03/03 05:55:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.90 2022/03/03 05:55:38 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -555,9 +555,6 @@ smsc_uno_init(struct ifnet *ifp)
 	struct usbnet * const un = ifp->if_softc;
 	struct smsc_softc * const sc = usbnet_softc(un);
 
-	/* Cancel pending I/O */
-	smsc_uno_stop(ifp, 1);
-
 	/* Reset the ethernet interface. */
 	smsc_reset(sc);
 

Reply via email to