From owner-freebsd-mobile Thu Apr 12 15: 0:20 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from alpo.whistle.com (s206m1.whistle.com [207.76.206.1]) by hub.freebsd.org (Postfix) with ESMTP id 829AA37B423 for ; Thu, 12 Apr 2001 15:00:10 -0700 (PDT) (envelope-from ambrisko@whistle.com) Received: from whistle.com (crab.whistle.com [207.76.205.112]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id OAA70060 for ; Thu, 12 Apr 2001 14:59:47 -0700 (PDT) Received: (from ambrisko@localhost) by whistle.com (8.9.3/8.9.1) id OAA51580 for freebsd-mobile@FreeBSD.ORG; Thu, 12 Apr 2001 14:59:14 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200104122159.OAA51580@whistle.com> Subject: Re: Anyone working on Aironet LEAP support? (fwd) To: freebsd-mobile@FreeBSD.ORG Date: Thu, 12 Apr 2001 14:59:14 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Let's try this again with the trailing 'g' on ".org" ----- Forwarded message from Doug Ambrisko ----- ambrisko writes: | Brooks Davis writes: | | On Thu, Apr 12, 2001 at 08:17:44AM -0700, Doug Ambrisko wrote: | | > That strange thing is the DDB wouldn't give me a back track or anything | | > like that. I did single step through DDB after setting a break point | | > in an_ioctl and it did die when doing the media ioctl. | | | | You pretty much need to use a static kernel for the debugger to work | | correctly. | | Hmm I tried that. Okay I figured out the problem. I need to do a little more safety work but attached is a patch that works. The issue is that the status rid keeps getting bigger. You only allocated the "currently" known size and did a read of that. The read was longer and then trashed the stack which then made debuging difficult. For now I changed it to use the areq buffer as most calls use that and then point the status to the areq data structure. This has been confirmed to work as "normal". The read_record needs to be fixed to really only read the size stored in the size field to prevent this type of problem and warn if the size is to small. I'll look at doing that. Doug A. *** if_an.c~ Thu Apr 12 11:26:19 2001 --- if_an.c Thu Apr 12 14:09:51 2001 *************** *** 1982,1993 **** struct ifnet *ifp; struct ifmediareq *imr; { ! struct an_ltv_status status; struct an_softc *sc = ifp->if_softc; ! status.an_len = sizeof(status); ! status.an_type = AN_RID_STATUS; ! if (an_read_record(sc, (struct an_ltv_gen *)&status)) { /* If the status read fails, just lie. */ imr->ifm_active = sc->an_ifmedia.ifm_cur->ifm_media; imr->ifm_status = IFM_AVALID|IFM_ACTIVE; --- 1997,2010 ---- struct ifnet *ifp; struct ifmediareq *imr; { ! struct an_req areq; ! struct an_ltv_status *status = (struct an_ltv_status *)&areq; struct an_softc *sc = ifp->if_softc; ! areq.an_len = sizeof(areq); ! areq.an_type = AN_RID_STATUS; ! ! if (an_read_record(sc, (struct an_ltv_gen *)&areq)) { /* If the status read fails, just lie. */ imr->ifm_active = sc->an_ifmedia.ifm_cur->ifm_media; imr->ifm_status = IFM_AVALID|IFM_ACTIVE; *************** *** 1997,2003 **** imr->ifm_active = IFM_IEEE80211|IFM_AUTO; if (sc->an_config.an_opmode == AN_OPMODE_IBSS_ADHOC) imr->ifm_active |= IFM_IEEE80211_ADHOC; ! switch(status.an_current_tx_rate) { case AN_RATE_1MBPS: imr->ifm_active |= IFM_IEEE80211_DS1; break; --- 2014,2020 ---- imr->ifm_active = IFM_IEEE80211|IFM_AUTO; if (sc->an_config.an_opmode == AN_OPMODE_IBSS_ADHOC) imr->ifm_active |= IFM_IEEE80211_ADHOC; ! switch(status->an_current_tx_rate) { case AN_RATE_1MBPS: imr->ifm_active |= IFM_IEEE80211_DS1; break; *************** *** 2018,2024 **** imr->ifm_status = IFM_AVALID; if (sc->an_config.an_opmode == AN_OPMODE_IBSS_ADHOC) imr->ifm_status |= IFM_ACTIVE; ! else if (status.an_opmode & AN_STATUS_OPMODE_ASSOCIATED) imr->ifm_status |= IFM_ACTIVE; } --- 2035,2041 ---- imr->ifm_status = IFM_AVALID; if (sc->an_config.an_opmode == AN_OPMODE_IBSS_ADHOC) imr->ifm_status |= IFM_ACTIVE; ! else if (status->an_opmode & AN_STATUS_OPMODE_ASSOCIATED) imr->ifm_status |= IFM_ACTIVE; } ----- End of forwarded message from Doug Ambrisko ----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message