From owner-freebsd-mobile@FreeBSD.ORG Fri Sep 26 22:17:01 2008 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A61C106568B for ; Fri, 26 Sep 2008 22:17:01 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.238]) by mx1.freebsd.org (Postfix) with ESMTP id 382208FC14 for ; Fri, 26 Sep 2008 22:17:01 +0000 (UTC) (envelope-from onemda@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1068861rvf.43 for ; Fri, 26 Sep 2008 15:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=5HtGossa0PQ7nbSLu4xTlBmD7+v8Y/nWsu8TvycBQnI=; b=R3PB5KoLuqPiVVZTUvKvB/y8eBu+MQYKQrxq2KFKnItVW5R95m7Hx+EU4Z75dbZvMw yUrG0piV6avoiGev0P2Za8uhHPJFrAUB4ITuU9hkXnT4HYCEFdmAyoP7+rFayc7Kf+Y6 tavLWljyvFd9kiEue9n70XpFemcm0x9Bhy2Kc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=fbVaO7fq1CT/IWwfiEsS6mDyIrMtGMBI+F77r2jmt9AjuD3v4NNDVp/ifGNvdbGVBB pmAJ6Y5ipZH9U23FKCWVc5dN7UoPTsbueCP/TiycWZjTYBQGvOhXLEa0YvIDtiXkZYBw axgLeLpIoURqs3RsXH3MTngwrTMclDHgTLsbI= Received: by 10.140.132.8 with SMTP id f8mr1021866rvd.198.1222467420561; Fri, 26 Sep 2008 15:17:00 -0700 (PDT) Received: by 10.141.189.15 with HTTP; Fri, 26 Sep 2008 15:17:00 -0700 (PDT) Message-ID: <3a142e750809261517r13d317e4ie533741ba74bc4d8@mail.gmail.com> Date: Sat, 27 Sep 2008 00:17:00 +0200 From: "Paul B. Mahol" To: "Sam Leffler" In-Reply-To: <48DD21FB.6060300@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080922132500.GA25677@zibbi.meraka.csir.co.za> <3a142e750809250741j7b9003e4q539618d1c9407def@mail.gmail.com> <20080925161338.GA69284@zibbi.meraka.csir.co.za> <3a142e750809251159p3f5f3bam11243b3f144859c2@mail.gmail.com> <20080926055522.GA13842@zibbi.meraka.csir.co.za> <3a142e750809261012r73e33b43w5996fa2f61dabd82@mail.gmail.com> <48DD21FB.6060300@freebsd.org> Cc: freebsd-mobile@freebsd.org Subject: Re: setting bssid in adhoc mode X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2008 22:17:01 -0000 On 9/26/08, Sam Leffler wrote: > Paul B. Mahol wrote: >> On 9/26/08, John Hay wrote: >> >>> On Thu, Sep 25, 2008 at 08:59:37PM +0200, Paul B. Mahol wrote: >>> >>>> On 9/25/08, John Hay wrote: >>>> >>>>> On Thu, Sep 25, 2008 at 04:41:30PM +0200, Paul B. Mahol wrote: >>>>> >>>>>> On 9/22/08, John Hay wrote: >>>>>> >>>>>>> Hi >>>>>>> >>>>>>> I'm trying out the new ath/wlan stuff in current. Should one still be >>>>>>> able to set the bssid in adhoc mode? We normally lock the bssid in >>>>>>> an adhoc network because of problems that the network split and does >>>>>>> not merge, if you do not do it. >>>>>>> >>>>>>> What I have done is this: >>>>>>> >>>>>>> # ifconfig wlan0 create wlandev ath0 wlanmode adhoc >>>>>>> # ifconfig wlan0 ssid ptamesh up >>>>>>> >>>>>>> Up to here works well. It will scan and if it finds another node with >>>>>>> the >>>>>>> same ssid, it will "lock" on that channel and use the correct bssid. >>>>>>> >>>>>>> If it does not find another node with the same ssid, it will start it >>>>>>> own thing on channel 10. But it looks like one cannot set the bssid. >>>>>>> >>>>>>> # ifconfig wlan0 bssid 02:07:ca:fe:ba:be >>>>>>> ifconfig: 02:07:ca:fe:ba:be: bad value >>>>>>> >>>>>> I had similar experience with STA mode, instead I use ap (ap is alias >>>>>> for bssid, at least it works in STA mode) >>>>>> I never bothered is this bug in manual page, ifconfig or in something >>>>>> else >>>>>> ... >>>>>> >>>>> Ah, thanks yes, "ifconfig wlan0 ap 02:07:ca:fe:ba:be" works just fine. >>>>> Just do not try to unset it with "ifconfig wlan0 ap -". That is an >>>>> alias for "panic now" :-) >>>>> >>>> Well, on my system it doesnt panic here. >>>> So more info to debug "your" panic is required ... >>>> >>> I'll have to see if I can reproduce it. >>> >> >> I managed to reproduce panic on recent CURRENT, with two cards in adhoc >> mode. >> rum0 (usb2) & ndis0 (personal hacked version without usb code) >> >> I typed "ifconfig wlan0 ap -" several times. >> >> >> bt: >> >> db:0:kdb.enter.unknown> run lockinfo >> db:1:lockinfo> show locks >> db:1:locks> show alllocks >> Process 1471 (ifconfig) thread 0xc4028690 (100048) >> Process 477 (syslogd) thread 0xc402b8c0 (100058) >> db:1:alllocks> show lockedvnods >> Locked vnodes >> db:0:kdb.enter.unknown> show pcpu >> cpuid = 1 >> curthread = 0xc4028690: pid 1471 "ifconfig" >> curpcb = 0xe64e1d90 >> fpcurthread = none >> idlethread = 0xc3cb1d20: pid 10 "idle: cpu1" >> APIC ID = 1 >> currentldt = 0x50 >> spin locks held: >> db:0:kdb.enter.unknown> bt >> Tracing pid 1471 tid 100048 td 0xc4028690 >> ieee80211_ht_adjust_channel(c46a8000,0,2,2,80000002,...) at >> ieee80211_ht_adjust_channel+0x30 >> adhoc_pick_bss(c4053000,c4113800,c0a1ebc3,23a,c3dd0108,...) at >> adhoc_pick_bss+0x100 >> ieee80211_check_scan(c4113800,2,7fffffff,0,0,...) at >> ieee80211_check_scan+0x20d >> ieee80211_check_scan_current(c4113800,4,c0a1fb47,6c,c4113800,...) at >> ieee80211_check_scan_current+0x45 >> adhoc_newstate(c4113800,1,0,648,e64e1aa0,...) at adhoc_newstate+0x219 >> ieee80211_new_state_locked(c4113800,0,c0a1e64c,49c,0,...) at >> ieee80211_new_state_locked+0xc4 >> ieee80211_init(c4113800,c0a24a64,6,c41adc00,1b9,...) at >> ieee80211_init+0x45 >> ieee80211_ioctl_set80211(c3e1ec00,801c69ea,c48c4240,c0709084,c4028690,...) >> at ieee80211_ioctl_set80211+0xe5 >> in_control(c4158188,801c69ea,c48c4240,c3e1ec00,c4028690,...) at >> in_control+0xdc4 >> ifioctl(c4158188,801c69ea,c48c4240,c4028690,801c69ea,...) at ifioctl+0x34a >> soo_ioctl(c43c9d90,801c69ea,c48c4240,c41adc00,c4028690,...) at >> soo_ioctl+0x397 >> kern_ioctl(c4028690,3,801c69ea,c48c4240,504110,...) at kern_ioctl+0x1dd >> ioctl(c4028690,e64e1cf8,c,c06d3f58,c0702bf0,...) at ioctl+0x134 >> syscall(e64e1d38) at syscall+0x283 >> Xint0x80_syscall() at Xint0x80_syscall+0x20 >> --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x281a9a43, esp = >> 0xbfbfe48c, ebp = 0xbfbfe4d8 --- >> >> here is panic message: >> >> Fatal trap 12: page fault while in kernel mode >> cpuid = 1; apic id = 01 >> fault virtual address = 0x0 >> fault code = supervisor read, page not present >> instruction pointer = 0x20:0xc0a0c5b0 >> stack pointer = 0x28:0xe64e1980 >> frame pointer = 0x28:0xe64e1990 >> code segment = base 0x0, limit 0xfffff, type 0x1b >> = DPL 0, pres 1, def32 1, gran 1 >> processor eflags = interrupt enabled, resume, IOPL = 0 >> current process = 1471 (ifconfig) >> exclusive sleep mutex ndis0_com_lock (ndis0_com_lock) r = 1 >> (0xc46a8014) locked @ >> /usr/src/sys/modules/wlan/../../net80211/ieee80211_scan.c:570 >> exclusive sleep mutex ndis0_com_lock (ndis0_com_lock) r = 1 >> (0xc46a8014) locked @ >> /usr/src/sys/modules/wlan/../../net80211/ieee80211_scan.c:570 >> exclusive lockmgr bufwait (bufwait) r = 0 (0xd7d083c0) locked @ >> /usr/src/sys/kern/vfs_bio.c:2443 >> exclusive lockmgr ufs (ufs) r = 0 (0xc41a2058) locked @ >> /usr/src/sys/kern/vfs_vnops.c:593 >> >> 0xc41a2000: tag ufs, type VREG >> usecount 1, writecount 1, refcount 4 mountedhere 0 >> flags () >> v_object 0xc413aaa8 ref 0 pages 7 >> lock type ufs: EXCL by thread 0xc402b8c0 (pid 477) >> >> ino 164881, on dev ad4s1d >> > Looks like adhoc_pick_channel returned NULL which was unexpected. Don't > have a quick fix but it's possible no channel may be selected so the > code is wrong. I rarely touch adhoc mode so this stuff is lightly tested. On further investigation it appears to be locking problem - I was not able to reproduce panic with kern.smp.disabled=1