summaryrefslogtreecommitdiff
path: root/recipes-kernel/rsi-91x/files
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2023-01-04 19:49:18 -0600
committerJohn Klug <john.klug@multitech.com>2023-01-10 16:42:56 -0600
commitb2512f0e210fc3f2d1eeeefa7be37a20b9af26ad (patch)
tree487589b63fd165004cb687fc367853224830b280 /recipes-kernel/rsi-91x/files
parenta2a00ca0f5c8a10ce2dfe2dac8c7ef71c8074662 (diff)
downloadmeta-multitech-atmel-b2512f0e210fc3f2d1eeeefa7be37a20b9af26ad.tar.gz
meta-multitech-atmel-b2512f0e210fc3f2d1eeeefa7be37a20b9af26ad.tar.bz2
meta-multitech-atmel-b2512f0e210fc3f2d1eeeefa7be37a20b9af26ad.zip
Add WiFi Station/AP mode
Diffstat (limited to 'recipes-kernel/rsi-91x/files')
-rwxr-xr-xrecipes-kernel/rsi-91x/files/onebox_util.sh17
-rw-r--r--recipes-kernel/rsi-91x/files/rs9113.default1
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_load_modules.sh11
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_remove_modules.sh26
-rw-r--r--recipes-kernel/rsi-91x/files/rsi-91x-sta-ap.patch40
5 files changed, 89 insertions, 6 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
diff --git a/recipes-kernel/rsi-91x/files/rs9113.default b/recipes-kernel/rsi-91x/files/rs9113.default
index 7111825..bc74cb1 100644
--- a/recipes-kernel/rsi-91x/files/rs9113.default
+++ b/recipes-kernel/rsi-91x/files/rs9113.default
@@ -11,6 +11,7 @@ RSI_ANTENNA_DIVERSITY=0
# COEX_MODE options:
# 1 WLAN STATION or WLAN ACCESS POINT
+# 3 WLAN ACCESS POINT + STATION MODE(on multiple vaps)
# 4 BT EDR MODE
# 5 WLAN STATION + BT EDR MODE
# 6 WLAN ACCESS POINT + BT EDR MODE
diff --git a/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
index 3977a5c..db36f0f 100755
--- a/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
+++ b/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
@@ -53,15 +53,11 @@ if (($# > 1)); then
fi
if ((${#COEX_MODE}==0)) && [[ -r $defaults ]]; then
- set -e
. $defaults
- set +e
fi
if (($# > 0)) && [[ -r $1 ]]; then
- set -e
. $1
- set +e
fi
err=0
@@ -112,7 +108,12 @@ sdiod="rsi_sdio.ko"
rsid="rsi_91x.ko"
case ${COEX_MODE} in
- 1|2|3)
+ 1|2)
+ DEV_OPER_MODE=1
+ ;;
+ 3)
+ rsid="rsi_91x_sta_ap.ko"
+ usbd="rsi_usb_sta_ap.ko"
DEV_OPER_MODE=1
;;
4)
diff --git a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
index ba65254..606f069 100755
--- a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
+++ b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
@@ -5,9 +5,33 @@ killall -9 bluetoothd
rm -rf /var/run/wpa_supplicant/
sleep 2
+# Find the wifi interfaces
+ints=$(find -L /sys/class/net -maxdepth 2 -name phy80211)
+
+# Remove the links with the ip command.
+for phy in $ints ; do
+ dir=$(dirname $phy)
+ vap=$(basename $dir)
+ echo Setting $vap down
+ logger -p daemon.alert Setting $vap down
+ ip link set $vap down
+done
+
+# So ifdown is not confused,
+# make sure ifup/ifdown is now
+# in the down state.
+if [[ -x /sbin/ifdown ]] ; then
+ for phy in $ints ; do
+ dir=$(dirname $phy)
+ vap=$(basename $dir)
+ logger -p daemon.alert ifdown $vap
+ ifdown $vap
+ done
+fi
+
modules=" "$(lsmod)" "
### COMMON HAL MODULES
-for mod in bnep rfcomm rsi_btsdio rsi_btusb rsi_bt91x rsi_sdio rsi_usb rsi_91x mac80211 cfg80211 bluetooth ; do
+for mod in bnep rfcomm rsi_btsdio rsi_btusb rsi_bt91x rsi_sdio rsi_usb rsi_usb_sta_ap rsi_91x_sta_ap rsi_91x mac80211 cfg80211 bluetooth ; do
if [[ ${modules} =~ [[:space:]]${mod}[[:space:]] ]] ; then
result+=$(rmmod $mod 2>&1)
last=$?
diff --git a/recipes-kernel/rsi-91x/files/rsi-91x-sta-ap.patch b/recipes-kernel/rsi-91x/files/rsi-91x-sta-ap.patch
new file mode 100644
index 0000000..73c3e1b
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rsi-91x-sta-ap.patch
@@ -0,0 +1,40 @@
+diff --git a/rsi/Makefile b/rsi/Makefile
+index 64f7742..951b7a1 100644
+--- a/rsi/Makefile
++++ b/rsi/Makefile
+@@ -57,7 +57,7 @@ KERNELDIR=/lib/modules/$(KERNELRELEASE)/build
+ #CONFIG_RSI_P2P=y
+
+ # Uncomment below line for using Concurrent mode
+-#CONFIG_STA_PLUS_AP=y
++CONFIG_STA_PLUS_AP=y
+
+ # Uncomment below line for platforms with no SDIO multiblock support
+ #CONFIG_RSI_NO_SDIO_MULTIBLOCK=y
+@@ -190,16 +190,21 @@ ifeq ($(OFFLOAD_SCAN_TO_DEVICE), y)
+ EXTRA_CFLAGS += -DOFFLOAD_SCAN_TO_DEVICE
+ endif
+
+-obj-m := rsi_sdio.o rsi_usb.o rsi_91x.o
++obj-m := rsi_sdio.o rsi_usb_sta_ap.o rsi_91x_sta_ap.o
+ rsi_sdio-objs := $(COMMON_SDIO_OBJS)
+-rsi_usb-objs := $(COMMON_USB_OBJS)
+-rsi_91x-objs := $(RSI_91X_OBJS)
++rsi_usb_sta_ap-objs := $(COMMON_USB_OBJS)
++rsi_91x_sta_ap-objs := $(RSI_91X_OBJS)
+
+ all:
++ @echo env is:
++ env
+ @echo -e "\033[32mCompiling RSI drivers...\033[0m"
+ make -C$(KERNELDIR)/ M=$(PWD) modules
+- @echo -e "application compilation"
+- make CC="$(CC)" ROOT_DIR=$(ROOT_DIR) -C $(PWD)/apps
++ # @echo -e "application compilation"
++ # make CC="$(CC)" ROOT_DIR=$(ROOT_DIR) -C $(PWD)/apps
++
++modules_install:
++ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
+
+ clean:
+ make -C$(KERNELDIR)/ M=$(PWD) clean