summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-08-20 14:08:27 +0000
committerriastradh <riastradh@NetBSD.org>2022-08-20 14:08:27 +0000
commit61156ec33b5ace58ba637ecfceb5fe41e37dc771 (patch)
tree9fffdae7895123fddeccf246e7e0127836caebfc /sys/dev
parentdcb3325607403f13b7bf03ee451e4b6aea608e1f (diff)
usbnet(9): Call mii_down once we've finished with mii_tick.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usbnet.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c
index 534de11d392..21b41f1d880 100644
--- a/sys/dev/usb/usbnet.c
+++ b/sys/dev/usb/usbnet.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.105 2022/08/20 14:08:17 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.106 2022/08/20 14:08:27 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.105 2022/08/20 14:08:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.106 2022/08/20 14:08:27 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1082,6 +1082,7 @@ static void
usbnet_stop(struct usbnet *un, struct ifnet *ifp, int disable)
{
struct usbnet_private * const unp = un->un_pri;
+ struct mii_data * const mii = usbnet_mii(un);
USBNETHIST_FUNC(); USBNETHIST_CALLED();
@@ -1125,6 +1126,13 @@ usbnet_stop(struct usbnet *un, struct ifnet *ifp, int disable)
usb_rem_task_wait(un->un_udev, &unp->unp_ticktask, USB_TASKQ_DRIVER,
&unp->unp_core_lock);
+ /*
+ * Now that we have stopped calling mii_tick, bring the MII
+ * state machine down.
+ */
+ if (mii)
+ mii_down(mii);
+
/* Stop transfers. */
usbnet_ep_stop_pipes(un);