Return-path: Received: from he.sipsolutions.net ([78.46.109.217]:34326 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209Ab2ECH6b (ORCPT ); Thu, 3 May 2012 03:58:31 -0400 Message-ID: <1336031908.3459.4.camel@jlt3.sipsolutions.net> (sfid-20120503_095834_702323_C18DF261) Subject: Re: carl9170 - monitor mode TP drop From: Johannes Berg To: Christian Lamparter Cc: Janusz Dziedzic , linux-wireless Date: Thu, 03 May 2012 09:58:28 +0200 In-Reply-To: <201204251928.21559.chunkeey@googlemail.com> (sfid-20120425_192840_070867_199F0B3E) References: <201204231945.05113.chunkeey@googlemail.com> <201204251928.21559.chunkeey@googlemail.com> (sfid-20120425_192840_070867_199F0B3E) Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Wed, 2012-04-25 at 19:28 +0200, Christian Lamparter wrote: > On Wednesday, April 25, 2012 07:28:18 AM Janusz Dziedzic wrote: > > W dniu 23 kwietnia 2012 19:45 użytkownik Christian Lamparter > > napisał: > > >> This is what I can see on STA1: > > >> # iperf -c 192.168.254.1 -t 100 -i 5 > > >> [ 3] 10.0-15.0 sec 20.4 MBytes 34.2 Mbits/sec > > >> > > >> =====> here I setup carl monitor on second PC, like this: > > >> =====> iw dev wlan0 set type monitor > > >> =====> iw dev wlan0 set freq 2437 > > >> =====> ifconfig wlan0 up > > >> > > >> [ 3] 40.0-45.0 sec 2.38 MBytes 3.98 Mbits/sec > > > Well, there's the "AR9170_MAC_RX_CTRL_ACK_IN_SNIFFER = bit (30)" > > > in "AR9170_MAC_REG_RX_CONTROL = (0x1c3c40)". > > I disabled this in code. > > > > - rx_ctrl |= AR9170_MAC_RX_CTRL_ACK_IN_SNIFFER; > > +// rx_ctrl |= AR9170_MAC_RX_CTRL_ACK_IN_SNIFFER; > > > > After that I don't see any TP drop and can see all packets in > > wireshark (as expected). > > > > Why carl try to ACK rx packets in monitor mode? > > Is that a correct behaviour? > Well, it depends. > > You see without the BIT set, the hardware won't sent any ACKs > (Not even those which are directed at this interface - which of > course is also bad, or even worse?) and with the BIT set (and if > the HW is in Sniffer Mode) then the hardware acks every frames, > even if they are for a different stations. > So your fix might break someone else's setup. You may want to implement the new monitor-mode-vif-to-driver thing in mac80211 which tells you when you're in *pure* monitor mode. johannes