From owner-freebsd-net@FreeBSD.ORG Tue Oct 19 16:48:37 2010 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E861106566C; Tue, 19 Oct 2010 16:48:37 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id D8F418FC18; Tue, 19 Oct 2010 16:48:36 +0000 (UTC) Received: by pxi4 with SMTP id 4so643196pxi.13 for ; Tue, 19 Oct 2010 09:48:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.37.82 with SMTP id w18mr169194qad.377.1287506915444; Tue, 19 Oct 2010 09:48:35 -0700 (PDT) Sender: bschmidt@techwires.net Received: by 10.229.41.198 with HTTP; Tue, 19 Oct 2010 09:48:35 -0700 (PDT) X-Originating-IP: [84.180.214.123] In-Reply-To: <20101016124152.GA95535@FreeBSD.org> References: <4763016D.7060100@janh.de> <201010081944.50287.bschmidt@techwires.net> <20101009060239.GA88618@FreeBSD.org> <201010092046.41551.bschmidt@techwires.net> <20101010072730.GA91527@FreeBSD.org> <20101016124152.GA95535@FreeBSD.org> Date: Tue, 19 Oct 2010 18:48:35 +0200 X-Google-Sender-Auth: NfTN8T1A2255zEwCLkoV_boFq6k Message-ID: From: Bernhard Schmidt To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: 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: Tue, 19 Oct 2010 16:48:37 -0000 Alexey Dokuchaev : > On Sun, Oct 10, 2010 at 07:27:30AM +0000, Alexey Dokuchaev wrote: >> 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! =A0"airodump-ng iwi0" now sees stations in addition to = APs, >> > > which means it can utilize monitor mode. =A0"ifconfig iwi0 scan" how= ever >> > > does not work after that (and "list scan" returns no results) even i= f I >> > > put adapter back to normal (from promisc and monitor modes) with >> > > ifconfig(8). =A0kldunloading and loading module again fixes the issu= e. >> > >> > Due to enqueueing the scan command in an infinite loop (yeah.. scannin= g >> > returns every frame, that's monitor mode for that device.. *sigh*) we >> > might increment a queue index but never actually dequeueing the comman= d. >> > 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 fi= x >> > that. >> >> It does, thanks! =A0"list scan" gets populated after I -mediaopt monitor >> after scan; module reload is not required anymore. > > Not sure if this is a driver or ifconfig(8) problem, but after I -mediaop= t > monitor, ifconfig(8) still reports it in media line: > > =A0 =A0 =A0 =A0media: IEEE 802.11 Wireless Ethernet autoselect > > However, as I said, scan list gets populated, which suggests ifconfig(8) > is getting something wrong. =A0Doing -mediaopt monitor the second time > "knocks" ifconfig(8) though. I can't reproduce that on my stable/7 setup, neither in 'UP' nor in 'DOWN' state. Can you post the exact command sequence you've used? The output differs though.. # ifconfig iwi0 mediaopt monitor # ifconfig iwi0 up # ifconfig iwi0 | grep media media: IEEE 802.11 Wireless Ethernet autoselect (autoselect ) # ifconfig iwi0 -mediaopt monitor # ifconfig iwi0 | grep media media: IEEE 802.11 Wireless Ethernet autoselect # -- Bernhard