[no ci] Overlay: simplify wireless scripts (#1174)

Co-authored-by: Signor Pellegrino <68112357+FlyRouter@users.noreply.github.com>
pull/1182/head
viktorxda 2023-12-03 14:16:20 +01:00 committed by GitHub
parent 627c66e26b
commit 7fb17db6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 78 deletions

View File

@ -1,10 +1,7 @@
#!/bin/sh
set_gpio() {
test -e /sys/class/gpio/gpio$1 && echo $1 > /sys/class/gpio/unexport
echo $1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$1/direction
echo $2 > /sys/class/gpio/gpio$1/value
[ "$2" -eq 1 ] && gpio set $1 || gpio clear $1
sleep 1
}

View File

@ -1,57 +1,75 @@
#!/bin/sh
set_gpio() {
test -e /sys/class/gpio/gpio$1 && echo $1 > /sys/class/gpio/unexport
echo $1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$1/direction
echo $2 > /sys/class/gpio/gpio$1/value
[ "$2" -eq 1 ] && gpio set $1 || gpio clear $1
sleep 1
}
set_mmc() {
mmc=/sys/devices/platform/jzmmc_v1.2.$1/present
if [ "$(cat $mmc)" = "N" ]; then
echo "INSERT" > $mmc
fi
[ "$(cat $mmc)" = "N" ] && echo "INSERT" > $mmc
}
# RTL8189FS Generic
if [ "$1" = "rtl8189fs-generic" ]; then
set_mmc 1
modprobe 8189fs
exit 0
fi
# ATBM603x Generic
# Generic ATBM603X
if [ "$1" = "atbm603x-generic" ]; then
set_mmc 1
cp /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
cp /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
modprobe atbm603x_wifi_sdio
exit 0
fi
# T31 Wyze V3 / AtomCam 2 ATBM603x
if [ "$1" = "atbm603x-t31-wyze-v3" ]; then
set_gpio 57 0;set_gpio 57 1
set_mmc 1
cp /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
cp /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
modprobe atbm603x_wifi_sdio atbm_printk_mask=0
cp -f /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
cp -f /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
modprobe atbm603x_wifi_sdio
exit 0
fi
# T31 Wyze PanV2 ATBM603x
# Generic RTL8189FS
if [ "$1" = "rtl8189fs-generic" ]; then
set_mmc 1
modprobe 8189fs
exit 0
fi
# T20 Wyze PanV1
if [ "$1" = "rtl8189es-t20-wyze-pan-v1" ]; then
set_mmc 1
modprobe 8189es rtw_power_mgnt=0 rtw_enusbss=0
exit 0
fi
# T20 Wyze V2
if [ "$1" = "rtl8189ftv-t20-wyze-v2" ]; then
set_mmc 1
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
exit 0
fi
# T31 Wyze DB3
if [ "$1" = "rtl8189ftv-t31-wyze-db3" ]; then
set_mmc 1
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
exit 0
fi
# T31 Wyze PanV2
if [ "$1" = "atbm603x-t31-wyze-pan-v2" ]; then
set_gpio 58 0;set_gpio 58 1
set_gpio 58 0
set_gpio 58 1
set_mmc 1
cp /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
cp /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
cp -f /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
cp -f /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
modprobe atbm603x_wifi_sdio atbm_printk_mask=0
exit 0
fi
# T31 Wyze V3 RTL8189FTV
# T31 Wyze V3 / AtomCam 2
if [ "$1" = "atbm603x-t31-wyze-v3" ]; then
set_gpio 57 0
set_gpio 57 1
set_mmc 1
cp -f /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp
cp -f /usr/share/atbm60xx_conf/set_rate_power.txt /tmp
modprobe atbm603x_wifi_sdio atbm_printk_mask=0
exit 0
fi
# T31 Wyze V3
if [ "$1" = "rtl8189ftv-t31-wyze-v3" ]; then
set_gpio 57 1
set_mmc 1
@ -59,25 +77,4 @@ if [ "$1" = "rtl8189ftv-t31-wyze-v3" ]; then
exit 0
fi
# T31 Wyze DB3 RTL8189FTV
if [ "$1" = "rtl8189ftv-t31-wyze-db3" ]; then
set_mmc 1
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
exit 0
fi
# T20 Wyze V2 RTL8189FTV
if [ "$1" = "rtl8189ftv-t20-wyze-v2" ]; then
set_mmc 1
modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0
exit 0
fi
# T20 Wyze PanV1 RTL8189ES
if [ "$1" = "rtl8189es-t20-wyze-pan-v1" ]; then
set_mmc 1
modprobe 8189es rtw_power_mgnt=0 rtw_enusbss=0
exit 0
fi
exit 1

View File

@ -1,32 +1,29 @@
#!/bin/sh
set_gpio() {
test -e /sys/class/gpio/gpio$1 && echo $1 > /sys/class/gpio/unexport
echo $1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$1/direction
echo $2 > /sys/class/gpio/gpio$1/value
[ "$2" -eq 1 ] && gpio set $1 || gpio clear $1
sleep 1
}
# MT7601U Generic
# Generic MT7601U
if [ "$1" = "mt7601u-generic" ]; then
modprobe mt7601u
exit 0
fi
# RTL8188FU Generic
if [ "$1" = "rtl8188fu-generic" ]; then
modprobe 8188fu
exit 0
fi
# RTL8188EU Generic
# Generic RTL8188EU
if [ "$1" = "rtl8188eu-generic" ]; then
modprobe 8188eu
exit 0
fi
# RTL8733BU Generic
# Generic RTL8188FU
if [ "$1" = "rtl8188fu-generic" ]; then
modprobe 8188fu
exit 0
fi
# Generic RTL8733BU
if [ "$1" = "rtl8733bu-generic" ]; then
modprobe 8733bu
exit 0
@ -81,7 +78,7 @@ if [ "$1" = "rtl8188fu-hi3518ev200-lifesmart" ]; then
exit 0
fi
# HI3518EV200 Rostelecom QVC-IPC-136W
# HI3518EV200 QVC-IPC-136W
if [ "$1" = "rtl8188eu-hi3518ev200-qvc-ipc-136w" ]; then
set_gpio 7 1
modprobe 8188eu
@ -110,6 +107,12 @@ if [ "$1" = "ssw101b-ssc333-tapo-c110" ]; then
exit 0
fi
# SSC337DE BroadbandService
if [ "$1" = "aic8800-ssc337de-broadband" ]; then
modprobe aic8800_fdrv
exit 0
fi
# SSC337DE BroadbandService
if [ "$1" = "rtl8188fu-ssc337de-broadband" ]; then
set_gpio 2 0
@ -124,12 +127,6 @@ if [ "$1" = "rtl8188fu-ssc337de-foscam" ]; then
exit 0
fi
# SSC337DE BroadbandService
if [ "$1" = "aic8800-ssc337de-broadband" ]; then
modprobe aic8800_fdrv
exit 0
fi
# T10 NVT
if [ "$1" = "mt7601sta-t10-nvt" ]; then
modprobe cfg80211