1 # Test cases for VHT operations with hostapd
2 # Copyright (c) 2014, Qualcomm Atheros, Inc.
3 # Copyright (c) 2013, Intel Corporation
5 # This software may be distributed under the terms of the BSD license.
6 # See README for more details.
9 logger = logging.getLogger()
11 import subprocess, time
15 from utils import HwsimSkip
16 from test_dfs import wait_dfs_event
17 from test_ap_csa import csa_supported
18 from test_ap_ht import clear_scan_cache
21 cmd = subprocess.Popen(["iw", "reg", "get"], stdout=subprocess.PIPE)
22 reg = cmd.stdout.read()
23 if "@ 80)" in reg or "@ 160)" in reg:
27 def test_ap_vht80(dev, apdev):
28 """VHT with 80 MHz channel width"""
31 params = { "ssid": "vht",
35 "ht_capab": "[HT40+]",
38 "vht_oper_chwidth": "1",
39 "vht_oper_centr_freq_seg0_idx": "42" }
40 hapd = hostapd.add_ap(apdev[0], params)
41 bssid = apdev[0]['bssid']
43 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
44 hwsim_utils.test_connectivity(dev[0], hapd)
45 sig = dev[0].request("SIGNAL_POLL").splitlines()
46 if "FREQUENCY=5180" not in sig:
47 raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
48 if "WIDTH=80 MHz" not in sig:
49 raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
50 est = dev[0].get_bss(bssid)['est_throughput']
52 raise Exception("Unexpected BSS est_throughput: " + est)
53 status = hapd.get_status()
54 logger.info("hostapd STATUS: " + str(status))
55 if status["ieee80211n"] != "1":
56 raise Exception("Unexpected STATUS ieee80211n value")
57 if status["ieee80211ac"] != "1":
58 raise Exception("Unexpected STATUS ieee80211ac value")
59 if status["secondary_channel"] != "1":
60 raise Exception("Unexpected STATUS secondary_channel value")
61 if status["vht_oper_chwidth"] != "1":
62 raise Exception("Unexpected STATUS vht_oper_chwidth value")
63 if status["vht_oper_centr_freq_seg0_idx"] != "42":
64 raise Exception("Unexpected STATUS vht_oper_centr_freq_seg0_idx value")
66 if isinstance(e, Exception) and str(e) == "AP startup failed":
67 if not vht_supported():
68 raise HwsimSkip("80 MHz channel not supported in regulatory information")
71 dev[0].request("DISCONNECT")
73 hapd.request("DISABLE")
74 subprocess.call(['iw', 'reg', 'set', '00'])
75 dev[0].flush_scan_cache()
77 def vht80_test(apdev, dev, channel, ht_capab):
78 clear_scan_cache(apdev)
81 params = { "ssid": "vht",
84 "channel": str(channel),
88 "vht_oper_chwidth": "1",
89 "vht_oper_centr_freq_seg0_idx": "42" }
90 hapd = hostapd.add_ap(apdev, params)
91 bssid = apdev['bssid']
93 dev.connect("vht", key_mgmt="NONE", scan_freq=str(5000 + 5 * channel))
94 hwsim_utils.test_connectivity(dev, hapd)
96 if isinstance(e, Exception) and str(e) == "AP startup failed":
97 if not vht_supported():
98 raise HwsimSkip("80 MHz channel not supported in regulatory information")
101 dev.request("DISCONNECT")
103 hapd.request("DISABLE")
104 subprocess.call(['iw', 'reg', 'set', '00'])
105 dev.flush_scan_cache()
107 def test_ap_vht80b(dev, apdev):
108 """VHT with 80 MHz channel width (HT40- channel 40)"""
109 vht80_test(apdev[0], dev[0], 40, "[HT40-]")
111 def test_ap_vht80c(dev, apdev):
112 """VHT with 80 MHz channel width (HT40+ channel 44)"""
113 vht80_test(apdev[0], dev[0], 44, "[HT40+]")
115 def test_ap_vht80d(dev, apdev):
116 """VHT with 80 MHz channel width (HT40- channel 48)"""
117 vht80_test(apdev[0], dev[0], 48, "[HT40-]")
119 def test_ap_vht80_params(dev, apdev):
120 """VHT with 80 MHz channel width and number of optional features enabled"""
123 params = { "ssid": "vht",
124 "country_code": "FI",
127 "ht_capab": "[HT40+][SHORT-GI-40][DSS_CCK-40]",
130 "vht_oper_chwidth": "1",
131 "vht_capab": "[MAX-MPDU-11454][RXLDPC][SHORT-GI-80][TX-STBC-2BY1][RX-STBC-1][MAX-A-MPDU-LEN-EXP0]",
132 "vht_oper_centr_freq_seg0_idx": "42",
134 hapd = hostapd.add_ap(apdev[0], params)
136 dev[1].connect("vht", key_mgmt="NONE", scan_freq="5180",
137 disable_vht="1", wait_connect=False)
138 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
139 ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
141 raise Exception("Association rejection timed out")
142 if "status_code=104" not in ev:
143 raise Exception("Unexpected rejection status code")
144 dev[1].request("DISCONNECT")
145 hwsim_utils.test_connectivity(dev[0], hapd)
147 if isinstance(e, Exception) and str(e) == "AP startup failed":
148 if not vht_supported():
149 raise HwsimSkip("80 MHz channel not supported in regulatory information")
152 dev[0].request("DISCONNECT")
153 dev[1].request("DISCONNECT")
155 hapd.request("DISABLE")
156 subprocess.call(['iw', 'reg', 'set', '00'])
157 dev[0].flush_scan_cache()
158 dev[1].flush_scan_cache()
160 def test_ap_vht80_invalid(dev, apdev):
161 """VHT with invalid 80 MHz channel configuration (seg1)"""
164 params = { "ssid": "vht",
165 "country_code": "US",
168 "ht_capab": "[HT40+]",
171 "vht_oper_chwidth": "1",
172 "vht_oper_centr_freq_seg0_idx": "42",
173 "vht_oper_centr_freq_seg1_idx": "155",
176 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
177 # This fails due to unexpected seg1 configuration
178 ev = hapd.wait_event(["AP-DISABLED"], timeout=5)
180 raise Exception("AP-DISABLED not reported")
182 if isinstance(e, Exception) and str(e) == "AP startup failed":
183 if not vht_supported():
184 raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
188 hapd.request("DISABLE")
189 subprocess.call(['iw', 'reg', 'set', '00'])
191 def test_ap_vht80_invalid2(dev, apdev):
192 """VHT with invalid 80 MHz channel configuration (seg0)"""
195 params = { "ssid": "vht",
196 "country_code": "US",
199 "ht_capab": "[HT40+]",
202 "vht_oper_chwidth": "1",
203 "vht_oper_centr_freq_seg0_idx": "46",
206 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
207 # This fails due to invalid seg0 configuration
208 ev = hapd.wait_event(["AP-DISABLED"], timeout=5)
210 raise Exception("AP-DISABLED not reported")
212 if isinstance(e, Exception) and str(e) == "AP startup failed":
213 if not vht_supported():
214 raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
218 hapd.request("DISABLE")
219 subprocess.call(['iw', 'reg', 'set', '00'])
221 def test_ap_vht_20(devs, apdevs):
222 """VHT and 20 MHz channel"""
227 params = { "ssid": "test-vht20",
228 "country_code": "DE",
235 "vht_oper_chwidth": "0",
236 "vht_oper_centr_freq_seg0_idx": "0",
237 "supported_rates": "60 120 240 360 480 540",
240 hapd = hostapd.add_ap(ap, params)
241 dev.connect("test-vht20", scan_freq="5180", key_mgmt="NONE")
242 hwsim_utils.test_connectivity(dev, hapd)
244 dev.request("DISCONNECT")
246 hapd.request("DISABLE")
247 subprocess.call(['iw', 'reg', 'set', '00'])
248 dev.flush_scan_cache()
250 def test_ap_vht_40(devs, apdevs):
251 """VHT and 40 MHz channel"""
256 params = { "ssid": "test-vht40",
257 "country_code": "DE",
262 "ht_capab": "[HT40+]",
264 "vht_oper_chwidth": "0",
265 "vht_oper_centr_freq_seg0_idx": "0",
267 hapd = hostapd.add_ap(ap, params)
268 dev.connect("test-vht40", scan_freq="5180", key_mgmt="NONE")
269 hwsim_utils.test_connectivity(dev, hapd)
271 dev.request("DISCONNECT")
273 hapd.request("DISABLE")
274 subprocess.call(['iw', 'reg', 'set', '00'])
275 dev.flush_scan_cache()
277 def test_ap_vht_capab_not_supported(dev, apdev):
278 """VHT configuration with driver not supporting all vht_capab entries"""
280 params = { "ssid": "vht",
281 "country_code": "FI",
284 "ht_capab": "[HT40+][SHORT-GI-40][DSS_CCK-40]",
287 "vht_oper_chwidth": "1",
288 "vht_capab": "[MAX-MPDU-7991][MAX-MPDU-11454][VHT160][VHT160-80PLUS80][RXLDPC][SHORT-GI-80][SHORT-GI-160][TX-STBC-2BY1][RX-STBC-1][RX-STBC-12][RX-STBC-123][RX-STBC-1234][SU-BEAMFORMER][SU-BEAMFORMEE][BF-ANTENNA-2][BF-ANTENNA-3][BF-ANTENNA-4][SOUNDING-DIMENSION-2][SOUNDING-DIMENSION-3][SOUNDING-DIMENSION-4][MU-BEAMFORMER][VHT-TXOP-PS][HTC-VHT][MAX-A-MPDU-LEN-EXP0][MAX-A-MPDU-LEN-EXP7][VHT-LINK-ADAPT2][VHT-LINK-ADAPT3][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]",
289 "vht_oper_centr_freq_seg0_idx": "42",
291 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
292 ev = hapd.wait_event(["AP-DISABLED"], timeout=5)
294 raise Exception("Startup failure not reported")
295 for i in range(1, 7):
296 if "OK" not in hapd.request("SET vht_capab [MAX-A-MPDU-LEN-EXP%d]" % i):
297 raise Exception("Unexpected SET failure")
299 subprocess.call(['iw', 'reg', 'set', '00'])
301 def test_ap_vht160(dev, apdev):
302 """VHT with 160 MHz channel width"""
306 params = { "ssid": "vht",
307 "country_code": "FI",
310 "ht_capab": "[HT40+]",
313 "vht_oper_chwidth": "2",
314 "vht_oper_centr_freq_seg0_idx": "50",
317 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
319 ev = wait_dfs_event(hapd, "DFS-CAC-START", 5)
320 if "DFS-CAC-START" not in ev:
321 raise Exception("Unexpected DFS event")
323 state = hapd.get_status_field("state")
325 if state == "DISABLED" and not os.path.exists("dfs"):
326 # Not all systems have recent enough CRDA version and
327 # wireless-regdb changes to support 160 MHz and DFS. For now,
328 # do not report failures for this test case.
329 raise HwsimSkip("CRDA or wireless-regdb did not support 160 MHz")
330 raise Exception("Unexpected interface state: " + state)
332 params = { "ssid": "vht2",
333 "country_code": "FI",
336 "ht_capab": "[HT40-]",
339 "vht_oper_chwidth": "2",
340 "vht_oper_centr_freq_seg0_idx": "114",
343 hapd2 = hostapd.add_ap(apdev[1], params, wait_enabled=False)
345 ev = wait_dfs_event(hapd2, "DFS-CAC-START", 5)
346 if "DFS-CAC-START" not in ev:
347 raise Exception("Unexpected DFS event(2)")
349 state = hapd2.get_status_field("state")
351 raise Exception("Unexpected interface state(2): " + state)
353 logger.info("Waiting for CAC to complete")
355 ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 70)
356 if "success=1" not in ev:
357 raise Exception("CAC failed")
358 if "freq=5180" not in ev:
359 raise Exception("Unexpected DFS freq result")
361 ev = hapd.wait_event(["AP-ENABLED"], timeout=5)
363 raise Exception("AP setup timed out")
365 state = hapd.get_status_field("state")
366 if state != "ENABLED":
367 raise Exception("Unexpected interface state")
369 ev = wait_dfs_event(hapd2, "DFS-CAC-COMPLETED", 70)
370 if "success=1" not in ev:
371 raise Exception("CAC failed(2)")
372 if "freq=5520" not in ev:
373 raise Exception("Unexpected DFS freq result(2)")
375 ev = hapd2.wait_event(["AP-ENABLED"], timeout=5)
377 raise Exception("AP setup timed out(2)")
379 state = hapd2.get_status_field("state")
380 if state != "ENABLED":
381 raise Exception("Unexpected interface state(2)")
383 freq = hapd2.get_status_field("freq")
385 raise Exception("Unexpected frequency(2)")
387 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
388 hwsim_utils.test_connectivity(dev[0], hapd)
389 sig = dev[0].request("SIGNAL_POLL").splitlines()
390 if "FREQUENCY=5180" not in sig:
391 raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
392 if "WIDTH=160 MHz" not in sig:
393 raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
394 dev[1].connect("vht2", key_mgmt="NONE", scan_freq="5520")
395 hwsim_utils.test_connectivity(dev[1], hapd2)
396 sig = dev[1].request("SIGNAL_POLL").splitlines()
397 if "FREQUENCY=5520" not in sig:
398 raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
399 if "WIDTH=160 MHz" not in sig:
400 raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
402 if isinstance(e, Exception) and str(e) == "AP startup failed":
403 if not vht_supported():
404 raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
407 dev[0].request("DISCONNECT")
408 dev[1].request("DISCONNECT")
410 hapd.request("DISABLE")
412 hapd2.request("DISABLE")
413 subprocess.call(['iw', 'reg', 'set', '00'])
414 dev[0].flush_scan_cache()
415 dev[1].flush_scan_cache()
417 def test_ap_vht160_no_dfs(dev, apdev):
418 """VHT with 160 MHz channel width and no DFS"""
421 params = { "ssid": "vht",
422 "country_code": "ZA",
425 "ht_capab": "[HT40-]",
428 "vht_oper_chwidth": "2",
429 "vht_oper_centr_freq_seg0_idx": "114",
432 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
433 ev = hapd.wait_event(["AP-ENABLED"], timeout=2)
435 cmd = subprocess.Popen(["iw", "reg", "get"], stdout=subprocess.PIPE)
436 reg = cmd.stdout.readlines()
438 if "5490" in r and "DFS" in r:
439 raise HwsimSkip("ZA regulatory rule did not have DFS requirement removed")
440 raise Exception("AP setup timed out")
442 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5520")
443 hwsim_utils.test_connectivity(dev[0], hapd)
444 sig = dev[0].request("SIGNAL_POLL").splitlines()
445 if "FREQUENCY=5520" not in sig:
446 raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
447 if "WIDTH=160 MHz" not in sig:
448 raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
450 if isinstance(e, Exception) and str(e) == "AP startup failed":
451 if not vht_supported():
452 raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
455 dev[0].request("DISCONNECT")
457 hapd.request("DISABLE")
458 subprocess.call(['iw', 'reg', 'set', '00'])
459 dev[0].flush_scan_cache()
461 def test_ap_vht80plus80(dev, apdev):
462 """VHT with 80+80 MHz channel width"""
466 params = { "ssid": "vht",
467 "country_code": "US",
470 "ht_capab": "[HT40+]",
473 "vht_oper_chwidth": "3",
474 "vht_oper_centr_freq_seg0_idx": "58",
475 "vht_oper_centr_freq_seg1_idx": "155",
478 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
479 # This will actually fail since DFS on 80+80 is not yet supported
480 ev = hapd.wait_event(["AP-DISABLED"], timeout=5)
481 # ignore result to avoid breaking the test once 80+80 DFS gets enabled
483 params = { "ssid": "vht2",
484 "country_code": "US",
487 "ht_capab": "[HT40+]",
490 "vht_oper_chwidth": "3",
491 "vht_oper_centr_freq_seg0_idx": "42",
492 "vht_oper_centr_freq_seg1_idx": "155" }
493 hapd2 = hostapd.add_ap(apdev[1], params, wait_enabled=False)
495 ev = hapd2.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=5)
497 raise Exception("AP setup timed out(2)")
498 if "AP-DISABLED" in ev:
499 # Assume this failed due to missing regulatory update for now
500 raise HwsimSkip("80+80 MHz channel not supported in regulatory information")
502 state = hapd2.get_status_field("state")
503 if state != "ENABLED":
504 raise Exception("Unexpected interface state(2)")
506 dev[1].connect("vht2", key_mgmt="NONE", scan_freq="5180")
507 hwsim_utils.test_connectivity(dev[1], hapd2)
508 sig = dev[1].request("SIGNAL_POLL").splitlines()
509 if "FREQUENCY=5180" not in sig:
510 raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig))
511 if "WIDTH=80+80 MHz" not in sig:
512 raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig))
513 if "CENTER_FRQ1=5210" not in sig:
514 raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig))
515 if "CENTER_FRQ2=5775" not in sig:
516 raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig))
518 if isinstance(e, Exception) and str(e) == "AP startup failed":
519 if not vht_supported():
520 raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
523 dev[0].request("DISCONNECT")
524 dev[1].request("DISCONNECT")
526 hapd.request("DISABLE")
528 hapd2.request("DISABLE")
529 subprocess.call(['iw', 'reg', 'set', '00'])
530 dev[0].flush_scan_cache()
531 dev[1].flush_scan_cache()
533 def test_ap_vht80plus80_invalid(dev, apdev):
534 """VHT with invalid 80+80 MHz channel"""
537 params = { "ssid": "vht",
538 "country_code": "US",
541 "ht_capab": "[HT40+]",
544 "vht_oper_chwidth": "3",
545 "vht_oper_centr_freq_seg0_idx": "42",
546 "vht_oper_centr_freq_seg1_idx": "0",
549 hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
550 # This fails due to missing(invalid) seg1 configuration
551 ev = hapd.wait_event(["AP-DISABLED"], timeout=5)
553 raise Exception("AP-DISABLED not reported")
555 if isinstance(e, Exception) and str(e) == "AP startup failed":
556 if not vht_supported():
557 raise HwsimSkip("80/160 MHz channel not supported in regulatory information")
561 hapd.request("DISABLE")
562 subprocess.call(['iw', 'reg', 'set', '00'])
564 def test_ap_vht80_csa(dev, apdev):
565 """VHT with 80 MHz channel width and CSA"""
566 csa_supported(dev[0])
569 params = { "ssid": "vht",
570 "country_code": "US",
573 "ht_capab": "[HT40+]",
576 "vht_oper_chwidth": "1",
577 "vht_oper_centr_freq_seg0_idx": "155" }
578 hapd = hostapd.add_ap(apdev[0], params)
580 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5745")
581 hwsim_utils.test_connectivity(dev[0], hapd)
583 hapd.request("CHAN_SWITCH 5 5180 ht vht blocktx center_freq1=5210 sec_channel_offset=1 bandwidth=80")
584 ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=10)
586 raise Exception("CSA finished event timed out")
587 if "freq=5180" not in ev:
588 raise Exception("Unexpected channel in CSA finished event")
590 hwsim_utils.test_connectivity(dev[0], hapd)
592 hapd.request("CHAN_SWITCH 5 5745")
593 ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=10)
595 raise Exception("CSA finished event timed out")
596 if "freq=5745" not in ev:
597 raise Exception("Unexpected channel in CSA finished event")
599 hwsim_utils.test_connectivity(dev[0], hapd)
601 # This CSA to same channel will fail in kernel, so use this only for
602 # extra code coverage.
603 hapd.request("CHAN_SWITCH 5 5745")
604 hapd.wait_event(["AP-CSA-FINISHED"], timeout=1)
606 if isinstance(e, Exception) and str(e) == "AP startup failed":
607 if not vht_supported():
608 raise HwsimSkip("80 MHz channel not supported in regulatory information")
611 dev[0].request("DISCONNECT")
613 hapd.request("DISABLE")
614 subprocess.call(['iw', 'reg', 'set', '00'])
615 dev[0].flush_scan_cache()
617 def test_ap_vht_on_24ghz(dev, apdev):
618 """Subset of VHT features on 2.4 GHz"""
620 params = { "ssid": "test-vht-2g",
625 "vht_capab": "[MAX-MPDU-11454]",
626 "vht_oper_chwidth": "0",
627 "vht_oper_centr_freq_seg0_idx": "1"
629 hapd = hostapd.add_ap(apdev[0], params)
631 if "OK" not in dev[0].request("VENDOR_ELEM_ADD 13 dd1300904c0400bf0c3240820feaff0000eaff0000"):
632 raise Exception("Failed to add vendor element")
633 dev[0].connect("test-vht-2g", scan_freq="2412", key_mgmt="NONE")
634 hwsim_utils.test_connectivity(dev[0], hapd)
635 sta = hapd.get_sta(dev[0].own_addr())
636 if '[VENDOR_VHT]' not in sta['flags']:
637 raise Exception("No VENDOR_VHT STA flag")
639 dev[1].connect("test-vht-2g", scan_freq="2412", key_mgmt="NONE")
640 sta = hapd.get_sta(dev[1].own_addr())
641 if '[VENDOR_VHT]' in sta['flags']:
642 raise Exception("Unexpected VENDOR_VHT STA flag")
644 dev[0].request("VENDOR_ELEM_REMOVE 13 *")
646 def test_prefer_vht40(dev, apdev):
647 """Preference on VHT40 over HT40"""
651 params = { "ssid": "test",
652 "country_code": "FI",
656 "ht_capab": "[HT40+]" }
657 hapd = hostapd.add_ap(apdev[0], params)
658 bssid = apdev[0]['bssid']
660 params = { "ssid": "test",
661 "country_code": "FI",
666 "ht_capab": "[HT40+]",
668 "vht_oper_chwidth": "0",
669 "vht_oper_centr_freq_seg0_idx": "0",
671 hapd2 = hostapd.add_ap(apdev[1], params)
672 bssid2 = apdev[1]['bssid']
674 dev[0].scan_for_bss(bssid, freq=5180)
675 dev[0].scan_for_bss(bssid2, freq=5180)
676 dev[0].connect("test", scan_freq="5180", key_mgmt="NONE")
677 if dev[0].get_status_field('bssid') != bssid2:
678 raise Exception("Unexpected BSS selected")
680 est = dev[0].get_bss(bssid)['est_throughput']
682 raise Exception("Unexpected BSS0 est_throughput: " + est)
684 est = dev[0].get_bss(bssid2)['est_throughput']
686 raise Exception("Unexpected BSS1 est_throughput: " + est)
688 dev[0].request("DISCONNECT")
690 hapd2.request("DISABLE")
691 subprocess.call(['iw', 'reg', 'set', '00'])
692 dev[0].flush_scan_cache()
694 def test_ap_vht80_pwr_constraint(dev, apdev):
695 """VHT with 80 MHz channel width and local power constraint"""
698 params = { "ssid": "vht",
699 "country_code": "FI",
702 "ht_capab": "[HT40+]",
704 "local_pwr_constraint": "3",
707 "vht_oper_chwidth": "1",
708 "vht_oper_centr_freq_seg0_idx": "42" }
709 hapd = hostapd.add_ap(apdev[0], params)
711 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
713 if isinstance(e, Exception) and str(e) == "AP startup failed":
714 if not vht_supported():
715 raise HwsimSkip("80 MHz channel not supported in regulatory information")
718 dev[0].request("DISCONNECT")
720 hapd.request("DISABLE")
721 subprocess.call(['iw', 'reg', 'set', '00'])
722 dev[0].flush_scan_cache()
724 def test_ap_vht_use_sta_nsts(dev, apdev):
725 """VHT with 80 MHz channel width and use_sta_nsts=1"""
728 params = { "ssid": "vht",
729 "country_code": "FI",
732 "ht_capab": "[HT40+]",
735 "vht_oper_chwidth": "1",
736 "vht_oper_centr_freq_seg0_idx": "42",
737 "use_sta_nsts": "1" }
738 hapd = hostapd.add_ap(apdev[0], params)
739 bssid = apdev[0]['bssid']
741 dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
742 hwsim_utils.test_connectivity(dev[0], hapd)
744 if isinstance(e, Exception) and str(e) == "AP startup failed":
745 if not vht_supported():
746 raise HwsimSkip("80 MHz channel not supported in regulatory information")
749 dev[0].request("DISCONNECT")
751 hapd.request("DISABLE")
752 subprocess.call(['iw', 'reg', 'set', '00'])
753 dev[0].flush_scan_cache()