mac80211: fill some important capabilities into ht_capab in the hostapd config
[openwrt/svn-archive/archive.git] / package / hostapd / files / hostapd.sh
index 9d0fb60549aae1bb8f2f187f5507786ac662dddc..2210a46aff82f4f725d7b1595657791625d30fb0 100644 (file)
@@ -89,6 +89,9 @@ hostapd_setup_vif() {
                [ -n "$hwmode_11n" ] && {
                        hwmode="$hwmode_11n"
                        config_get ht_capab "$device" ht_capab
+                       [ -n "$ht_capab" -a -n "${ht_capab%%\[*}" ] && {
+                               ht_capab=`echo "[$ht_capab]" | sed -e 's, ,][,g'`
+                       }
                }
        }
        cat > /var/run/hostapd-$ifname.conf <<EOF
@@ -107,6 +110,12 @@ ${ht_capab:+ht_capab=$ht_capab}
 ${wpa_group_rekey:+wpa_group_rekey=$wpa_group_rekey}
 ${ieee80211d:+ieee80211d=$ieee80211d}
 $hostapd_cfg
+EOF
+       case "$driver" in
+               madwifi)
+               ;;
+               *) 
+                       cat >> /var/run/hostapd-$ifname.conf <<EOF
 wme_enabled=1
 wme_ac_bk_cwmin=4
 wme_ac_bk_cwmax=10
@@ -145,6 +154,8 @@ tx_queue_data0_cwmin=3
 tx_queue_data0_cwmax=7
 tx_queue_data0_burst=1.5
 EOF
+               ;;
+       esac
        hostapd -P /var/run/wifi-$ifname.pid -B /var/run/hostapd-$ifname.conf
 }