From: Matti Laakso malaa...@elisanet.fi
This patch introduces 802.11ac support to base-files, mac80211 and hostapd. The
split of VHT160 in two 80 MHz bands is not yet supported, since it requires an
additional user supplied parameter for the channel of the second band.
Signed-off-by: Matti Laakso malaa...@elisanet.fi
Signed-off-by: Simon Wunderlich si...@open-mesh.com
[s...@open-mesh.com: Rebased patch, renamed hwmode to ac,
fixed hostapd integration]
Signed-off-by: Sven Eckelmann s...@open-mesh.com
---
package/base-files/files/sbin/wifi | 9 +++-
.../mac80211/files/lib/netifd/wireless/mac80211.sh | 43 ++
package/kernel/mac80211/files/lib/wifi/mac80211.sh | 51 +-
.../config/netifd/patches/002-vht_support.patch| 42 ++
.../services/hostapd/files/hostapd-full.config | 3 ++
.../services/hostapd/files/hostapd-mini.config | 3 ++
6 files changed, 148 insertions(+), 3 deletions(-)
create mode 100644 package/network/config/netifd/patches/002-vht_support.patch
diff --git a/package/base-files/files/sbin/wifi
b/package/base-files/files/sbin/wifi
index 051bc89..2c6de96 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -72,7 +72,7 @@ prepare_key_wep() {
wifi_fixup_hwmode() {
local device=$1
local default=$2
- local hwmode hwmode_11n
+ local hwmode hwmode_11n hwmode_11ac
config_get channel $device channel
config_get hwmode $device hwmode
@@ -89,6 +89,12 @@ wifi_fixup_hwmode() {
esac
config_set $device hwmode_11n $hwmode_11n
;;
+ 11ac)
+ hwmode_11n=a
+ hwmode_11ac=a
+ config_set $device hwmode_11n $hwmode_11n
+ config_set $device hwmode_11ac $hwmode_11ac
+ ;;
*)
hwmode=
if [ ${channel:-0} -gt 0 ]; then
@@ -203,6 +209,7 @@ scan_wifi() {
append DEVICES $section
config_set $section vifs
config_set $section ht_capab
+ config_set $section vht_capab
;;
esac
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 1896fe0..301ec22 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -23,6 +23,7 @@ drv_mac80211_init_device_config() {
config_add_int rxantenna txantenna antenna_gain txpower
config_add_boolean noscan
config_add_array ht_capab
+ config_add_array vht_capab
}
drv_mac80211_init_iface_config() {
@@ -63,6 +64,48 @@ mac80211_hostapd_setup_base() {
[ -n $ht_capab ] append base_cfg ht_capab=$ht_capab $N
}
+ [ $enable_vht -gt 0 ] {
+ append base_cfg ieee80211ac=1 $N
+
+ json_get_values vht_capab_list vht_capab
+ idx=$channel
+ case $vhtmode in
+ VHT80)
+ case $channel in
+ 36|40|44|48) idx=42;;
+ 52|56|60|64) idx=58;;
+ 100|104|108|112) idx=106;;
+ 116|120|124|128) idx=122;;
+ 132|136|140|144) idx=138;;
+ 149|153|157|161) idx=155;;
+ esac
+ append base_cfg vht_oper_chwidth=1 $N
+ append base_cfg
vht_oper_centr_freq_seg0_idx=$idx $N
+ ;;
+ VHT160)
+ case $channel in
+ 36|40|44|48|52|56|60|64) idx=50;;
+ 100|104|108|112|116|120|124|128)
idx=114;;
+ esac
+ append base_cfg vht_oper_chwidth=2 $N
+ append base_cfg
vht_oper_centr_freq_seg0_idx=$idx $N
+ ;;
+ *)
+ case $htmode in
+ HT20) ;;
+ HT40+) idx=$((idx+2));;
+ HT40-) idx=$((idx-2));;
+ esac
+ append base_cfg vht_oper_chwidth=0 $N
+ append base_cfg
vht_oper_centr_freq_seg0_idx=$idx $N
+ ;;
+ esac
+ for cap in $vht_capab_list; do
+