Subject: MCHK exception in wi(4)
To: None <port-macppc@netbsd.org>
From: David Young <dyoung@onthejob.net>
List: port-macppc
Date: 04/14/2002 04:27:17
I am using wi(4) on my 450MHz G4 Powerbook with Airport card.  The kernel
traps to ddb with an MCHK exception during SIOCG80211NWID ioctl's
('ifconfig wi0' uses that ioctl).

Probing deeper, wi_read_record appears to
provoke the MCHK.

I am able to eliminate the MCHK entirely by putting a debug statement
in wi_read_record right after the code that verifies the record length
and type code. I do not even need to enable debugging, and it keeps the
exception from occurring. I suspect a very touchy timing issue.

Can the Airport give an "error" or "busy" indication on the obio bus
that will cause MCHK exceptions?

Here is a pseudo-patch for wi.c that fixes my problem---tomorrow evening
I will try WI_DELAY(1) and WI_DELAY(2) instead of the debug statement.

        len = CSR_READ_2(sc, WI_DATA1);
        if (len > ltv->wi_len)
                return(ENOSPC);
        code = CSR_READ_2(sc, WI_DATA1);
        if (code != ltv->wi_type)
                return(EIO);

+       if (ifp->if_flags & IFF_DEBUG) {
+               printf("%s: wi_read_record: read len, type\n",
+                      sc->sc_dev.dv_xname);
+       }
+
        ltv->wi_len = len;
        ltv->wi_type = code;

Dave

-- 
David Young             OJC Engineering with the Right Brain
dyoung@onthejob.net     Urbana, IL * (217) 278-3933