Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic In rtw_detach, flag the rtw as "invalid" (RTW_F_I...



details:   https://anonhg.NetBSD.org/src/rev/74dd8e29fbac
branches:  trunk
changeset: 572315:74dd8e29fbac
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Wed Dec 29 19:41:04 2004 +0000

description:
In rtw_detach, flag the rtw as "invalid" (RTW_F_INVALID).  Do not
try to power-down the RF section of an invalid rtw.

The radiotap signal quality field is 16, not 8, bits wide.  Convert
the byte order.

diffstat:

 sys/dev/ic/rtw.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (49 lines):

diff -r 67620a182266 -r 74dd8e29fbac sys/dev/ic/rtw.c
--- a/sys/dev/ic/rtw.c  Wed Dec 29 18:14:12 2004 +0000
+++ b/sys/dev/ic/rtw.c  Wed Dec 29 19:41:04 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtw.c,v 1.35 2004/12/29 01:13:07 dyoung Exp $ */
+/* $NetBSD: rtw.c,v 1.36 2004/12/29 19:41:04 dyoung Exp $ */
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
  *
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.35 2004/12/29 01:13:07 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.36 2004/12/29 19:41:04 dyoung Exp $");
 
 #include "bpfilter.h"
 
@@ -1389,7 +1389,7 @@
                        rr->rr_chan_flags =
                            htole16(ic->ic_bss->ni_chan->ic_flags);
                        rr->rr_antsignal = rssi;
-                       rr->rr_barker_lock = sq;
+                       rr->rr_barker_lock = htole16(sq);
 
                        bpf_mtap2(sc->sc_radiobpf, (caddr_t)rr,
                            sizeof(sc->sc_rxtapu), m);
@@ -2119,9 +2119,11 @@
                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);
@@ -3547,6 +3549,8 @@
 {
        int pri;
 
+       sc->sc_flags |= RTW_F_INVALID;
+
        switch (sc->sc_attach_state) {
        case FINISHED:
                rtw_stop(&sc->sc_if, 1);



Home | Main Index | Thread Index | Old Index