3 append DRIVERS "atheros"
10 config_get vifs "$device" vifs
13 config_get ifname "$vif" ifname
14 config_set "$vif" ifname "${ifname:-ath}"
16 config_get mode "$vif" mode
22 config_get addr "$vif" bssid
23 ${addr:+append wds "$addr"}
25 *) echo "$device($vif): Invalid mode, ignored."; continue;;
29 case "${adhoc:+1}:${sta:+}:${ap+1}" in
30 # valid mode combinations
32 :1:1)config_set "$device" nosbeacon 1;; # AP+STA, can't use beacon timers for STA
36 *) echo "$device: Invalid mode combination in config"; return 1;;
39 config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${sta:+$sta }"
41 [ -z "$adhoc" ] && config_set "$device" wds "$wdsifs"
50 grep "$device" "$dev/%parent" >/dev/null 2>/dev/null && {
53 wlanconfig $dev destroy
59 config_get channel "$device" channel
60 config_get wds "$device" wds
61 config_get vifs "$device" vifs
65 config_get ifname "$vif" ifname
66 config_get enc "$vif" encryption
67 config_get mode "$vif" mode
69 [ "$mode" = sta ] && config_get nosbeacon "$device" nosbeacon
71 config_get ifname "$vif" ifname
72 ifname=$(wlanconfig "$ifname" create wlandev "$device" wlanmode "$mode" ${nosbeacon:+nosbeacon})
73 config_set "$vif" ifname "$ifname"
76 echo "enable_atheros($device): Failed to set up vif $ifname" >&2
82 for idx in 1 2 3 4; do
83 config_get key "$vif" "key${idx}"
84 iwconfig "$ifname" enc "[$idx]" "${key:-off}"
86 config_get key "$vif" key
87 iwconfig "$ifname" enc "$key"
98 # FIXME: add wpa+radius here
103 # FIXME: implement wpa_supplicant calls here
107 config_get ssid "$vif" ssid
108 append if_up "iwconfig $ifname essid $ssid channel $channel" ";$N"
109 append if_up "sleep 1" ";$N"
110 append if_up "ifconfig $ifname up" ";$N"
113 net_cfg="$(find_net_config "$vif")"
114 [ -z "$net_cfg" ] || {
115 bridge="$(bridge_interface "$net_cfg")"
116 append if_up "start_net '$ifname' '$net_cfg'" ";$N"
118 # TODO: start hostapd
121 #killall -KILL $hostapd >&- 2>&-
130 config_get type "$dev" type
131 [ "$type" = atheros ] && return
133 config wifi-device $dev
142 option encryption none