From: Travis Kemen Date: Thu, 15 Mar 2007 03:21:35 +0000 (+0000) Subject: added TXpower, antenna diversity, distance, backround scan, PSK and PSK2 settings... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2873adfe53d35afda5176a8d1c7dfd296ef625e8;p=openwrt%2Fstaging%2Fldir.git added TXpower, antenna diversity, distance, backround scan, PSK and PSK2 settings, from #1287 #1255 SVN-Revision: 6567 --- diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 10e8ab1c0a..e7e227bb70 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -127,6 +127,9 @@ enable_atheros() { config_get key "$vif" key iwconfig "$ifname" enc "${key:-1}" ;; + PSK|psk|PSK2|psk2) + config_get key "$vif" key + ;; esac case "$mode" in @@ -138,8 +141,37 @@ enable_atheros() { config_get ssid "$vif" ssid ;; esac + + [ "$mode" = "sta" ] && { + config_get_bool bgscan "$vif" bgscan 1 + iwpriv "$ifname" bgscan "$bgscan" + } + + config_get_bool antdiv "$device" diversity 1 + sysctl -w dev."$device".diversity="$antdiv" >&- + + config_get antrx "$device" rxantenna + if [ -n "$antrx" ]; then + sysctl -w dev."$device".rxantenna="$antrx" >&- + fi + + config_get anttx "$device" txantenna + if [ -n "$anttx" ]; then + sysctl -w dev."$device".txantenna="$anttx" >&- + fi + + config_get distance "$device" distance + if [ -n "$distance" ]; then + athctrl -i "$device" -d "$distance" >&- + fi + + config_get txpwr "$vif" txpower + if [ -n "$txpwr" ]; then + iwconfig "$ifname" txpower "${txpwr%%.*}" + fi + ifconfig "$ifname" up - + local net_cfg bridge net_cfg="$(find_net_config "$vif")" [ -z "$net_cfg" ] || { @@ -159,7 +191,34 @@ enable_atheros() { } ;; wds|sta) - # FIXME: implement wpa_supplicant calls here + case "$enc" in + PSK|psk|PSK2|psk2) + case "$enc" in + PSK|psk) + proto='proto=WPA';; + PSK2|psk2) + proto='proto=RSN';; + esac + cat > /var/run/wpa_supplicant-$ifname.conf <