diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-02-22 09:16:52 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-02-22 09:16:52 +0000 |
commit | 7969dd25b529992828048bd117ef1fe51464f1e0 (patch) | |
tree | 12081666d6adcf6bd542292c6bf3c20c4b69df56 | |
parent | 3284895e862953ef2bb11ede4f1864cd96bc7415 (diff) |
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); |