summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/wifi/hostapd.conf.tmpl14
-rw-r--r--interface-definitions/interfaces-wireless.xml.in4
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py4
3 files changed, 19 insertions, 3 deletions
diff --git a/data/templates/wifi/hostapd.conf.tmpl b/data/templates/wifi/hostapd.conf.tmpl
index bd2132b27..2884110d4 100644
--- a/data/templates/wifi/hostapd.conf.tmpl
+++ b/data/templates/wifi/hostapd.conf.tmpl
@@ -391,14 +391,26 @@ vht_capab=
{%- endif -%}
{%- if cap_vht_antenna_cnt -%}
+{%- if cap_vht_antenna_cnt|int > 1 -%}
+{%- if cap_vht_beamform -%}
{%- for beamform in cap_vht_beamform -%}
{%- if 'single-user-beamformer' in beamform -%}
+{%- if cap_vht_antenna_cnt|int < 6 -%}
[BF-ANTENNA-{{ cap_vht_antenna_cnt|int -1 }}][SOUNDING-DIMENSION-{{ cap_vht_antenna_cnt|int -1}}]
+{%- endif -%}
{%- else -%}
+{%- if cap_vht_antenna_cnt|int < 5 -%}
[BF-ANTENNA-{{ cap_vht_antenna_cnt }}][SOUNDING-DIMENSION-{{ cap_vht_antenna_cnt }}]
{%- endif -%}
+{%- endif -%}
{%- endfor -%}
-{%- endif %}
+{%- else -%}
+{%- if cap_vht_antenna_cnt|int < 5 -%}
+[BF-ANTENNA-{{ cap_vht_antenna_cnt }}][SOUNDING-DIMENSION-{{ cap_vht_antenna_cnt }}]
+{%- endif -%}
+{%- endif -%}
+{%- endif -%}
+{%- endif -%}
# ieee80211n: Whether IEEE 802.11n (HT) is enabled
# 0 = disabled (default)
diff --git a/interface-definitions/interfaces-wireless.xml.in b/interface-definitions/interfaces-wireless.xml.in
index 490e63a42..194669f77 100644
--- a/interface-definitions/interfaces-wireless.xml.in
+++ b/interface-definitions/interfaces-wireless.xml.in
@@ -208,11 +208,11 @@
<properties>
<help>Number of antennas on this card</help>
<valueHelp>
- <format>1-9</format>
+ <format>1-8</format>
<description>Number of antennas for this card</description>
</valueHelp>
<constraint>
- <validator name="numeric" argument="--range 1-9"/>
+ <validator name="numeric" argument="--range 1-8"/>
</constraint>
</properties>
</leafNode>
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index bf8552bc1..da8470f7e 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -584,6 +584,10 @@ def verify(wifi):
if wifi['cap_vht_beamform'] and wifi['cap_vht_antenna_cnt'] == 1:
raise ConfigError('Cannot use beam forming with just one antenna!')
+ if wifi['cap_vht_beamform'] == 'single-user-beamformer' and wifi['cap_vht_antenna_cnt'] < 3:
+ # Nasty Gotcha: see https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf lines 692-705
+ raise ConfigError('Single-user beam former requires at least 3 antennas!')
+
if wifi['sec_wep'] and (len(wifi['sec_wep_key']) == 0):
raise ConfigError('Missing WEP keys')