wifi-scripts: mac80211.sh: allow EHT* sets
Allow to configure 80211BE. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
This commit is contained in:
parent
d1fc8c3db0
commit
42185bf429
1 changed files with 82 additions and 70 deletions
|
@ -159,11 +159,12 @@ mac80211_hostapd_setup_base() {
|
||||||
chan_ofs=0
|
chan_ofs=0
|
||||||
[ "$band" = "6g" ] && chan_ofs=1
|
[ "$band" = "6g" ] && chan_ofs=1
|
||||||
|
|
||||||
|
if [ "$band" != "6g" ]; then
|
||||||
ieee80211n=1
|
ieee80211n=1
|
||||||
ht_capab=
|
ht_capab=
|
||||||
case "$htmode" in
|
case "$htmode" in
|
||||||
VHT20|HT20|HE20) ;;
|
VHT20|HT20|HE20|EHT20) ;;
|
||||||
HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160)
|
HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160|EHT40|EHT80|EHT160)
|
||||||
case "$hwmode" in
|
case "$hwmode" in
|
||||||
a)
|
a)
|
||||||
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
|
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
|
||||||
|
@ -230,6 +231,7 @@ mac80211_hostapd_setup_base() {
|
||||||
ht_capab="$ht_capab$ht_capab_flags"
|
ht_capab="$ht_capab$ht_capab_flags"
|
||||||
[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
|
[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
# 802.11ac
|
# 802.11ac
|
||||||
enable_ac=0
|
enable_ac=0
|
||||||
|
@ -238,8 +240,8 @@ mac80211_hostapd_setup_base() {
|
||||||
|
|
||||||
idx="$channel"
|
idx="$channel"
|
||||||
case "$htmode" in
|
case "$htmode" in
|
||||||
VHT20|HE20) enable_ac=1;;
|
VHT20|HE20|EHT20) enable_ac=1;;
|
||||||
VHT40|HE40)
|
VHT40|HE40|EHT40)
|
||||||
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
|
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
|
||||||
1) idx=$(($channel + 2));;
|
1) idx=$(($channel + 2));;
|
||||||
0) idx=$(($channel - 2));;
|
0) idx=$(($channel - 2));;
|
||||||
|
@ -247,7 +249,7 @@ mac80211_hostapd_setup_base() {
|
||||||
enable_ac=1
|
enable_ac=1
|
||||||
vht_center_seg0=$idx
|
vht_center_seg0=$idx
|
||||||
;;
|
;;
|
||||||
VHT80|HE80)
|
VHT80|HE80|EHT80)
|
||||||
case "$(( (($channel / 4) + $chan_ofs) % 4 ))" in
|
case "$(( (($channel / 4) + $chan_ofs) % 4 ))" in
|
||||||
1) idx=$(($channel + 6));;
|
1) idx=$(($channel + 6));;
|
||||||
2) idx=$(($channel + 2));;
|
2) idx=$(($channel + 2));;
|
||||||
|
@ -258,7 +260,7 @@ mac80211_hostapd_setup_base() {
|
||||||
vht_oper_chwidth=1
|
vht_oper_chwidth=1
|
||||||
vht_center_seg0=$idx
|
vht_center_seg0=$idx
|
||||||
;;
|
;;
|
||||||
VHT160|HE160)
|
VHT160|HE160|EHT160)
|
||||||
if [ "$band" = "6g" ]; then
|
if [ "$band" = "6g" ]; then
|
||||||
case "$channel" in
|
case "$channel" in
|
||||||
1|5|9|13|17|21|25|29) idx=15;;
|
1|5|9|13|17|21|25|29) idx=15;;
|
||||||
|
@ -289,8 +291,8 @@ mac80211_hostapd_setup_base() {
|
||||||
[ "$band" = "6g" ] && {
|
[ "$band" = "6g" ] && {
|
||||||
op_class=
|
op_class=
|
||||||
case "$htmode" in
|
case "$htmode" in
|
||||||
HE20) op_class=131;;
|
HE20|EHT20) op_class=131;;
|
||||||
HE*) op_class=$((132 + $vht_oper_chwidth))
|
HE*|EHT*) op_class=$((132 + $vht_oper_chwidth));;
|
||||||
esac
|
esac
|
||||||
[ -n "$op_class" ] && append base_cfg "op_class=$op_class" "$N"
|
[ -n "$op_class" ] && append base_cfg "op_class=$op_class" "$N"
|
||||||
}
|
}
|
||||||
|
@ -417,8 +419,10 @@ mac80211_hostapd_setup_base() {
|
||||||
|
|
||||||
# 802.11ax
|
# 802.11ax
|
||||||
enable_ax=0
|
enable_ax=0
|
||||||
|
enable_be=0
|
||||||
case "$htmode" in
|
case "$htmode" in
|
||||||
HE*) enable_ax=1 ;;
|
HE*) enable_ax=1 ;;
|
||||||
|
EHT*) enable_ax=1; enable_be=1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$enable_ax" != "0" ]; then
|
if [ "$enable_ax" != "0" ]; then
|
||||||
|
@ -492,6 +496,14 @@ mac80211_hostapd_setup_base() {
|
||||||
append base_cfg "he_mu_edca_ac_vo_timer=255" "$N"
|
append base_cfg "he_mu_edca_ac_vo_timer=255" "$N"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$enable_be" != "0" ]; then
|
||||||
|
append base_cfg "ieee80211be=1" "$N"
|
||||||
|
[ "$hwmode" = "a" ] && {
|
||||||
|
append base_cfg "eht_oper_chwidth=$vht_oper_chwidth" "$N"
|
||||||
|
append base_cfg "eht_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
hostapd_prepare_device_config "$hostapd_conf_file" nl80211
|
hostapd_prepare_device_config "$hostapd_conf_file" nl80211
|
||||||
cat >> "$hostapd_conf_file" <<EOF
|
cat >> "$hostapd_conf_file" <<EOF
|
||||||
${channel:+channel=$channel}
|
${channel:+channel=$channel}
|
||||||
|
|
Loading…
Reference in a new issue