mac80211: disable 802.11n support if htmode is not set to HT* or VHT*
authorFelix Fietkau <nbd@openwrt.org>
Sat, 3 May 2014 18:38:16 +0000 (18:38 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 3 May 2014 18:38:16 +0000 (18:38 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40681

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

index e940f1304e98f6f04d37ed87b166139751cdc3ee..c96b4a353be25e01f67a482b1307e87bd75ceb2f 100644 (file)
@@ -67,17 +67,21 @@ mac80211_hostapd_setup_base() {
                json_get_vars noscan htmode
                json_get_values ht_capab_list ht_capab
 
-               append base_cfg "ieee80211n=1" "$N"
-
+               ieee80211n=1
                ht_capab=
                case "$htmode" in
+                       HT20) ;;
                        HT40*|VHT40|VHT80|VHT160)
                                case "$(( ($channel / 4) % 2 ))" in
                                        1) ht_capab="[HT40+]";;
                                        0) ht_capab="[HT40-]";;
                                esac
-                               ;;
+                       ;;
+                       *) ieee80211n= ;;
                esac
+
+               [ -n "$ieee80211n" ] && append base_cfg "ieee80211n=1" "$N"
+
                for cap in $ht_capab_list; do
                        ht_capab="$ht_capab[$cap]"
                done