From: Felix Fietkau Date: Sat, 3 May 2014 18:44:32 +0000 (+0000) Subject: mac80211: add automatic ht40 mode handling for 2.4 ghz X-Git-Tag: v19.07.0-rc1~17969 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4bd862a3005bbc20573ddd0172d2d0bcd46ae4df;p=openwrt%2Fstaging%2Fhauke.git mac80211: add automatic ht40 mode handling for 2.4 ghz Signed-off-by: Felix Fietkau SVN-Revision: 40684 --- 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= ;;