diff options
author | 2005-02-22 09:16:51 +0000 | |
---|---|---|
committer | 2005-02-22 09:16:51 +0000 | |
commit | 862291dbd00a563ddd7ff2fc76c1bfabd96e5377 (patch) | |
tree | 3c47d4aba9f6ffea43e736500baa75c063f2032b | |
parent | sync (diff) | |
download | wireguard-openbsd-862291dbd00a563ddd7ff2fc76c1bfabd96e5377.tar.xz wireguard-openbsd-862291dbd00a563ddd7ff2fc76c1bfabd96e5377.zip |
From part of NetBSD rtw.c rev 1.36:
In rtw_detach, flag the rtw as "invalid" (RTW_F_INVALID). Do not
try to power-down the RF section of an invalid rtw.
-rw-r--r-- | sys/dev/ic/rtw.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index 57e2f15c6d6..7fd4c8ab7e2 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtw.c,v 1.18 2005/02/19 03:33:30 jsg Exp $ */ +/* $OpenBSD: rtw.c,v 1.19 2005/02/22 09:16:51 jsg Exp $ */ /* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */ /*- * Copyright (c) 2004, 2005 David Young. All rights reserved. @@ -2125,9 +2125,11 @@ rtw_disable(struct rtw_softc *sc) return; /* turn off PHY */ - if ((rc = rtw_pwrstate(sc, RTW_OFF)) != 0) + if ((sc->sc_flags & RTW_F_INVALID) == 0 && + (rc = rtw_pwrstate(sc, RTW_OFF)) != 0) { printf("%s: failed to turn off PHY (%d)\n", sc->sc_dev.dv_xname, rc); + } if (sc->sc_disable != NULL) (*sc->sc_disable)(sc); @@ -3928,6 +3930,8 @@ rtw_detach(struct rtw_softc *sc) { int pri; + sc->sc_flags |= RTW_F_INVALID; + switch (sc->sc_attach_state) { case FINISHED: rtw_stop(&sc->sc_if, 1); |