Subject: Proxim wi(4) not quite working, crashes
To: None <current-users@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: current-users
Date: 10/13/2005 21:05:28
I got a Proxim 802.11b card, and it seems to almost work, or perhaps
it does work if you don't provoke it.  I was able to wiconfig -D with
it and find two IBSS nodes.

wi1 at pcmcia0 function 0: <PROXIM, Harmony 802.11b/LAN PC CARD, >
wi1: 802.11 address 00:60:b3:67:39:f1
wi1: using RF:PRISM2 MAC:HFA3841 CARD:HWB3163 rev.A
wi1: Intersil Firmware: Primary (0.3.0), Station (0.7.6)
wi1: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wi1: command timed out, cmd=0x121, arg=0xfce2
wi1: command timed out, cmd=0x2, arg=0x0
wi1: wi_cmd: busy bit won't clear.
wi1: init failed
wi1: interface not running
wi1: wi_cmd: busy bit won't clear.

I had removed it and inserted it after this, and then just did
ifconfig up and a scan which seemed to work.  I then ejected the card
(but my memory is a bit hazy), and I saw the telltale dumping-to-swap
disk activity light followed by a reboot.

(gdb) bt
#0  0x1fe60000 in ?? ()
#1  0xc03e6c63 in cpu_reboot (howto=260, bootstr=0x0)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/arch/i386/i386/machdep.c:755
#2  0xc0348a44 in panic (
    fmt=0xc06907a0 "pccbb_pcmcia_delay: called in interrupt context")
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/kern/subr_prf.c:244
#3  0xc0481dd9 in pccbb_pcmcia_delay (ph=0xc11b58ec, timo=300, 
    wmesg=0xc0633aa6 "pccwr1")
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/pci/pccbb.c:2411
#4  0xc0481fc6 in pccbb_pcmcia_socket_disable (pch=0xc11b58ec)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/pci/pccbb.c:2553
#5  0xc04fb578 in pcmcia_socket_disable (dev=0xc11b4600)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/pcmcia/pcmcia.c:478
#6  0xc050b871 in wi_pcmcia_disable (sc=0xc11ee000)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/pcmcia/if_wi_pcmcia.c:306
#7  0xc01d5346 in wi_stop (ifp=0xc11ee038, disable=1)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/ic/wi.c:1065
#8  0xc01d445b in wi_shutdown (sc=0xc11ee000)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/ic/wi.c:676
#9  0xc033950a in doshutdownhooks ()
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/kern/kern_subr.c:516
#10 0xc03e6b76 in cpu_reboot (howto=256, bootstr=0x0)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/arch/i386/i386/machdep.c:758
#11 0xc0348a44 in panic (
    fmt=0xc069f780 "kernel %sassertion \"%s\" failed: file \"%s\", line %d")
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/kern/subr_prf.c:244
#12 0xc055b5f4 in __assert (t=0xc060e955 "diagnostic ", 
    f=0xc06544e0 "/usr/home/gdt/SINEW-current/netbsd/src/sys/dev/ic/wi.c", 
    l=1868, e=0xc0613363 "sc->sc_txcmds > 0")
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/lib/libkern/__assert.c:45
#13 0xc01d69ff in wi_cmd_intr (sc=0xc11ee000)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/ic/wi.c:1882
#14 0xc01d4695 in wi_intr (arg=0xc11ee000)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/ic/wi.c:736
#15 0xc0480e80 in pccbbintr_function (sc=0xc11b5800)
    at /usr/home/gdt/SINEW-current/netbsd/src/sys/dev/pci/pccbb.c:1159
#16 0xc01021d1 in Xintr_legacy11 ()

at frame 13, sc->sc_txcmds is 0.  (The panic at frame 2 is due to to
shutdown being at interrupt level due to the panic at frame 11, so
that's not really the problem.)

I don't know the wi code, but it would seem nice to ignore gracefully
a stray interrupt if that's doable, just returning from wi_cmd_intr in
that case.