Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb usbnet drivers: No need for usbnet_busy during a...
details: https://anonhg.NetBSD.org/src/rev/f86af1b2bc58
branches: trunk
changeset: 362520:f86af1b2bc58
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Mar 03 05:51:44 2022 +0000
description:
usbnet drivers: No need for usbnet_busy during attach.
usbnet_detach cannot run until the attach routine has finished
(unless a driver goes out of its way to tie its shoelaces together
and explicitly call it during the attach routine, which none of them
do), so there is no need to hang onto a reference count that we
release before attach returns.
diffstat:
sys/dev/usb/if_axe.c | 8 ++------
sys/dev/usb/if_axen.c | 10 ++--------
sys/dev/usb/if_smsc.c | 6 ++----
sys/dev/usb/if_udav.c | 6 ++----
sys/dev/usb/if_url.c | 6 ++----
5 files changed, 10 insertions(+), 26 deletions(-)
diffs (201 lines):
diff -r 94989924601f -r f86af1b2bc58 sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c Thu Mar 03 05:51:35 2022 +0000
+++ b/sys/dev/usb/if_axe.c Thu Mar 03 05:51:44 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axe.c,v 1.136 2022/03/03 05:51:27 riastradh Exp $ */
+/* $NetBSD: if_axe.c,v 1.137 2022/03/03 05:51:44 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.136 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.137 2022/03/03 05:51:44 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -930,10 +930,8 @@
/* We need the PHYID for init dance in some cases */
usbnet_lock_core(un);
- usbnet_busy(un);
if (axe_cmd(sc, AXE_CMD_READ_PHYID, 0, 0, &sc->axe_phyaddrs)) {
aprint_error_dev(self, "failed to read phyaddrs\n");
- usbnet_unbusy(un);
usbnet_unlock_core(un);
return;
}
@@ -964,13 +962,11 @@
} else {
if (axe_cmd(sc, AXE_CMD_READ_IPG012, 0, 0, sc->axe_ipgs)) {
aprint_error_dev(self, "failed to read ipg\n");
- usbnet_unbusy(un);
usbnet_unlock_core(un);
return;
}
}
- usbnet_unbusy(un);
usbnet_unlock_core(un);
if (!AXE_IS_172(un))
diff -r 94989924601f -r f86af1b2bc58 sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c Thu Mar 03 05:51:35 2022 +0000
+++ b/sys/dev/usb/if_axen.c Thu Mar 03 05:51:44 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axen.c,v 1.79 2022/03/03 05:51:35 riastradh Exp $ */
+/* $NetBSD: if_axen.c,v 1.80 2022/03/03 05:51:44 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.79 2022/03/03 05:51:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.80 2022/03/03 05:51:44 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -368,7 +368,6 @@
uint8_t val;
usbnet_lock_core(un);
- usbnet_busy(un);
/* XXX: ? */
axen_cmd(un, AXEN_CMD_MAC_READ, 1, AXEN_UNK_05, &val);
@@ -452,7 +451,6 @@
default:
aprint_error_dev(un->un_dev, "unknown uplink bus:0x%02x\n",
val);
- usbnet_unbusy(un);
usbnet_unlock_core(un);
return;
}
@@ -512,7 +510,6 @@
usbnet_mii_writereg(un->un_dev, un->un_phyno, 0x1F, 0x0000);
#endif
- usbnet_unbusy(un);
usbnet_unlock_core(un);
}
@@ -682,14 +679,11 @@
/* Get station address. */
usbnet_lock_core(un);
- usbnet_busy(un);
if (axen_get_eaddr(un, &un->un_eaddr)) {
- usbnet_unbusy(un);
usbnet_unlock_core(un);
printf("EEPROM checksum error\n");
return;
}
- usbnet_unbusy(un);
usbnet_unlock_core(un);
axen_ax88179_init(un);
diff -r 94989924601f -r f86af1b2bc58 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c Thu Mar 03 05:51:35 2022 +0000
+++ b/sys/dev/usb/if_smsc.c Thu Mar 03 05:51:44 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_smsc.c,v 1.77 2022/03/03 05:51:35 riastradh Exp $ */
+/* $NetBSD: if_smsc.c,v 1.78 2022/03/03 05:51:44 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.77 2022/03/03 05:51:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.78 2022/03/03 05:51:44 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -884,7 +884,6 @@
un->un_phyno = 1;
usbnet_lock_core(un);
- usbnet_busy(un);
/*
* Attempt to get the mac address, if an EEPROM is not attached this
* will just return FF:FF:FF:FF:FF:FF, so in such cases we invent a MAC
@@ -912,7 +911,6 @@
un->un_eaddr[0] = (uint8_t)((mac_l) & 0xff);
}
}
- usbnet_unbusy(un);
usbnet_unlock_core(un);
usbnet_attach_ifp(un, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST,
diff -r 94989924601f -r f86af1b2bc58 sys/dev/usb/if_udav.c
--- a/sys/dev/usb/if_udav.c Thu Mar 03 05:51:35 2022 +0000
+++ b/sys/dev/usb/if_udav.c Thu Mar 03 05:51:44 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_udav.c,v 1.83 2022/03/03 05:51:27 riastradh Exp $ */
+/* $NetBSD: if_udav.c,v 1.84 2022/03/03 05:51:44 riastradh Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.83 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.84 2022/03/03 05:51:44 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -240,14 +240,12 @@
usbnet_attach(un, "udavdet");
usbnet_lock_core(un);
- usbnet_busy(un);
// /* reset the adapter */
// udav_reset(un);
/* Get Ethernet Address */
err = udav_csr_read(un, UDAV_PAR, un->un_eaddr, ETHER_ADDR_LEN);
- usbnet_unbusy(un);
usbnet_unlock_core(un);
if (err) {
aprint_error_dev(self, "read MAC address failed\n");
diff -r 94989924601f -r f86af1b2bc58 sys/dev/usb/if_url.c
--- a/sys/dev/usb/if_url.c Thu Mar 03 05:51:35 2022 +0000
+++ b/sys/dev/usb/if_url.c Thu Mar 03 05:51:44 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_url.c,v 1.83 2022/03/03 05:51:27 riastradh Exp $ */
+/* $NetBSD: if_url.c,v 1.84 2022/03/03 05:51:44 riastradh Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.83 2022/03/03 05:51:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.84 2022/03/03 05:51:44 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -244,7 +244,6 @@
usbnet_attach(un, "urldet");
usbnet_lock_core(un);
- usbnet_busy(un);
/* reset the adapter */
url_reset(un);
@@ -252,7 +251,6 @@
/* Get Ethernet Address */
err = url_mem(un, URL_CMD_READMEM, URL_IDR0, (void *)un->un_eaddr,
ETHER_ADDR_LEN);
- usbnet_unbusy(un);
usbnet_unlock_core(un);
if (err) {
aprint_error_dev(self, "read MAC address failed\n");
Home |
Main Index |
Thread Index |
Old Index