From owner-freebsd-current@FreeBSD.ORG Tue May 20 00:09:17 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D62A71065674; Tue, 20 May 2008 00:09:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 760358FC17; Tue, 20 May 2008 00:09:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 479952C85E; Tue, 20 May 2008 12:09:16 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b1I5Zg3+h1fA; Tue, 20 May 2008 12:09:11 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Tue, 20 May 2008 12:09:11 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 623B41147B; Tue, 20 May 2008 12:09:11 +1200 (NZST) Date: Tue, 20 May 2008 12:09:11 +1200 From: Andrew Thompson To: Pietro Cerutti Message-ID: <20080520000911.GA46085@citylink.fud.org.nz> References: <48317B44.1080909@FreeBSD.org> <20080519131325.GC55052@rink.nu> <48317ED8.3030904@FreeBSD.org> <4831B2D3.3080600@freebsd.org> <20080519231726.GA44361@citylink.fud.org.nz> <483210CC.5070309@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <483210CC.5070309@FreeBSD.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-current Subject: Re: Problem since "wlan" came in: SIOCS80211: Device not configured X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2008 00:09:17 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 20, 2008 at 01:44:12AM +0200, Pietro Cerutti wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > > | > | I have looked at this, I believe the error case in this situation is > | that the vap is running but the taskq to init the parent has not > | completed yet. The scan checks the parents status before auctioning it. > | > | Can you see if this fixes it. I am not sure its the correct approach but > | will at least confirm the fault. > > For which definition of 'this'? ;-) That was a test, you passed. Try this patch. --MGYHOYXEY6WxJCY8 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="vapioctl.diff" Index: ieee80211_ioctl.c =================================================================== RCS file: /home/ncvs/src/sys/net80211/ieee80211_ioctl.c,v retrieving revision 1.60 diff -u -p -r1.60 ieee80211_ioctl.c --- ieee80211_ioctl.c 11 May 2008 23:36:58 -0000 1.60 +++ ieee80211_ioctl.c 19 May 2008 23:03:47 -0000 @@ -3123,7 +3123,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon { struct ieee80211vap *vap; struct ieee80211com *ic; - int error = 0; + int error = 0, n; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ @@ -3164,6 +3164,11 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon ieee80211_stop_locked(vap); } IEEE80211_UNLOCK(ic); + /* Wait for the parent to initialise if the vap has been UP'd */ + n = 50; + while (n-- && (ic->ic_ifp->if_flags & IFF_UP) && + !(ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING)) + pause("vapioctl", hz/10); break; case SIOCADDMULTI: case SIOCDELMULTI: --MGYHOYXEY6WxJCY8--