From owner-freebsd-wireless@freebsd.org Mon Nov 28 08:51:46 2016 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DED0C5823E for ; Mon, 28 Nov 2016 08:51:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 497D61E64; Mon, 28 Nov 2016 08:51:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x230.google.com with SMTP id a124so218183822ioe.2; Mon, 28 Nov 2016 00:51:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=p0fXgsCRpa2eZOv/JTcbRXjg5Y7rKZIicmptZEIkzww=; b=dVbcGboSUUN5b+23VGehVS+J3oojC1tVUvdzdxFnVQguRV9U0WaP0V9Wih2WQa98iz /ZLLSGIhMhq0X+kCIxej887a8JBoqALumWRZTyjf5OiBTla8AfiLCVffccT4ADAIdlAH EX3em1Yc7Q/W4FY7+JIStZx3L2GHnmkr2O2r4QhpGJAePidxKxXVL6eSYshpe/UVdgRs 4qTT/8d+9FzLfu5aQAyPJ1yb8kbtwqrdZ8TNpQQh1EcYEliZg8OyyufKt/0xBTJam64E dfWbO2MToKPNTXXylpJqZqVof7Q0Q+YyeodSAL6W1RzVvdX3qO4Xy0gqSlqFp4rabJAL YaCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=p0fXgsCRpa2eZOv/JTcbRXjg5Y7rKZIicmptZEIkzww=; b=gfZYWg5qSKx/0Ik+23Ct0tDdPxe80NfqFaBmXebF7019EYy/VSo29jSi2CsIM7+c5J G+LU6qDroOXHYTdqS13oyofbqXeg7DBALQ4wvJ7/x5gmHd6Vmm+NAVo1QeqPsqAAFt0E SicdyFq02eiOqLs+V/HEr5+qQwO1r6EOkMQvsonlsKFmzBlHfA59WEW7PzeO/1Z21m+T aHiCpFx67zJOvsHVpVKZ5kpO7oYg44F6dbulZyRimC+csbvi5BZ1NHZ2QjYHKcNQRGMq nyzHbJht0Fjf3yNGKqh6r5zM87+fWUYw4FTPtDbnvaW84E4zTQHLjTrMZ37KYB7A/VIT MUBQ== X-Gm-Message-State: AKaTC00UxbcWnd+X4C1+zmtJG2HTxrRshyWhMSvv9qDmUEesUj4NoIyX+fAAcGjQ1qY+cPQWj0VemWAw5rI9qQ== X-Received: by 10.36.43.193 with SMTP id h184mr17006958ita.29.1480323105579; Mon, 28 Nov 2016 00:51:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Mon, 28 Nov 2016 00:51:44 -0800 (PST) In-Reply-To: <2659409.rMaykUSg7T@overcee.wemm.org> References: <2659409.rMaykUSg7T@overcee.wemm.org> From: Adrian Chadd Date: Mon, 28 Nov 2016 00:51:44 -0800 Message-ID: Subject: Re: Lost commit mail To: Peter Wemm , "freebsd-wireless@freebsd.org" Cc: src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 08:51:46 -0000 ... and FYI - one of them is wrong - i'll back it out once i figure out why the FreeBSD AP side is being garbage and commit a better "spec compliant" fix. ugh.. :( -a On 27 November 2016 at 21:29, Peter Wemm wrote: > There were two commits in the window where src-committers@ was broken. > > https://svnweb.freebsd.org/changeset/base/309222 > https://svnweb.freebsd.org/changeset/base/309223 > > ------------------------------------------------------------------------ > r309223 | adrian | 2016-11-27 18:59:33 -0800 (Sun, 27 Nov 2016) | 54 lines > Changed paths: > M /head/sys/dev/ath/if_ath_beacon.c > > [ath] fix target beacon interval programming for STA mode when in powersave. > > This bug has been bugging me for quite some time. I finally sat down > with enough coffee to figure it out. > > The short of it - rounding up to the next intval multiple of the TSF value > only works if the AP is transmitting all its beacons on an interval of > the TSF. If it isn't - for example, doing staggered beacons on a multi-VAP > setup with a single hardware TSF - then weird things occur. > > The long of it - > > When powersave is enabled, the MAC and PHY are partially powered off. > They can't receive any packets (or transmit, for that matter.) > The target beacon timer programming will wake up the MAC/PHY just before > the beacon is supposed to be received (well, strictly speaking, at DTIM > so it can see the TIM - traffic information map - telling the STA whether > any traffic is there for it) and it happens automatically. > > However, this relies on the target beacon time being programmed correctly. > If it isn't then the hardware will wake up and not hear any beacons - > and then it'll be asleep for said beacons. After enough of this, net80211 > will give up and assume the AP went away. > > This should fix both TSFOOR interrupts and disconnects from APs with powersave > enabled. > > The annoying bit is that it only happens if APs stagger things or start > on a non-zero TSF. So, this would sometimes be fine and sometimes not be > fine. > > What: > > * I don't know (yet) why the code rounds up to the next intval. > For now, just disable rounding it and trust the value we get. > > TODO: > > * If we do see a beacon miss in STA mode then we should transition > out of sleep for a while so we can hear beacons to resync against. > I'd love a patch from someone to enable that particular behaviour. > Note - that doesn't require that net80211 brings the chip out of > sleep state - only that we wake the chip up through to full-on and > then let it go to sleep again when we've seen a beacon. The wifi > stack and AP can still completely just stay believing we're in sleep > mode. > > Tested: > > * AR9485, STA mode, powersave enabled > > MFC after: 1 week > Relnotes: Yes > > ------------------------------------------------------------------------ > r309222 | adrian | 2016-11-27 18:51:55 -0800 (Sun, 27 Nov 2016) | 5 lines > Changed paths: > M /head/sys/dev/ath/if_ath_rx.c > > [ath] include logging of TU versions of the TSF values. > > The beacon programming side of things deals in TUs and 1/8th TUs, so > it's good to se the TU value here when debugging beaconing issues. > > ------------------------------------------------------------------------ > > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV > UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 >