]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Enable device PS before sending PS-Poll
authorAdiel Aloni <adiel.aloni@intel.com>
Tue, 30 Jan 2018 11:10:10 +0000 (13:10 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 4 Feb 2018 10:06:11 +0000 (12:06 +0200)
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>
tests/hwsim/test_ap_open.py

index b888002c1089c79294261c2b49251717868916ba..20e00a2efdc65bda4ce0da2d86368dfa95c2ec6a 100644 (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()