aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 1b7c5a65f2..29100887e3 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -91,9 +91,26 @@ mac80211_hostapd_setup_base() {
case "$htmode" in
HT20) ;;
HT40*|VHT40|VHT80|VHT160)
- case "$(( ($channel / 4) % 2 ))" in
- 1) ht_capab="[HT40+]";;
- 0) ht_capab="[HT40-]";;
+ case "$hwmode" in
+ a)
+ case "$(( ($channel / 4) % 2 ))" in
+ 1) ht_capab="[HT40+]";;
+ 0) ht_capab="[HT40-]";;
+ esac
+ ;;
+ *)
+ case "$htmode" in
+ HT40+) ht_capab="[HT40+]";;
+ HT40-) ht_capab="[HT40-]";;
+ *)
+ if [ "$channel" -lt 7 ]; then
+ ht_capab="[HT40+]"
+ else
+ ht_capab="[HT40-]"
+ fi
+ ;;
+ esac
+ ;;
esac
;;
*) ieee80211n= ;;