X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Ffunctions%2Ffunctions.hostapd;h=a3c34920aeb5ce3fb43615d9c55ebebe0d74f773;hb=b6ec3dd6413122208013d82321687a77a2aec083;hp=f7bf2fa58bc343ec379a5acc3ecfe52e8a0d1fd7;hpb=d1e6ce67bc7fc8a77dacec1a9f455f7d36667079;p=people%2Fms%2Fnetwork.git diff --git a/src/functions/functions.hostapd b/src/functions/functions.hostapd index f7bf2fa5..a3c34920 100644 --- a/src/functions/functions.hostapd +++ b/src/functions/functions.hostapd @@ -35,7 +35,6 @@ hostapd_config_write() { local channel local country_code="$(wireless_get_reg_domain)" local encryption - local ieee80211d="1" local key local mode local ssid @@ -44,30 +43,22 @@ hostapd_config_write() { while [ $# -gt 0 ]; do case "${1}" in --broadcast-ssid=*) - broadcast_ssid=$(cli_get_val ${1}) + broadcast_ssid=$(cli_get_val "${1}") ;; --channel=*) - channel=$(cli_get_val ${1}) + channel=$(cli_get_val "${1}") ;; --encryption=*) - encryption=$(cli_get_val ${1}) - ;; - --ieee80211d=*) - local val="$(cli_get_val "${1}")" - if enabled val; then - ieee80211d="1" - else - ieee80211d="0" - fi + encryption=$(cli_get_val "${1}") ;; --key=*) - key=$(cli_get_val ${1}) + key=$(cli_get_val "${1}") ;; --mode=*) - mode=$(cli_get_val ${1}) + mode=$(cli_get_val "${1}") ;; --ssid=*) - ssid=$(cli_get_val ${1}) + ssid=$(cli_get_val "${1}") ;; --wmm=*) local val="$(cli_get_val "${1}")" @@ -99,6 +90,12 @@ hostapd_config_write() { assert isset key fi + # Get VHT caps + local vht_caps="$(wireless_get_vht_caps "${device}")" + + # Get HT caps + local ht_caps="$(wireless_get_ht_caps "${device}")" + # Create configuration directory. local config_dir=$(dirname ${file}) mkdir -p ${HOSTAPD_CONTROL_INTERFACE_DIR} ${config_dir} 2>/dev/null @@ -134,11 +131,15 @@ hostapd_config_write() { fi ( + print "# Default settings" + + # Advertise country code and maximum transmission power + print "ieee80211d=1" + print "# Wireless configuration" print "channel=${channel}" print "country_code=${country_code}" print "hw_mode=${hw_mode}" - print "ieee80211d=${ieee80211d}" print "ieee80211n=${ieee80211n}" print "ignore_broadcast_ssid=${ignore_broadcast_ssid}" @@ -151,6 +152,14 @@ hostapd_config_write() { # WMM print "wmm_enabled=${wmm}" + # Enable VHT caps + if isset vht_caps; then + print "vht_capab=${vht_caps}" + fi + + # Enable HT caps + print "ht_capab=${ht_caps}" + print ) >> ${file}