From owner-freebsd-net@FreeBSD.ORG Sun Oct 10 07:27:30 2010 Return-Path: Delivered-To: net@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 726A9106566B; Sun, 10 Oct 2010 07:27:30 +0000 (UTC) Date: Sun, 10 Oct 2010 07:27:30 +0000 From: Alexey Dokuchaev To: Bernhard Schmidt Message-ID: <20101010072730.GA91527@FreeBSD.org> References: <4763016D.7060100@janh.de> <201010081944.50287.bschmidt@techwires.net> <20101009060239.GA88618@FreeBSD.org> <201010092046.41551.bschmidt@techwires.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201010092046.41551.bschmidt@techwires.net> User-Agent: Mutt/1.4.2.1i Cc: Paul B Mahol , net@freebsd.org Subject: Re: Monitor mode not working for iwi(4) on 7.X X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 07:27:30 -0000 On Sat, Oct 09, 2010 at 08:46:41PM +0200, Bernhard Schmidt wrote: > On Saturday 09 October 2010 08:02:39 Alexey Dokuchaev wrote: > > Much better! "airodump-ng iwi0" now sees stations in addition to APs, > > which means it can utilize monitor mode. "ifconfig iwi0 scan" however > > does not work after that (and "list scan" returns no results) even if I > > put adapter back to normal (from promisc and monitor modes) with > > ifconfig(8). kldunloading and loading module again fixes the issue. > > Due to enqueueing the scan command in an infinite loop (yeah.. scanning > returns every frame, that's monitor mode for that device.. *sigh*) we might > increment a queue index but never actually dequeueing the command. On 'down' > we clear the command queue but not the indices resulting in the cur index > not pointing to a filled entry. Attached patch should fix that. It does, thanks! "list scan" gets populated after I -mediaopt monitor after scan; module reload is not required anymore. Do I read you correctly that seeing no results for "list scan" is OK while card is in monitor mode? > On a side note, you should never be required to run 'ifconfig dev scan', > because after 'ifconfig dev up' the device is always in SCAN state (at least > in station mode). Using 'ifconfig dev list scan' is sufficient enough. Certainly. I was meant to say that "list scan" returned no results, and "forcing" the scan (despite that background scan is in progress) would never return either. > It might be possible with lots of ugly hacks to get that device sending some > kind of frames, 'injecting' those frames via net80211 shouldn't be that hard. > At least the code is there according to comments in ieee80211_output.c. I do > not consider this worth the effort though, if someone wants to work on that, > let me know. I might want to take a look when time permits. > > Apart from that, machine seems stable, and monitor mode is fixed. Thanks > > a lot! > > You're welcome :) Hope to see the final set of patches in RELENG_7 soon. ;-) ./danfe