@ -610,39 +610,12 @@ mac80211_setup_adhoc() {
${ keyspec : +keys $keyspec }
}
mac80211_setup_vif( ) {
local name = " $1 "
local failed
json_select data
json_get_vars ifname
json_select ..
json_select config
json_get_vars mode
json_get_var vif_txpower txpower
ip link set dev " $ifname " up || {
wireless_setup_vif_failed IFUP_ERROR
json_select ..
return
}
set_default vif_txpower " $txpower "
[ -z " $vif_txpower " ] || iw dev " $ifname " set txpower fixed " ${ vif_txpower %%.* } 00 "
case " $mode " in
mesh)
json_get_vars key
wireless_vif_parse_encryption
if [ " $wpa " -gt 0 -o " $auto_channel " -gt 0 ] || chan_is_dfs " $phy " " $channel " ; then
freq = " $( get_freq " $phy " " $channel " ) "
mac80211_setup_supplicant || failed = 1
else
json_get_vars mesh_id mcast_rate
mac80211_setup_mesh( ) {
json_get_vars ssid mesh_id mcast_rate
mcval =
[ -n " $mcast_rate " ] && wpa_supplicant_add_rate mcval " $mcast_rate "
[ -n " $mesh_id " ] && ssid = " $mesh_id "
case " $htmode " in
VHT20| HT20) mesh_htmode = HT20; ;
@ -677,13 +650,41 @@ mac80211_setup_vif() {
; ;
*) mesh_htmode = "NOHT" ; ;
esac
freq = " $( get_freq " $phy " " $channel " ) "
iw dev " $ifname " mesh join " $mesh_id " freq $freq $mesh_htmode \
iw dev " $ifname " mesh join " $ssid " freq $freq $mesh_htmode \
${ mcval : +mcast-rate $mcval } \
beacon-interval $beacon_int
fi
}
mac80211_setup_vif( ) {
local name = " $1 "
local failed
json_select data
json_get_vars ifname
json_select ..
json_select config
json_get_vars mode
json_get_var vif_txpower txpower
ip link set dev " $ifname " up || {
wireless_setup_vif_failed IFUP_ERROR
json_select ..
return
}
set_default vif_txpower " $txpower "
[ -z " $vif_txpower " ] || iw dev " $ifname " set txpower fixed " ${ vif_txpower %%.* } 00 "
case " $mode " in
mesh)
wireless_vif_parse_encryption
freq = " $( get_freq " $phy " " $channel " ) "
if [ " $wpa " -gt 0 -o " $auto_channel " -gt 0 ] || chan_is_dfs " $phy " " $channel " ; then
mac80211_setup_supplicant || failed = 1
else
mac80211_setup_mesh
fi
for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING ; do
json_get_var mp_val " $var "
[ -n " $mp_val " ] && iw dev " $ifname " set mesh_param " $var " " $mp_val "