8 config_get vifs
"$device" vifs
11 config_get ifname
"$vif" ifname
12 config_set
"$vif" ifname
"${ifname:-$device}"
14 config_get mode
"$vif" mode
19 *) echo "$device($vif): Invalid mode, ignored."; continue;;
23 config_set
"$device" vifs
"${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }${monitor:+$monitor}"
30 set_wifi_down
"$device"
31 # kill all running hostapd and wpa_supplicant processes that
32 # are running on atheros/mac80211 vifs
33 for pid
in `pidof hostapd wpa_supplicant`; do
34 grep wlan
/proc
/$pid/cmdline
>/dev
/null
&& \
41 grep "$device" "$dev/%parent" >/dev
/null
2>/dev
/null
&& {
51 config_get channel
"$device" channel
52 config_get vifs
"$device" vifs
53 config_get country
"$device" country
57 config_get ifname
"$vif" ifname
58 ifconfig
"$ifname" down
59 config_get enc
"$vif" encryption
60 config_get eap_type
"$vif" eap_type
61 config_get mode
"$vif" mode
63 config_get ifname
"$vif" ifname
65 echo "enable_acx($device): Failed to set up $mode vif $ifname" >&2
68 config_set
"$vif" ifname
"$ifname"
71 # only need to change freq band and channel on the first vif
74 iwpriv
"$device" SetRegDomain
1
77 iwpriv
"$device" SetRegDomain
2
79 de|uk|be|hu|
nl|pt|pl|se|dk
)
80 iwpriv
"$device" SetRegDomain
3
83 iwpriv
"$device" SetRegDomain
4
86 iwpriv
"$device" SetRegDomain
5
89 iwpriv
"$device" SetRegDomain
7
92 iwpriv
"$device" SetRegDomain
8
95 iwconfig
"$ifname" channel
"$channel" >/dev
/null
2>/dev
/null
96 if [ "$mode" = adhoc
]; then
97 iwlist
"$ifname" scan
>/dev
/null
2>/dev
/null
99 iwconfig
"$ifname" mode ad-hoc
>/dev
/null
2>/dev
/null
102 iwconfig
"$ifname" channel
"$channel" >/dev
/null
2>/dev
/null
107 iwconfig
"$ifname" mode managed
>/dev
/null
2>/dev
/null
110 iwconfig
"$ifname" mode master
>/dev
/null
2>/dev
/null
113 iwconfig
"$ifname" mode
$mode >/dev
/null
2>/dev
/null
119 for idx
in 1 2 3 4; do
120 config_get key
"$vif" "key${idx}"
121 iwconfig
"$ifname" enc
"[$idx]" "${key:-off}"
123 config_get key
"$vif" key
126 [1234]) iwconfig
"$ifname" enc restricted
"[$key]";;
127 *) iwconfig
"$ifname" enc restricted
"$key";;
131 echo "WARNING WPA / WPA2 not supported by acx driver"
132 config_get key
"$vif" key
138 config_get addr
"$vif" bssid
140 iwconfig
"$ifname" ap
"$addr"
144 config_get ssid
"$vif" ssid
146 config_get txpwr
"$vif" txpower
147 if [ -n "$txpwr" ]; then
148 iwconfig
"$ifname" txpower
"${txpwr%%.*}"
151 config_get frag
"$vif" frag
152 if [ -n "$frag" ]; then
153 iwconfig
"$ifname" frag
"${frag%%.*}"
156 config_get rts
"$vif" rts
157 if [ -n "$rts" ]; then
158 iwconfig
"$ifname" rts
"${rts%%.*}"
161 ifconfig
"$ifname" up
162 iwconfig
"$ifname" channel
"$channel" >/dev
/null
2>/dev
/null
165 net_cfg
="$(find_net_config "$vif")"
166 [ -z "$net_cfg" ] ||
{
167 bridge
="$(bridge_interface "$net_cfg")"
168 config_set
"$vif" bridge
"$bridge"
169 start_net
"$ifname" "$net_cfg"
171 iwconfig
"$ifname" essid
"$ssid"
172 set_wifi_up
"$vif" "$ifname"
176 echo 1 >/sys
/class
/leds
/wifi
/brightness
182 for dev
in $
(ls -d wlan
* 2>&-); do
183 config_get
type "$dev" type
184 [ "$type" = acx
] && return
186 config wifi-device $dev
190 # REMOVE THIS LINE TO ENABLE WIFI:
198 option encryption none
This page took 0.053698 seconds and 5 git commands to generate.