summaryrefslogtreecommitdiff
path: root/recipes-kernel/rsi-91x/files/onebox_util.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/rsi-91x/files/onebox_util.sh')
-rwxr-xr-xrecipes-kernel/rsi-91x/files/onebox_util.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes-kernel/rsi-91x/files/onebox_util.sh b/recipes-kernel/rsi-91x/files/onebox_util.sh
index 5a20d2b..ce40a12 100755
--- a/recipes-kernel/rsi-91x/files/onebox_util.sh
+++ b/recipes-kernel/rsi-91x/files/onebox_util.sh
@@ -7,12 +7,29 @@
rpine=$1
cmd=$2
interface=$3
+type=$4
+
+sta_ap=0
if [[ $cmd == delete_vap ]] ; then
ip link set $interface down || exit 0
exit 0
fi
+if [[ $(lsmod) =~ [[:space:]]rsi_91x_sta_ap[[:space:]] ]] ; then
+ sta_ap=1
+fi
+
+if [[ $cmd == create_vap ]] && [[ $type == ap ]] && ((sta_ap==1)) ; then
+ ints=$(iw dev | grep Interface)
+ if (( $(echo "$ints" | wc -l) == 1)) ; then
+ [[ $ints =~ Interface[[:space:]]+([^[:space:]]*) ]]
+ int1="${BASH_REMATCH[1]}"
+ iw dev "$int1" interface add $interface type __ap || exit 0
+ exit 0
+ fi
+fi
+
if [[ -L /sys/class/net/$interface ]] ; then
exit 0
fi