-/* $OpenBSD: qwx.c,v 1.62 2024/05/29 07:24:26 stsp Exp $ */
+/* $OpenBSD: qwx.c,v 1.63 2024/06/11 10:06:35 stsp Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
int s = splnet();
rw_enter_write(&sc->ioctl_rwl);
- qwx_stop(ifp);
+ if (ifp->if_flags & IFF_RUNNING)
+ qwx_stop(ifp);
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == IFF_UP)
qwx_init(ifp);
-/* $OpenBSD: if_qwx_pci.c,v 1.19 2024/05/28 09:26:55 stsp Exp $ */
+/* $OpenBSD: if_qwx_pci.c,v 1.20 2024/06/11 10:06:35 stsp Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
#else
printf("%s: fatal firmware error\n",
sc->sc_dev.dv_xname);
- if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags)) {
+ if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags) &&
+ (sc->sc_ic.ic_if.if_flags & (IFF_UP | IFF_RUNNING)) ==
+ (IFF_UP | IFF_RUNNING)) {
/* Try to reset the device. */
set_bit(ATH11K_FLAG_CRASH_FLUSH, sc->sc_flags);
task_add(systq, &sc->init_task);