From fee2627c71f884e2ff97309b73d94287a50bfe1e Mon Sep 17 00:00:00 2001 From: phessler Date: Fri, 16 Feb 2024 22:46:07 +0000 Subject: [PATCH] implement qwx_init_task(), which will reset the hardware when it gets confused OK stsp@ --- sys/dev/ic/qwx.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c index fcbae624d16..e2a155d5fba 100644 --- a/sys/dev/ic/qwx.c +++ b/sys/dev/ic/qwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwx.c,v 1.44 2024/02/16 14:18:36 stsp Exp $ */ +/* $OpenBSD: qwx.c,v 1.45 2024/02/16 22:46:07 phessler Exp $ */ /* * Copyright 2023 Stefan Sperling @@ -22283,8 +22283,17 @@ void qwx_init_task(void *arg) { struct qwx_softc *sc = arg; + struct ifnet *ifp = &sc->sc_ic.ic_if; + int s = splnet(); + rw_enter_write(&sc->ioctl_rwl); + + qwx_stop(ifp); + + if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == IFF_UP) + qwx_init(ifp); - printf("%s: %s not implemented\n", sc->sc_dev.dv_xname, __func__); + rw_exit(&sc->ioctl_rwl); + splx(s); } void -- 2.20.1