[PATCH 4/9] tests: Add support for get_monitor_params() for p2p ifaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function is used for tests when a monitor interface is wanted on the
channel on which the softap operates.
This change enables us to also query p2p interfaces for the channel
information to use for monitor interfaces.

Signed-off-by: Jonathan Afek <jonathanx.afek@xxxxxxxxx>
---
 tests/remote/monitor.py | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/remote/monitor.py b/tests/remote/monitor.py
index fe67592..a88eecc 100644
--- a/tests/remote/monitor.py
+++ b/tests/remote/monitor.py
@@ -139,16 +139,21 @@ def remove(host):
 
 
 # get monitor params from hostapd
-def get_monitor_params(hapd):
-    freq = hapd.get_status_field("freq")
+def get_monitor_params(wpa, is_p2p=False):
+    get_status_field_f = None
+    if is_p2p:
+        get_status_field_f = wpa.get_group_status_field
+    else:
+        get_status_field_f = wpa.get_status_field
+    freq = get_status_field_f("freq")
     bw = "20"
     center_freq1=""
     center_freq2=""
 
-    vht_oper_chwidth = hapd.get_status_field("vht_oper_chwidth")
-    secondary_channel = hapd.get_status_field("secondary_channel")
-    vht_oper_centr_freq_seg0_idx = hapd.get_status_field("vht_oper_centr_freq_seg0_idx")
-    vht_oper_centr_freq_seg1_idx = hapd.get_status_field("vht_oper_centr_freq_seg1_idx")
+    vht_oper_chwidth = get_status_field_f("vht_oper_chwidth")
+    secondary_channel = get_status_field_f("secondary_channel")
+    vht_oper_centr_freq_seg0_idx = get_status_field_f("vht_oper_centr_freq_seg0_idx")
+    vht_oper_centr_freq_seg1_idx = get_status_field_f("vht_oper_centr_freq_seg1_idx")
     if vht_oper_chwidth == "0" or vht_oper_chwidth is None:
         if secondary_channel == "1":
             bw = "40"
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux