From d91494eedf06ac6b31c1aa9f7172871b16af96c8 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 14 Nov 2017 12:38:08 +0100 Subject: hostapd: rework frequency/ht/vht selection for ibss/mesh - Remove obsolete patch chunks regarding fixed_freq - Instead of patching in custom HT40+/- parameters, use the standard config syntax as much as possible. - Use fixed_freq for mesh - Fix issues with disabling obss scan when using fixed_freq on mesh Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd.sh | 34 ++++++++++++++++------ .../hostapd/files/wpa_supplicant-full.config | 4 +-- .../hostapd/files/wpa_supplicant-mini.config | 4 +-- .../hostapd/files/wpa_supplicant-p2p.config | 4 +-- 4 files changed, 31 insertions(+), 15 deletions(-) (limited to 'package/network/services/hostapd/files') diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 6e95805e4b..240097648a 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -594,8 +594,31 @@ EOF return 0 } +wpa_supplicant_set_fixed_freq() { + local freq="$1" + local htmode="$2" + + append network_data "fixed_freq=1" "$N$T" + append network_data "frequency=$freq" "$N$T" + case "$htmode" in + NOHT) append network_data "disable_ht=1" "$N$T";; + HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; + HT40*|VHT40*|VHT80*|VHT160*) append network_data "ht40=1" "$N$T";; + esac + case "$htmode" in + VHT*) append network_data "vht=1" "$N$T";; + esac + case "$htmode" in + VHT80) append network_data "max_oper_chwidth=1" "$N$T";; + VHT160) append network_data "max_oper_chwidth=2" "$N$T";; + *) append network_data "max_oper_chwidth=0" "$N$T";; + esac +} + wpa_supplicant_add_network() { local ifname="$1" + local freq="$2" + local htmode="$3" _wpa_supplicant_common "$1" wireless_vif_parse_encryption @@ -617,11 +640,7 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "adhoc" ]] && { append network_data "mode=1" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "fixed_freq=1" "$N$T" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" scan_ssid="scan_ssid=0" @@ -633,10 +652,7 @@ wpa_supplicant_add_network() { ssid="${mesh_id}" append network_data "mode=5" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" append wpa_key_mgmt "SAE" scan_ssid="" } diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index 094741b50e..81fa8f5393 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -179,10 +179,10 @@ CONFIG_SMARTCARD=y #CONFIG_PCSC=y # Support HT overrides (disable HT/HT40, mask MCS rates, etc.) -#CONFIG_HT_OVERRIDES=y +CONFIG_HT_OVERRIDES=y # Support VHT overrides (disable VHT, mask MCS rates, etc.) -#CONFIG_VHT_OVERRIDES=y +CONFIG_VHT_OVERRIDES=y # Development testing #CONFIG_EAPOL_TEST=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-mini.config b/package/network/services/hostapd/files/wpa_supplicant-mini.config index 3e9a661056..3e088715c8 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-mini.config +++ b/package/network/services/hostapd/files/wpa_supplicant-mini.config @@ -179,10 +179,10 @@ CONFIG_DRIVER_WIRED=y #CONFIG_PCSC=y # Support HT overrides (disable HT/HT40, mask MCS rates, etc.) -#CONFIG_HT_OVERRIDES=y +CONFIG_HT_OVERRIDES=y # Support VHT overrides (disable VHT, mask MCS rates, etc.) -#CONFIG_VHT_OVERRIDES=y +CONFIG_VHT_OVERRIDES=y # Development testing #CONFIG_EAPOL_TEST=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-p2p.config b/package/network/services/hostapd/files/wpa_supplicant-p2p.config index de6055137b..420aebcf98 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-p2p.config +++ b/package/network/services/hostapd/files/wpa_supplicant-p2p.config @@ -179,10 +179,10 @@ CONFIG_SMARTCARD=y #CONFIG_PCSC=y # Support HT overrides (disable HT/HT40, mask MCS rates, etc.) -#CONFIG_HT_OVERRIDES=y +CONFIG_HT_OVERRIDES=y # Support VHT overrides (disable VHT, mask MCS rates, etc.) -#CONFIG_VHT_OVERRIDES=y +CONFIG_VHT_OVERRIDES=y # Development testing #CONFIG_EAPOL_TEST=y -- cgit v1.2.3