Skip to content

Commit 6b57f03

Browse files
alainlamarmergify[bot]
authored andcommitted
T6693: wireless: Enable WiFi-6 (802.11ax) for 2.4GHz AccessPoints
(cherry picked from commit 194a14e)
1 parent dc1da7c commit 6b57f03

File tree

3 files changed

+151
-18
lines changed

3 files changed

+151
-18
lines changed

data/templates/wifi/hostapd.conf.j2

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ hw_mode=a
4646
ieee80211h=1
4747
ieee80211ac=1
4848
{% elif mode is vyos_defined('ax') %}
49+
{#{% if capabilities.ht is vyos_defined and capabilities.vht not vyos_defined %}#}
50+
{% if capabilities.he.channel_set_width is vyos_defined('81') or capabilities.he.channel_set_width is vyos_defined('83') or capabilities.he.channel_set_width is vyos_defined('84') %}
51+
{# This is almost certainly a 2.4GHz network #}
52+
hw_mode=g
53+
{% else %}
54+
{# This is likely a 5GHz or 6GHz network #}
4955
hw_mode=a
56+
{% endif %}
5057
ieee80211h=1
5158
ieee80211ax=1
5259
{% else %}
@@ -202,7 +209,7 @@ require_he=1
202209
{% else %}
203210
ieee80211n={{ '1' if 'n' in mode or 'ac' in mode or 'ax' in mode else '0' }}
204211
{% endif %}
205-
{# HE (802.11ax 6GHz) #}
212+
{# HE (802.11ax) #}
206213
{% if capabilities.he is vyos_defined and mode in 'ax' %}
207214
{# For now, hard-code power levels for indoor-only AP #}
208215
he_6ghz_reg_pwr_type=0
@@ -220,6 +227,9 @@ op_class={{ capabilities.he.channel_set_width }}
220227
{% if capabilities.he.bss_color is vyos_defined %}
221228
he_bss_color={{ capabilities.he.bss_color }}
222229
{% endif %}
230+
{% if capabilities.he.coding_scheme is vyos_defined %}
231+
he_basic_mcs_nss_set={{ capabilities.he.coding_scheme }}
232+
{% endif %}
223233
he_6ghz_rx_ant_pat={{ '1' if capabilities.he.antenna_pattern_fixed is vyos_defined else '0' }}
224234
he_su_beamformer={{ '1' if capabilities.he.beamform.single_user_beamformer is vyos_defined else '0' }}
225235
he_su_beamformee={{ '1' if capabilities.he.beamform.single_user_beamformee is vyos_defined else '0' }}

interface-definitions/interfaces_wireless.xml.in

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,26 @@
248248
<properties>
249249
<help>VHT operating channel center frequency - center freq 1 (for use with 80, 80+80 and 160 modes)</help>
250250
<valueHelp>
251-
<format>u32:34-173</format>
251+
<format>u32:34-177</format>
252252
<description>5Ghz (802.11 a/h/j/n/ac) center channel index (use 42 for primary 80MHz channel 36)</description>
253253
</valueHelp>
254254
<constraint>
255-
<validator name="numeric" argument="--range 34-173"/>
255+
<validator name="numeric" argument="--range 34-177"/>
256256
</constraint>
257-
<constraintErrorMessage>Channel center value must be between 34 and 173</constraintErrorMessage>
257+
<constraintErrorMessage>Channel center value must be between 34 and 177</constraintErrorMessage>
258258
</properties>
259259
</leafNode>
260260
<leafNode name="freq-2">
261261
<properties>
262262
<help>VHT operating channel center frequency - center freq 2 (for use with the 80+80 mode)</help>
263263
<valueHelp>
264-
<format>u32:34-173</format>
264+
<format>u32:34-177</format>
265265
<description>5Ghz (802.11 ac) center channel index (use 58 for secondary 80MHz channel 52)</description>
266266
</valueHelp>
267267
<constraint>
268-
<validator name="numeric" argument="--range 34-173"/>
268+
<validator name="numeric" argument="--range 34-177"/>
269269
</constraint>
270-
<constraintErrorMessage>Channel center value must be between 34 and 173</constraintErrorMessage>
270+
<constraintErrorMessage>Channel center value must be between 34 and 177</constraintErrorMessage>
271271
</properties>
272272
</leafNode>
273273
</children>
@@ -436,30 +436,42 @@
436436
https://w1.fi/cgit/hostap/tree/src/common/ieee802_11_common.c?id=195cc3d919503fb0d699d9a56a58a72602b25f51#n1525
437437
802.11ax (WiFi-6e - HE) can use up to 160MHz bandwidth channels
438438
-->
439-
<list>131 132 133 134 135</list>
439+
<list>81 83 84 131 132 133 134 135</list>
440440
</completionHelp>
441+
<valueHelp>
442+
<format>81</format>
443+
<description>2.4GHz, 20 MHz channel width</description>
444+
</valueHelp>
445+
<valueHelp>
446+
<format>83</format>
447+
<description>2.4GHz, 40 MHz channel width, secondary 20MHz channel above primary channel</description>
448+
</valueHelp>
449+
<valueHelp>
450+
<format>84</format>
451+
<description>2.4GHz, 40 MHz channel width, secondary 20MHz channel below primary channel</description>
452+
</valueHelp>
441453
<valueHelp>
442454
<format>131</format>
443-
<description>20 MHz channel width</description>
455+
<description>6GHz, 20 MHz channel width</description>
444456
</valueHelp>
445457
<valueHelp>
446458
<format>132</format>
447-
<description>40 MHz channel width</description>
459+
<description>6GHz, 40 MHz channel width</description>
448460
</valueHelp>
449461
<valueHelp>
450462
<format>133</format>
451-
<description>80 MHz channel width</description>
463+
<description>6GHz, 80 MHz channel width</description>
452464
</valueHelp>
453465
<valueHelp>
454466
<format>134</format>
455-
<description>160 MHz channel width</description>
467+
<description>6GHz, 160 MHz channel width</description>
456468
</valueHelp>
457469
<valueHelp>
458470
<format>135</format>
459-
<description>80+80 MHz channel width</description>
471+
<description>6GHz, 80+80 MHz channel width</description>
460472
</valueHelp>
461473
<constraint>
462-
<regex>(131|132|133|134|135)</regex>
474+
<regex>(81|83|84|131|132|133|134|135)</regex>
463475
</constraint>
464476
</properties>
465477
</leafNode>
@@ -535,6 +547,30 @@
535547
</constraint>
536548
</properties>
537549
</leafNode>
550+
<leafNode name="coding-scheme">
551+
<properties>
552+
<help>Spacial Stream and Modulation Coding Scheme settings</help>
553+
<valueHelp>
554+
<format>u32:0</format>
555+
<description>HE-MCS 0-7</description>
556+
</valueHelp>
557+
<valueHelp>
558+
<format>u32:1</format>
559+
<description>HE-MCS 0-9</description>
560+
</valueHelp>
561+
<valueHelp>
562+
<format>u32:2</format>
563+
<description>HE-MCS 0-11</description>
564+
</valueHelp>
565+
<valueHelp>
566+
<format>u32:3</format>
567+
<description>HE-MCS is not supported</description>
568+
</valueHelp>
569+
<constraint>
570+
<validator name="numeric" argument="--range 0-3"/>
571+
</constraint>
572+
</properties>
573+
</leafNode>
538574
</children>
539575
</node>
540576
<leafNode name="require-he">
@@ -554,18 +590,18 @@
554590
</valueHelp>
555591
<valueHelp>
556592
<format>u32:1-14</format>
557-
<description>2.4Ghz (802.11 b/g/n) Channel</description>
593+
<description>2.4Ghz (802.11 b/g/n/ax) Channel</description>
558594
</valueHelp>
559595
<valueHelp>
560-
<format>u32:34-173</format>
596+
<format>u32:34-177</format>
561597
<description>5Ghz (802.11 a/h/j/n/ac) Channel</description>
562598
</valueHelp>
563599
<valueHelp>
564600
<format>u32:1-233</format>
565601
<description>6Ghz (802.11 ax) Channel</description>
566602
</valueHelp>
567603
<constraint>
568-
<validator name="numeric" argument="--range 0-0 --range 1-14 --range 34-173 --range 1-233"/>
604+
<validator name="numeric" argument="--range 0-0 --range 1-14 --range 34-177 --range 1-233"/>
569605
</constraint>
570606
</properties>
571607
<defaultValue>0</defaultValue>

smoketest/scripts/cli/test_interfaces_wireless.py

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,89 @@ def test_wireless_hostapd_vht_su_beamformer_config(self):
303303
for key, value in vht_opt.items():
304304
self.assertIn(value, tmp)
305305

306-
def test_wireless_hostapd_he_config(self):
306+
def test_wireless_hostapd_he_2ghz_config(self):
307+
# Only set the hostapd (access-point) options - HE mode for 802.11ax at 2.4GHz
308+
interface = self._interfaces[1] # wlan1
309+
ssid = 'ssid'
310+
channel = '1'
311+
sae_pw = 'VyOSVyOSVyOS'
312+
bss_color = '13'
313+
channel_set_width = '81'
314+
315+
self.cli_set(self._base_path + [interface, 'ssid', ssid])
316+
self.cli_set(self._base_path + [interface, 'type', 'access-point'])
317+
self.cli_set(self._base_path + [interface, 'channel', channel])
318+
self.cli_set(self._base_path + [interface, 'mode', 'ax'])
319+
self.cli_set(self._base_path + [interface, 'security', 'wpa', 'mode', 'wpa2'])
320+
self.cli_set(self._base_path + [interface, 'security', 'wpa', 'passphrase', sae_pw])
321+
self.cli_set(self._base_path + [interface, 'security', 'wpa', 'cipher', 'CCMP'])
322+
self.cli_set(self._base_path + [interface, 'security', 'wpa', 'cipher', 'GCMP'])
323+
self.cli_set(self._base_path + [interface, 'capabilities', 'ht', '40mhz-incapable'])
324+
self.cli_set(self._base_path + [interface, 'capabilities', 'ht', 'channel-set-width', 'ht20'])
325+
self.cli_set(self._base_path + [interface, 'capabilities', 'ht', 'channel-set-width', 'ht40+'])
326+
self.cli_set(self._base_path + [interface, 'capabilities', 'ht', 'channel-set-width', 'ht40-'])
327+
self.cli_set(self._base_path + [interface, 'capabilities', 'ht', 'short-gi', '20'])
328+
self.cli_set(self._base_path + [interface, 'capabilities', 'ht', 'short-gi', '40'])
329+
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'bss-color', bss_color])
330+
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'channel-set-width', channel_set_width])
331+
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'beamform', 'multi-user-beamformer'])
332+
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'beamform', 'single-user-beamformer'])
333+
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'beamform', 'single-user-beamformee'])
334+
335+
self.cli_commit()
336+
337+
#
338+
# Validate Config
339+
#
340+
tmp = get_config_value(interface, 'interface')
341+
self.assertEqual(interface, tmp)
342+
343+
# ssid
344+
tmp = get_config_value(interface, 'ssid')
345+
self.assertEqual(ssid, tmp)
346+
347+
# mode of operation resulting from [interface, 'mode', 'ax']
348+
tmp = get_config_value(interface, 'hw_mode')
349+
self.assertEqual('g', tmp)
350+
tmp = get_config_value(interface, 'ieee80211h')
351+
self.assertEqual('1', tmp)
352+
tmp = get_config_value(interface, 'ieee80211ax')
353+
self.assertEqual('1', tmp)
354+
355+
# channel and channel width
356+
tmp = get_config_value(interface, 'channel')
357+
self.assertEqual(channel, tmp)
358+
tmp = get_config_value(interface, 'op_class')
359+
self.assertEqual(channel_set_width, tmp)
360+
361+
# BSS coloring
362+
tmp = get_config_value(interface, 'he_bss_color')
363+
self.assertEqual(bss_color, tmp)
364+
365+
# sae_password
366+
tmp = get_config_value(interface, 'wpa_passphrase')
367+
self.assertEqual(sae_pw, tmp)
368+
369+
# WPA3 and dependencies
370+
tmp = get_config_value(interface, 'wpa')
371+
self.assertEqual('2', tmp)
372+
tmp = get_config_value(interface, 'rsn_pairwise')
373+
self.assertEqual('CCMP GCMP', tmp)
374+
tmp = get_config_value(interface, 'wpa_key_mgmt')
375+
self.assertEqual('WPA-PSK WPA-PSK-SHA256', tmp)
376+
377+
# beamforming
378+
tmp = get_config_value(interface, 'he_mu_beamformer')
379+
self.assertEqual('1', tmp)
380+
tmp = get_config_value(interface, 'he_su_beamformee')
381+
self.assertEqual('1', tmp)
382+
tmp = get_config_value(interface, 'he_mu_beamformer')
383+
self.assertEqual('1', tmp)
384+
385+
# Check for running process
386+
self.assertTrue(process_named_running('hostapd'))
387+
388+
def test_wireless_hostapd_he_6ghz_config(self):
307389
# Only set the hostapd (access-point) options - HE mode for 802.11ax at 6GHz
308390
interface = self._interfaces[1] # wlan1
309391
ssid = 'ssid'
@@ -327,6 +409,7 @@ def test_wireless_hostapd_he_config(self):
327409
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'bss-color', bss_color])
328410
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'channel-set-width', channel_set_width])
329411
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'center-channel-freq', 'freq-1', center_channel_freq_1])
412+
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'antenna-pattern-fixed'])
330413
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'beamform', 'multi-user-beamformer'])
331414
self.cli_set(self._base_path + [interface, 'capabilities', 'he', 'beamform', 'single-user-beamformer'])
332415

@@ -374,6 +457,10 @@ def test_wireless_hostapd_he_config(self):
374457
tmp = get_config_value(interface, 'wpa_key_mgmt')
375458
self.assertEqual('SAE', tmp)
376459

460+
# antenna pattern
461+
tmp = get_config_value(interface, 'he_6ghz_rx_ant_pat')
462+
self.assertEqual('1', tmp)
463+
377464
# beamforming
378465
tmp = get_config_value(interface, 'he_mu_beamformer')
379466
self.assertEqual('1', tmp)

0 commit comments

Comments
 (0)