summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/meshwizard/files
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/package/meshwizard/files')
-rwxr-xr-xcontrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
index 84c5438ebc..001754c12f 100755
--- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
+++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh
@@ -79,7 +79,20 @@ uci_commitverbose "Setup wifi interface for $netrenamed" wireless
## VAP
ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)"
-if [ "$type" == "atheros" -a "$vap" == 1 ]; then
+
+supports_vap="0"
+if [ "$type" = "atheros" ]; then
+ supports_vap="1"
+elif [ "$type" = "mac80211" ]; then
+ # get driver in use
+ netindex="$(echo $net |sed 's/[a-zA-z]*//')"
+ driver="$(basename $(ls -l /sys/class/net/wlan${netindex}/device/driver/module | sed -ne 's/.* -> //p'))"
+ if [ "$driver" = "ath9k" -o "$driver" = "ath5k" ]; then
+ supports_vap="1"
+ fi
+fi
+
+if [ "$supports_vap" == "1" -a "$vap" == 1 ]; then
uci batch <<- EOF
set wireless.$net\_iface_dhcp="wifi-iface"
set wireless.$net\_iface_dhcp.device="$net"