freebsd-skq/sys
Adrian Chadd 0ffc652e9e [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
2016-11-28 02:59:33 +00:00
..
amd64 Report page faults due to reserved bits in PTEs as a separate fault type. 2016-11-19 01:34:12 +00:00
arm PLL3 have a fractional mode where an explicit frequency (297Mhz or 270) 2016-11-26 10:36:48 +00:00
arm64 Fix the TLB conflict abort value. This should be a no-op as we don't use 2016-11-25 16:04:36 +00:00
boot Add an ethernet0 alias pointing to the /aix/usb/hub/ethernet node. This 2016-11-26 17:55:46 +00:00
bsm
cam Fix "camcontrol rescan" with SATA drives behind a SAS controller 2016-11-17 20:42:56 +00:00
cddl MFV r308990: 7181 race between zfs_mount and zfs_ioc_rollback 2016-11-24 10:34:42 +00:00
compat Remove PG_CACHED-related fields from struct vmmeter, because they are no 2016-11-22 18:13:46 +00:00
conf bhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding. 2016-11-26 23:22:32 +00:00
contrib Merge ACPICA 20161117. 2016-11-22 05:54:37 +00:00
crypto Add accelerated AES with using the ARMv8 crypto instructions. This is based 2016-11-21 11:18:00 +00:00
ddb Determine the operand/address size of %cs in a new function 2016-09-25 16:30:29 +00:00
dev [ath] fix target beacon interval programming for STA mode when in powersave. 2016-11-28 02:59:33 +00:00
fs NFSv4 client tracks opens, and the track records are only dropped when 2016-11-27 09:20:58 +00:00
gdb
geom Use providergone method to cover race between destroy and g_access(). 2016-11-13 03:56:26 +00:00
gnu Add Ingenic X1000 DTS files (unofficial). 2016-11-19 15:03:49 +00:00
i386 MFamd64: Various fatal page fault fixes. 2016-11-19 01:36:44 +00:00
isa sys/isa: minor spelling fixes. 2016-05-03 21:51:52 +00:00
kern Launder VPO_NOSYNC pages upon vnode deactivation. 2016-11-26 21:00:27 +00:00
kgssapi
libkern Update r309143 to prevent false sharing. 2016-11-25 17:20:23 +00:00
mips bhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding. 2016-11-26 23:22:32 +00:00
modules bhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding. 2016-11-26 23:22:32 +00:00
net IPsec RFC6479 support for replay window sizes up to 2^32 - 32 packets. 2016-11-25 14:44:49 +00:00
net80211 [net80211] high oops on the high seas, or "god damnit compilers, it's 2016 and you're supposed to save me from this." 2016-11-22 17:36:16 +00:00
netgraph Writing out the L2TP control packet requires 12 bytes of 2016-11-17 14:03:44 +00:00
netinet For RTT calculations mid-session, we explicitly ignore ACKs with tsecr of 0 as 2016-11-21 20:53:11 +00:00
netinet6 Make ICMPv6 hard error handling for TCP consistent with the ICMPv4 2016-10-21 10:32:57 +00:00
netipsec Add a missing header 2016-11-26 23:15:11 +00:00
netnatm
netpfil Fix ICMPv6 Time Exceeded error message translation. 2016-11-26 10:04:05 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4 2016-09-30 08:23:06 +00:00
opencrypto Add support for the fpu_kern(9) KPI on arm64. It hooks into the existing 2016-10-20 09:22:10 +00:00
pc98 Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
powerpc Add an isync to after mtsrin, required by the MPC750 errata 2016-11-25 19:36:27 +00:00
riscv Disable superpages reservations as we don't have implemented them yet. 2016-11-21 12:00:31 +00:00
rpc
security Audit 'fd' and 'cmd' arguments to fcntl(2), and when generating BSM, 2016-11-22 00:41:24 +00:00
sparc64 Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
sys NFSv4 client tracks opens, and the track records are only dropped when 2016-11-27 09:20:58 +00:00
teken
tests
tools
ufs Release laundered vnode pages to the head of the inactive queue. 2016-11-23 17:53:07 +00:00
vm Recursion on the free page queue mutex occurred when UMA needed to allocate 2016-11-27 01:42:53 +00:00
x86 Fix automatic eventtimer hardware selection when ARAT 2016-11-26 10:33:53 +00:00
xdr
xen xen: add a grant-table user-space device 2016-10-31 13:12:58 +00:00
Makefile