- if [ ! "$mode" = "ap" ]; then
- ifconfig "$ifname" up
- case "$mode" in
- adhoc)
- config_get bssid "$vif" bssid
- config_get ssid "$vif" ssid
- config_get beacon_int "$device" beacon_int
- config_get basic_rate_list "$device" basic_rate
- config_get encryption "$vif" encryption
- config_get key "$vif" key 1
- config_get mcast_rate "$vif" mcast_rate
-
- local keyspec=""
- [ "$encryption" == "wep" ] && {
- case "$key" in
- [1234])
- local idx
- for idx in 1 2 3 4; do
- local ikey
- config_get ikey "$vif" "key$idx"
-
- [ -n "$ikey" ] && {
- ikey="$(($idx - 1)):$(prepare_key_wep "$ikey")"
- [ $idx -eq $key ] && ikey="d:$ikey"
- append keyspec "$ikey"
- }
- done
- ;;
- *) append keyspec "d:0:$(prepare_key_wep "$key")" ;;
- esac
- }
-
- 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
- }
-
- local mcval=""
- [ -n "$mcast_rate" ] && {
- mcval="$(($mcast_rate / 1000))"
- mcsub="$(( ($mcast_rate / 100) % 10 ))"
- [ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub"
- }
-
- config_get htmode "$device" htmode
- case "$htmode" in
- HT20|HT40+|HT40-) ;;
- *) htmode= ;;
+ case "$mode" in
+ adhoc)
+ config_get bssid "$vif" bssid
+ config_get ssid "$vif" ssid
+ config_get beacon_int "$device" beacon_int
+ config_get basic_rate_list "$device" basic_rate
+ config_get encryption "$vif" encryption
+ config_get key "$vif" key 1
+ config_get mcast_rate "$vif" mcast_rate
+
+ local keyspec=""
+ [ "$encryption" == "wep" ] && {
+ case "$key" in
+ [1234])
+ local idx
+ for idx in 1 2 3 4; do
+ local ikey
+ config_get ikey "$vif" "key$idx"
+
+ [ -n "$ikey" ] && {
+ ikey="$(($idx - 1)):$(prepare_key_wep "$ikey")"
+ [ $idx -eq $key ] && ikey="d:$ikey"
+ append keyspec "$ikey"
+ }
+ done
+ ;;
+ *) append keyspec "d:0:$(prepare_key_wep "$key")" ;;