mac80211: add automatic ht40 mode handling for 2.4 ghz
authorFelix Fietkau <nbd@openwrt.org>
Sat, 3 May 2014 18:44:32 +0000 (18:44 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 3 May 2014 18:44:32 +0000 (18:44 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40684

package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh

index 1b7c5a65f26191ef4acf34d849058391d317dfff..29100887e36e6fdc6d6c8a3f165802085fd8fe0d 100644 (file)
@@ -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= ;;