tests: Enable device PS before sending PS-Poll

Linux kernel commit c9491367b759 ("mac80211: always update the PM state
of a peer on MGMT / DATA frames") enforces the AP to check only
mgmt/data frames PM bit, and to update station's power save accordingly.
When sending only a PS-Poll (control frame) the AP will ignore the PM
bit. As the result, the partial virtual bitmap will not be updated, and
the test ap_open_disconnect_in_ps will fail on tshark check. Since the
test needs only the TIM to be updated, setting PS enabled will send NDP
that will signal that the station is sleeping. Sending PS-Poll to enable
power save is not correct, according to the following standard
statement: "A PS-Poll frame exchange does not necessarily result in an
Ack frame from the AP, so a non-AP STA cannot change power management
mode using a PS-Poll frame."

Signed-off-by: Adiel Aloni <adiel.aloni@intel.com>
This commit is contained in:
Adiel Aloni 2018-01-30 13:10:10 +02:00 committed by Jouni Malinen
parent 9f8d459d4c
commit 946ed13c98

View file

@ -426,7 +426,9 @@ def test_ap_open_disconnect_in_ps(dev, apdev, params):
raise Exception("No connection event received from hostapd")
time.sleep(0.2)
hwsim_utils.set_powersave(dev[0], hwsim_utils.PS_MANUAL_POLL)
# enable power save mode
hwsim_utils.set_powersave(dev[0], hwsim_utils.PS_ENABLED)
time.sleep(0.1)
try:
# inject some traffic
sa = hapd.own_addr()