2 append DRIVERS
"mac80211"
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 }"
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
56 config_get ifname
"$vif" ifname
57 config_get enc
"$vif" encryption
58 config_get mode
"$vif" mode
60 config_get ifname
"$vif" ifname
62 echo "enable_mac80211($device): Failed to set up $mode vif $ifname" >&2
65 config_set
"$vif" ifname
"$ifname"
68 # only need to change freq band and channel on the first vif
69 iwconfig
"$ifname" channel
"$channel" >/dev
/null
2>/dev
/null
72 iwconfig
"$ifname" channel
"$channel" >/dev
/null
2>/dev
/null
78 for idx
in 1 2 3 4; do
79 config_get key
"$vif" "key${idx}"
80 iwconfig
"$ifname" enc
"[$idx]" "${key:-off}"
82 config_get key
"$vif" key
85 [1234]) iwconfig
"$ifname" enc
"[$key]";;
86 *) iwconfig
"$ifname" enc
"$key";;
90 config_get key
"$vif" key
96 config_get addr
"$vif" bssid
98 iwconfig
"$ifname" ap
"$addr"
102 config_get ssid
"$vif" ssid
104 config_get txpwr
"$vif" txpower
105 if [ -n "$txpwr" ]; then
106 iwconfig
"$ifname" txpower
"${txpwr%%.*}"
109 config_get frag
"$vif" frag
110 if [ -n "$frag" ]; then
111 iwconfig
"$ifname" frag
"${frag%%.*}"
114 config_get rts
"$vif" rts
115 if [ -n "$rts" ]; then
116 iwconfig
"$ifname" rts
"${rts%%.*}"
119 ifconfig
"$ifname" up
120 iwconfig
"$ifname" channel
"$channel" >/dev
/null
2>/dev
/null
123 net_cfg
="$(find_net_config "$vif")"
124 [ -z "$net_cfg" ] ||
{
125 bridge
="$(bridge_interface "$net_cfg")"
126 config_set
"$vif" bridge
"$bridge"
127 start_net
"$ifname" "$net_cfg"
129 iwconfig
"$ifname" essid
"$ssid"
130 set_wifi_up
"$vif" "$ifname"
133 if eval "type hostapd_setup_vif" 2>/dev
/null
>/dev
/null
; then
134 hostapd_setup_vif
"$vif" nl80211 ||
{
135 echo "enable_mac80211($device): Failed to set up wpa for interface $ifname" >&2
136 # make sure this wifi interface won't accidentally stay open without encryption
137 ifconfig
"$ifname" down
151 cat > /var
/run
/wpa_supplicant-
$ifname.conf
<<EOF
152 ctrl_interface=/var/run/wpa_supplicant
163 #add wpa_supplicant calls here
166 [ -z "$proto" ] || wpa_supplicant
${bridge:+ -b $bridge} -B -D wext
-i "$ifname" -c /var
/run
/wpa_supplicant-
$ifname.conf
176 for dev
in $
(ls -d wlan
* 2>&-); do
177 config_get
type "$dev" type
178 [ "$type" = mac80211
] && return
180 config wifi-device $dev
184 # REMOVE THIS LINE TO ENABLE WIFI:
192 option encryption none
This page took 0.058949 seconds and 5 git commands to generate.