From 4d2b913699a2a9a0077381996e00bc443c9811d2 Mon Sep 17 00:00:00 2001 From: Dongming Han Date: Fri, 15 Jul 2022 12:11:35 +0800 Subject: [PATCH] enable 2.4G vht source: https://github.com/coolsnowwolf/lede --- .../mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++-- .../patches/ath/983-ath10k-allow-vht-on-2g.patch | 10 ++++++++++ package/network/services/hostapd/files/hostapd.sh | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 package/kernel/mac80211/patches/ath/983-ath10k-allow-vht-on-2g.patch diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index d69667bf8c..8b3a37c81c 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -138,7 +138,7 @@ mac80211_hostapd_setup_base() { [ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=1" "$N" - json_get_vars noscan ht_coex + json_get_vars noscan ht_coex vendor_vht json_get_values ht_capab_list ht_capab tx_burst json_get_values channel_list channels @@ -284,7 +284,7 @@ mac80211_hostapd_setup_base() { } [ "$hwmode" = "a" ] || enable_ac=0 - if [ "$enable_ac" != "0" ]; then + if [ "$enable_ac" != "0" -o "$vendor_vht" = "1" ]; then json_get_vars \ rxldpc:1 \ short_gi_80:1 \ diff --git a/package/kernel/mac80211/patches/ath/983-ath10k-allow-vht-on-2g.patch b/package/kernel/mac80211/patches/ath/983-ath10k-allow-vht-on-2g.patch new file mode 100644 index 0000000000..78a09b9ae1 --- /dev/null +++ b/package/kernel/mac80211/patches/ath/983-ath10k-allow-vht-on-2g.patch @@ -0,0 +1,10 @@ +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -4841,6 +4841,7 @@ static void ath10k_mac_setup_ht_vht_cap( + if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) { + band = &ar->mac.sbands[NL80211_BAND_2GHZ]; + band->ht_cap = ht_cap; ++ band->vht_cap = vht_cap; + } + if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) { + band = &ar->mac.sbands[NL80211_BAND_5GHZ]; diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index fe6af98f4d..21da6903d6 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -108,6 +108,7 @@ hostapd_common_add_device_config() { config_add_int rssi_reject_assoc_rssi config_add_int rssi_ignore_probe_request config_add_int maxassoc + config_add_boolean vendor_vht config_add_string acs_chan_bias config_add_array hostapd_options @@ -125,7 +126,7 @@ hostapd_prepare_device_config() { json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ - rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc + rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc vendor_vht hostapd_set_log_options base_cfg @@ -194,6 +195,7 @@ hostapd_prepare_device_config() { set_default rate_list "24000 36000 48000 54000" set_default basic_rate_list "24000" fi + [ -n "$vendor_vht" ] && append base_cfg "vendor_vht=$vendor_vht" "$N" ;; a) if [ "$cell_density" -eq 1 ]; then -- 2.17.1