Module Name:    src
Committed By:   riastradh
Date:           Thu Mar  3 05:51:36 UTC 2022

Modified Files:
        src/sys/dev/usb: if_axen.c if_mue.c if_smsc.c

Log Message:
usbnet drivers: No need for usbnet_busy in uno_ioctl.

This callback always runs with the IFNET_LOCK held, and the interface
cannot be detached until the IFNET_LOCK is released, so there is no
need to hang onto a reference count here.  (None of the subnet
drivers touch the IFNET_LOCK except to verify it is held sometimes.)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.76 -r1.77 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_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.78 src/sys/dev/usb/if_axen.c:1.79
--- src/sys/dev/usb/if_axen.c:1.78	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_axen.c	Thu Mar  3 05:51:35 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.78 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.79 2022/03/03 05:51:35 riastradh Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.78 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.79 2022/03/03 05:51:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -558,7 +558,6 @@ axen_uno_ioctl(struct ifnet *ifp, u_long
 	struct usbnet * const un = ifp->if_softc;
 
 	usbnet_lock_core(un);
-	usbnet_busy(un);
 
 	switch (cmd) {
 	case SIOCSIFCAP:
@@ -568,7 +567,6 @@ axen_uno_ioctl(struct ifnet *ifp, u_long
 		break;
 	}
 
-	usbnet_unbusy(un);
 	usbnet_unlock_core(un);
 
 	return 0;

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.68 src/sys/dev/usb/if_mue.c:1.69
--- src/sys/dev/usb/if_mue.c:1.68	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_mue.c	Thu Mar  3 05:51:35 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.68 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.69 2022/03/03 05:51:35 riastradh Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.68 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.69 2022/03/03 05:51:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1269,7 +1269,6 @@ mue_uno_ioctl(struct ifnet *ifp, u_long 
 	struct usbnet * const un = ifp->if_softc;
 
 	usbnet_lock_core(un);
-	usbnet_busy(un);
 
 	switch (cmd) {
 	case SIOCSIFCAP:
@@ -1282,7 +1281,6 @@ mue_uno_ioctl(struct ifnet *ifp, u_long 
 		break;
 	}
 
-	usbnet_unbusy(un);
 	usbnet_unlock_core(un);
 
 	return 0;

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.76 src/sys/dev/usb/if_smsc.c:1.77
--- src/sys/dev/usb/if_smsc.c:1.76	Thu Mar  3 05:51:27 2022
+++ src/sys/dev/usb/if_smsc.c	Thu Mar  3 05:51:35 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.76 2022/03/03 05:51:27 riastradh Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.77 2022/03/03 05:51:35 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.76 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.77 2022/03/03 05:51:35 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -752,7 +752,6 @@ smsc_uno_ioctl(struct ifnet *ifp, u_long
 	struct usbnet * const un = ifp->if_softc;
 
 	usbnet_lock_core(un);
-	usbnet_busy(un);
 
 	switch (cmd) {
 	case SIOCSIFCAP:
@@ -762,7 +761,6 @@ smsc_uno_ioctl(struct ifnet *ifp, u_long
 		break;
 	}
 
-	usbnet_unbusy(un);
 	usbnet_unlock_core(un);
 
 	return 0;

Reply via email to