diff options
author | John Crispin <john@openwrt.org> | 2012-07-24 23:07:15 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2012-07-24 23:07:15 +0000 |
commit | 8b3882224a40ef79be210a55a7fda779179d5872 (patch) | |
tree | a933d76bdc9cc350599239fb29432b6dc2f7192d /package | |
parent | 3f3268c0c20ae6585067d88880e31a7ffd9536f0 (diff) | |
download | mtk-20170518-8b3882224a40ef79be210a55a7fda779179d5872.zip mtk-20170518-8b3882224a40ef79be210a55a7fda779179d5872.tar.gz mtk-20170518-8b3882224a40ef79be210a55a7fda779179d5872.tar.bz2 |
wpa_supplicant: add more parameters
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
SVN-Revision: 32829
Diffstat (limited to 'package')
-rw-r--r-- | package/hostapd/files/wpa_supplicant.sh | 44 | ||||
-rw-r--r-- | package/mac80211/files/lib/wifi/mac80211.sh | 3 |
2 files changed, 40 insertions, 7 deletions
diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh index ed6597c..6f89c64 100644 --- a/package/hostapd/files/wpa_supplicant.sh +++ b/package/hostapd/files/wpa_supplicant.sh @@ -4,6 +4,8 @@ wpa_supplicant_setup_vif() { local key="$key" local options="$3" local freq="" + local ap_scan="" + local scan_ssid="1" [ -n "$4" ] && freq="frequency=$4" # make sure we have the encryption type and the psk @@ -30,7 +32,11 @@ wpa_supplicant_setup_vif() { echo "wpa_supplicant_setup_vif($ifname): Refusing to bridge $mode mode interface" return 1 } - [ "$mode" = "adhoc" ] && modestr="mode=1" + [ "$mode" = "adhoc" ] && { + modestr="mode=1" + scan_ssid="0" + ap_scan="ap_scan=2" + } key_mgmt='NONE' case "$enc" in @@ -117,22 +123,48 @@ wpa_supplicant_setup_vif() { ;; esac + local fixed_freq bssid1 beacon_interval brates mrate config_get ifname "$vif" ifname config_get bridge "$vif" bridge - config_get ssid "$vif" ssid - config_get bssid "$vif" bssid - bssid=${bssid:+"bssid=$bssid"} + bssid1=${bssid:+"bssid=$bssid"} + beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"} + + local br brval brsub brstr + [ -n "$basic_rate_list" ] && { + for br in $basic_rate_list; do + brval="$(($br / 1000))" + brsub="$((($br / 100) % 10))" + [ "$brsub" -gt 0 ] && brval="$brval.$brsub" + [ -n "$brstr" ] && brstr="$brstr," + brstr="$brstr$brval" + done + brates=${basic_rate_list:+"rates=$brstr"} + } + + local mcval="" + [ -n "$mcast_rate" ] && { + mcval="$(($mcast_rate / 1000))" + mcsub="$(( ($mcast_rate / 100) % 10 ))" + [ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub" + mrate=${mcast_rate:+"mcast_rate=$mcval"} + } + rm -rf /var/run/wpa_supplicant-$ifname cat > /var/run/wpa_supplicant-$ifname.conf <<EOF ctrl_interface=/var/run/wpa_supplicant-$ifname +$ap_scan network={ $modestr - scan_ssid=1 + scan_ssid=$scan_ssid ssid="$ssid" - $bssid + $bssid1 key_mgmt=$key_mgmt $proto $freq + ${fixed:+"fixed_freq=1"} + $beacon_interval + $brates + $mrate $ieee80211w $passphrase $pairwise diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 6b907b6..97fd050 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -453,8 +453,9 @@ enable_mac80211() { echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2 # make sure this wifi interface won't accidentally stay open without encryption ifconfig "$ifname" down - continue } + # wpa_supplicant will bring the iface up + continue fi } |