aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/files/lib
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-05-03 18:44:32 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-05-03 18:44:32 +0000
commit4bd862a3005bbc20573ddd0172d2d0bcd46ae4df (patch)
tree72d3be3a31030bf3dfafec3a1fe6c8c9fa4fc3d7 /package/kernel/mac80211/files/lib
parent54625965c4cae72bafa5bdd293e013ed3c6f7e15 (diff)
downloadupstream-4bd862a3005bbc20573ddd0172d2d0bcd46ae4df.tar.gz
upstream-4bd862a3005bbc20573ddd0172d2d0bcd46ae4df.tar.bz2
upstream-4bd862a3005bbc20573ddd0172d2d0bcd46ae4df.zip
mac80211: add automatic ht40 mode handling for 2.4 ghz
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 40684
Diffstat (limited to 'package/kernel/mac80211/files/lib')
-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= ;;