1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Remove ipq40xx customization

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-09-29 15:05:43 +02:00
parent 46d5683e1d
commit a93d9cba68
83 changed files with 0 additions and 13379 deletions

View file

@ -1,235 +0,0 @@
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ipq40xx_setup_interfaces()
{
local board="$1"
case "$board" in
8dev,habanero-dvk|\
avm,fritzbox-4040|\
asus,rt-ac42u|\
asus,rt-ac58u|\
linksys,ea6350v3|\
linksys,ea8300|\
linksys,mr8300|\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
mikrotik,hap-ac3-lte6-kit|\
p2w,r619ac-64m|\
p2w,r619ac-128m|\
pakedge,wr-1|\
teltonika,rutx|\
teltonika,rutx12|\
teltonika,rutx50|\
zyxel,nbg6617)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
8dev,jalapeno|\
alfa-network,ap120c-ac|\
asus,map-ac2200|\
cilab,meshpoint-one|\
edgecore,ecw5211|\
glinet,gl-ap1300|\
glinet,gl-b2200|\
google,wifi|\
linksys,whw03v2|\
luma,wrtq-329acn|\
mikrotik,cap-ac|\
netgear,wac510|\
sony,ncp-hg100-cellular|\
wallys,dr40x9|\
zte,mf18a|\
zte,mf289f)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;
aruba,ap-303|\
aruba,ap-365|\
avm,fritzrepeater-1200|\
dlink,dap-2610|\
extreme-networks,ws-ap3915i|\
meraki,mr33|\
meraki,mr74|\
mikrotik,lhgg-60ad|\
mikrotik,sxtsq-5-ac|\
netgear,ex6100v2|\
netgear,ex6150v2)
ucidef_set_interface_lan "lan"
;;
avm,fritzbox-7530)
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
;;
avm,fritzrepeater-3000|\
cellc,rtl30vw)
ucidef_set_interface_lan "lan1 lan2"
;;
compex,wpj428)
ucidef_set_interface_lan "lan1 lan2"
;;
linksys,whw01)
ucidef_set_interface_lan "eth1 eth2"
;;
glinet,gl-a1300|\
glinet,gl-b1300|\
mobipromo,cm520-79f)
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;;
mikrotik,wap-ac|\
mikrotik,wap-ac-lte|\
mikrotik,wap-r-ac)
ucidef_set_interface_lan "sw-eth1 sw-eth2"
;;
aruba,ap-303h|\
buffalo,wtr-m2133hp|\
ezviz,cs-w3-wd1200g-eup|\
netgear,rbr50|\
netgear,rbs50|\
netgear,srr60|\
netgear,srs60|\
teltonika,rutx10)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
openmesh,a42|\
openmesh,a62)
ucidef_set_interfaces_lan_wan "ethernet2" "ethernet1"
;;
plasmacloud,pa1200|\
plasmacloud,pa2200)
ucidef_set_interfaces_lan_wan "ethernet1" "ethernet2"
;;
qxwlan,e2600ac-c1)
ucidef_set_interfaces_lan_wan "sw-eth1" "sw-eth2"
;;
qxwlan,e2600ac-c2)
ucidef_set_interfaces_lan_wan "sw-eth1 sw-eth2" "sw-eth3"
;;
zte,mf286d)
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
ipq40xx_setup_dsl()
{
local board="$1"
local annex="j"
local tone="b"
local xfer_mode=""
case "$board" in
avm,fritzbox-7530)
;;
*)
return 0
;;
esac
ucidef_add_atm_bridge "1" "32" "llc" "bridged" "dsl"
ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode"
ucidef_set_interface_wan "dsl0" "pppoe"
}
ipq40xx_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
local label_mac=""
case "$board" in
8dev,habanero-dvk)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
asus,rt-ac42u)
label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
;;
asus,rt-ac58u)
wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
label_mac=$wan_mac
;;
avm,fritzbox-7530)
local tffsdev=$(find_mtd_chardev "nand-tffs")
wan_mac=$(/usr/bin/fritz_tffs_nand -b -d $tffsdev -n macdsl)
;;
cilab,meshpoint-one)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
devolo,magic-2-wifi-next)
lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0)
label_mac=$lan_mac
;;
dlink,dap-2610)
lan_mac=$(mtd_get_mac_ascii bdcfg lanmac)
label_mac=$lan_mac
;;
engenius,eap2200|\
engenius,emd1)
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
label_mac=$lan_mac
;;
engenius,emr3500)
wan_mac=$(mtd_get_mac_ascii 0:APPSBLENV wanaddr)
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
label_mac=$wan_mac
;;
engenius,ens620ext)
wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
ezviz,cs-w3-wd1200g-eup)
label_mac=$(mtd_get_mac_binary "ART" 0x6)
;;
google,wifi)
wan_mac=$(get_mac_label)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
linksys,ea6350v3|\
linksys,ea8300 |\
linksys,mr8300)
wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
mikrotik,cap-ac |\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
mikrotik,hap-ac3-lte6-kit)
wan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
lan_mac=$(macaddr_add $wan_mac 1)
label_mac="$wan_mac"
;;
mikrotik,lhgg-60ad|\
mikrotik,sxtsq-5-ac)
lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
label_mac="$lan_mac"
;;
netgear,rbr50|\
netgear,rbs50|\
netgear,srr60|\
netgear,srs60|\
pakedge,wr-1)
wan_mac=$(macaddr_add $(get_mac_label) 1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
board_config_update
board=$(board_name)
ipq40xx_setup_interfaces $board
ipq40xx_setup_dsl $board
ipq40xx_setup_macs $board
board_config_flush
exit 0

View file

@ -1,515 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/teltonika-defaults.sh
. /lib/functions/system.sh
[ -f /lib/functions/target-defaults.sh ] && \
. /lib/functions/target-defaults.sh
setup_json() {
local model="$1"
case "$model" in
RUTX08*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_set_hwinfo usb ethernet ios
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX09*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
ucidef_add_static_modem_info "$model" "3-1" "2" "primary" "gps_out"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_set_hwinfo dual_sim usb gps mobile ethernet ios
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX10*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
ucidef_set_hwinfo bluetooth usb wifi dual_band_ssid ethernet ios
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX11*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
ucidef_add_static_modem_info "$model" "3-1" "2" "primary" "gps_out"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_set_hwinfo dual_sim usb gps mobile wifi dual_band_ssid bluetooth ethernet ios
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTXR1*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
ucidef_add_static_modem_info "$model" "3-1" "2" "primary"
ucidef_set_hwinfo dual_sim usb mobile wifi dual_band_ssid ethernet sfp_port sfp_switch console rs232
ucidef_set_usb_jack "/usb1/1-1/1-1.2/"
ucidef_add_serial_capabilities "rs232" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200" \
"7 8" \
"rts/cts xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/usb1/1-1/1-1.3/"
ucidef_set_release_version "2.3.1"
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX12*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
# builtin and primary should be first modem
ucidef_add_static_modem_info "$model" "3-1" "1" "primary" "gps_out"
ucidef_add_static_modem_info "$model" "1-1.2" "1"
ucidef_set_usb_jack "/usb1/1-1/1-1.3/"
ucidef_set_hwinfo usb gps mobile wifi dual_band_ssid bluetooth ethernet ios dual_modem
ucidef_set_release_version "2.3.1"
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX14*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
ucidef_add_static_modem_info "$model" "1-1" "2" "primary" "gps_out"
ucidef_set_usb_jack "/usb3/3-1/"
ucidef_set_hwinfo usb gps dual_sim mobile wifi dual_band_ssid bluetooth ethernet ios at_sim
ucidef_set_release_version "2.6.1"
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX18*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
ucidef_add_static_modem_info "$model" "2-1" "2" "primary" "gps_out"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_set_hwinfo usb gps dual_sim mobile wifi dual_band_ssid bluetooth ethernet ios
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
RUTX50*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
ucidef_add_wlan_bssid_limit "wlan0" 16
ucidef_add_wlan_bssid_limit "wlan1" 16
ucidef_add_static_modem_info "$model" "2-1" "2" "primary" "gps_out"
ucidef_set_usb_jack "/usb3/3-1/"
ucidef_set_hwinfo dual_sim usb gps mobile wifi dual_band_ssid ethernet ios at_sim
ucidef_set_release_version "7.2.8"
ucidef_set_network_options "vlans" 128 "readonly_vlans" 2
;;
TRB2*)
ucidef_set_led_switch "lan" "LAN" "eth_led" "switch0" "0x04"
ucidef_set_interface_lan "eth0"
ucidef_add_static_modem_info "$model" "1-1.4" "2" "primary" "gps_out"
ucidef_add_serial_capabilities "rs232" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200" \
"7 8" \
"rts/cts xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/usb1/1-1/1-1.3/"
ucidef_add_serial_capabilities "rs485" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200 \
230400 460800 921600 1000000 3000000" \
"7 8" \
"none" \
"1 2" \
"even odd mark space none" \
"/usb1/1-1/1-1.2/"
ucidef_set_hwinfo dual_sim mobile gps ethernet ios rs232 rs485
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
;;
RUT361* |\
RUT200* |\
RUT241* |\
RUT260*)
ucidef_set_led_switch "lan" "LAN" "eth1_led" "switch0" "0x2"
ucidef_set_led_switch "wan" "WAN" "eth2_led" "switch0" "0x1"
ucidef_add_switch "switch0" "1:lan" "0:wan:2" "6@eth0"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_set_interface_default_macaddr "lan" "$(mtd_get_mac_binary config 0x0)"
ucidef_set_interface_default_macaddr "wan" "$(macaddr_add "$(mtd_get_mac_binary config 0x0)" 1)"
ucidef_add_static_modem_info "$model" "1-1" "1" "primary"
[ "${model:6:1}" = "1" ] && ucidef_set_hwinfo mobile wifi \
ethernet || ucidef_set_hwinfo mobile wifi ethernet ios
[ "${model:4:2}" = "60" ] && ucidef_set_release_version "7.4.2"
ucidef_set_network_options "vlans" 16 "readonly_vlans" 2
;;
RUT2*)
ucidef_set_led_switch "lan" "LAN" "lan_led" "switch0" "0x04"
ucidef_set_led_netdev "wan" "WAN" "wan_led" "eth1"
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_wlan_bssid_limit "wlan0" 8
ucidef_add_static_modem_info "$model" "1-1" "1" "primary"
[ "${model:6:1}" = "1" ] && ucidef_set_hwinfo mobile wifi \
ethernet || ucidef_set_hwinfo mobile wifi ethernet ios
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
;;
RUT300*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x02"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x10"
ucidef_set_led_switch "lan3" "LAN3" "eth3_led" "switch0" "0x08"
ucidef_set_led_switch "lan4" "LAN4" "eth4_led" "switch0" "0x04"
ucidef_set_led_netdev "wan" "WAN" "wan_led" "eth1"
ucidef_set_interface_wan "eth1"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
ucidef_set_hwinfo usb ethernet ios
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
;;
RUT301*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x01"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x02"
ucidef_set_led_switch "lan3" "LAN3" "eth3_led" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "eth4_led" "switch0" "0x08"
ucidef_set_led_switch "wan" "WAN" "wan_led" "switch0" "0x10"
ucidef_add_switch "switch0" "0:lan:1" "1:lan:2" "2:lan:3" \
"3:lan:4" "4:wan" "6@eth0"
ucidef_set_usb_jack "/usb2/2-1/"
ucidef_set_interface_default_macaddr "wan" "$(macaddr_add "$(mtd_get_mac_binary config 0x0)" 1)"
ucidef_set_hwinfo usb ethernet ios
ucidef_set_network_options "vlans" 16 "readonly_vlans" 2
;;
RUT360*)
ucidef_set_led_switch "lan" "LAN" "eth1_led" "switch0" "0x10"
ucidef_set_led_netdev "wan" "WAN" "eth2_led" "eth1"
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_wlan_bssid_limit "wlan0" 8
ucidef_add_wlan_bssid_limit "wlan1" 8
ucidef_add_static_modem_info "$model" "1-1" "1" "primary"
ucidef_set_hwinfo mobile wifi dual_band_ssid ethernet ios
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
;;
RUT950*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "eth3_led" "switch0" "0x04"
ucidef_set_led_netdev "wan" "WAN" "wan_led" "eth1"
ucidef_set_interface_wan "eth1"
ucidef_add_wlan_bssid_limit "wlan0" 8
ucidef_add_switch "switch0" "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
ucidef_add_static_modem_info "$model" "1-1" "2" "primary"
[ "${model:7:2}" = "06" ] && ucidef_set_hwinfo dual_sim mobile \
wifi ethernet || ucidef_set_hwinfo dual_sim mobile wifi ethernet ios
ucidef_set_network_options "vlans" 15 "readonly_vlans" 1
;;
RUT955*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "eth3_led" "switch0" "0x04"
ucidef_set_led_netdev "wan" "WAN" "wan_led" "eth1"
ucidef_set_interface_wan "eth1"
ucidef_add_wlan_bssid_limit "wlan0" 8
ucidef_add_switch "switch0" "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
ucidef_set_usb_jack "/usb1/1-1/1-1.1/"
ucidef_add_static_modem_info "$model" "1-1.4" "2" "primary" "gps_out"
[ "${model:7:2}" = "06" ] && ucidef_set_hwinfo dual_sim usb gps sd_card \
mobile wifi ethernet rs232 rs485 || ucidef_set_hwinfo dual_sim usb gps sd_card \
mobile wifi ethernet ios rs232 rs485
ucidef_add_serial_capabilities "rs232" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200" \
"5 6 7 8" \
"rts/cts xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/usb1/1-1/1-1.3/"
ucidef_add_serial_capabilities "rs485" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200 \
230400 460800 921600 1000000 3000000" \
"8" \
"none" \
"1 2" \
"even odd none" \
"/tty/ttyATH1"
ucidef_set_network_options "vlans" 15 "readonly_vlans" 1
;;
RUT901* |\
RUT951*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x01"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x02"
ucidef_set_led_switch "lan3" "LAN3" "eth3_led" "switch0" "0x04"
ucidef_set_led_switch "wan" "WAN" "wan_led" "switch0" "0x10"
ucidef_add_switch "switch0" "0:lan:1" "1:lan:2" "2:lan:3" "4:wan" "6@eth0"
ucidef_set_interface_default_macaddr "lan" "$(mtd_get_mac_binary config 0x0)"
ucidef_set_interface_default_macaddr "wan" "$(macaddr_add "$(mtd_get_mac_binary config 0x0)" 1)"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_static_modem_info "$model" "1-1" "2" "primary"
[ "${model:7:1}" = "6" ] && ucidef_set_hwinfo dual_sim mobile \
wifi ethernet || ucidef_set_hwinfo dual_sim mobile wifi ethernet ios
[ "${model:4:2}" = "01" ] && ucidef_set_release_version "7.3.1"
ucidef_set_network_options "vlans" 16 "readonly_vlans" 2
;;
RUT906* |\
RUT956*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x01"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x02"
ucidef_set_led_switch "lan3" "LAN3" "eth3_led" "switch0" "0x04"
ucidef_set_led_switch "wan" "WAN" "wan_led" "switch0" "0x10"
ucidef_add_switch "switch0" "0:lan:1" "1:lan:2" "2:lan:3" "4:wan" "6@eth0"
ucidef_set_interface_default_macaddr "lan" "$(mtd_get_mac_binary config 0x0)"
ucidef_set_usb_jack "/usb1/1-1/1-1.1/"
ucidef_set_interface_default_macaddr "wan" "$(macaddr_add "$(mtd_get_mac_binary config 0x0)" 1)"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_static_modem_info "$model" "1-1.4" "2" "primary" "gps_out"
[ "${model:7:1}" = "6" ] && ucidef_set_hwinfo dual_sim usb gps \
mobile wifi ethernet rs232 rs485 || ucidef_set_hwinfo dual_sim usb gps \
mobile wifi ethernet ios rs232 rs485
[ "${model:4:2}" = "06" ] && ucidef_set_release_version "7.4.2"
ucidef_add_serial_capabilities "rs232" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200" \
"5 6 7 8" \
"rts/cts xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/usb1/1-1/1-1.3/"
ucidef_add_serial_capabilities "rs485" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200 230400" \
"5 6 7 8" \
"xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/tty/ttyS1"
ucidef_set_network_options "vlans" 16 "readonly_vlans" 2
;;
TRB140*)
ucidef_set_interface_lan "eth0 rndis0"
[ "${model:7:1}" = "2" ] && ucidef_set_hwinfo mobile ethernet || \
ucidef_set_hwinfo mobile ethernet ios
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
[ "${model:6:1}" = "4" ] && \
ucidef_set_release_version "7.4.2"
;;
TRB143*)
ucidef_set_interface_lan "eth0 rndis0"
[ "${model:7:1}" = "2" ] && ucidef_set_hwinfo mobile ethernet || \
ucidef_set_hwinfo mobile ethernet ios
ucidef_add_serial_capabilities "mbus" \
"300 600 1200 2400 4800 9600 19200 38400" \
"5 6 7 8" \
"xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/tty/ttyHS0"
if [ "${model:6:1}" = "4" ]; then
ucidef_set_release_version "7.4.3"
else
ucidef_set_release_version "7.1.7"
fi
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
TRB141*)
ucidef_set_interface_lan "rndis0"
ucidef_set_hwinfo mobile ios
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
[ "${model:6:1}" = "4" ] && \
ucidef_set_release_version "7.4.3"
;;
TRB142*)
ucidef_set_interface_lan "rndis0"
[ "${model:7:1}" = "2" ] && ucidef_set_hwinfo mobile rs232 || \
ucidef_set_hwinfo mobile ios rs232
ucidef_add_serial_capabilities "rs232" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200" \
"5 6 7 8" \
"rts/cts xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/tty/ttyHS0"
if [ "${model:6:1}" = "3" ]; then
ucidef_set_release_version "7.1"
elif [ "${model:6:1}" = "4" ]; then
ucidef_set_release_version "7.4.3"
fi
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
TRB145*)
ucidef_set_interface_lan "rndis0"
[ "${model:7:1}" = "2" ] && ucidef_set_hwinfo mobile rs485 || \
ucidef_set_hwinfo mobile ios rs485
ucidef_add_serial_capabilities "rs485" \
"300 600 1200 2400 4800 9600 19200 38400 57600 115200 \
230400 460800 921600 1000000 3000000" \
"5 6 7 8" \
"xon/xoff none" \
"1 2" \
"even odd mark space none" \
"/tty/ttyHS0"
if [ "${model:6:1}" = "2" ]; then
ucidef_set_release_version "7.1"
elif [ "${model:6:1}" = "4" ]; then
ucidef_set_release_version "7.4.3"
fi
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
TCR100*)
ucidef_set_led_switch "lan" "LAN" "eth1_led" "switch0" "0x10"
ucidef_set_led_netdev "wan" "WAN" "eth2_led" "eth1"
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_wlan_bssid_limit "wlan0" 8
ucidef_add_wlan_bssid_limit "wlan1" 8
ucidef_set_interface guest proto static type bridge \
guest 1 _wireless true _dhcp true
ucidef_add_static_modem_info "$model" "1-1" "1" "primary"
ucidef_set_hwinfo mobile wifi dual_band_ssid wps ethernet
ucidef_set_release_version "7.2.4"
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
;;
OTD140*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x2"
ucidef_add_switch "switch0" "4:lan:1" "1:lan:2" "6@eth0"
ucidef_set_interface_default_macaddr "lan" "$(mtd_get_mac_binary config 0x0)"
ucidef_set_interface "lan" "default_ip" "%%LAN_IP%%"
ucidef_add_static_modem_info "$model" "1-1" "2" "primary"
ucidef_set_hwinfo ethernet mobile dual_sim poe
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
ucidef_set_poe 2 15400 1 "lan2" "3" 15400
ucidef_set_poe_chip "0X77" "0:lan2"
ucidef_set_poe_chip "0X2F" "1:lan2"
;;
OTD160*)
ucidef_set_led_switch "lan1" "LAN1" "eth1_led" "switch0" "0x04"
ucidef_set_led_switch "lan2" "LAN2" "eth2_led" "switch0" "0x02"
ucidef_set_interface_lan "eth0"
ucidef_add_wlan_bssid_limit "wlan0" 8
ucidef_add_wlan_bssid_limit "wlan1" 8
ucidef_add_static_modem_info "$model" "1-1" "2" "primary"
ucidef_set_hwinfo dual_sim mobile wifi dual_band_ssid ethernet
ucidef_set_network_options "vlans" 16 "readonly_vlans" 1
;;
TAP100*)
ucidef_set_led_switch "lan" "LAN" "eth0_led" "switch0" "0x10"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_set_interface_lan "eth0"
ucidef_set_interface "lan" "ipv6" "1"
ucidef_set_interface_default_macaddr "lan" "$(mtd_get_mac_binary config 0x0)"
ucidef_set_hwinfo wifi ethernet sw_rst_on_init
ucidef_set_network_options "ula" false "disable_vlan" true "ip6assign" false "vlans" 16 "readonly_vlans" 1 "no_metric" true
ucidef_set_interface "dhcp" "device" "@lan" "proto" "dhcp"
;;
TRB500*)
ucidef_set_interface_lan "eth0 ecm0"
ucidef_set_interface_default_macaddr "lan" "$(mtd_get_mac_binary mnf_info 0x0)" \
"$(macaddr_add "$(mtd_get_mac_binary mnf_info 0x0)" 1)"
ucidef_set_hwinfo mobile ethernet ios
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
RUTM50*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
ucidef_set_usb_jack "/usb1/1-2/"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_wlan_bssid_limit "wlan1" 4
ucidef_add_static_modem_info "$model" "2-1" "2" "primary" "gps_out"
ucidef_set_hwinfo usb ethernet ios gps mobile wifi dual_band_ssid dual_sim at_sim dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
RUTM51*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
ucidef_set_usb_jack "/usb1/1-2/"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_wlan_bssid_limit "wlan1" 4
ucidef_add_static_modem_info "$model" "2-1" "2" "primary"
ucidef_set_hwinfo usb ethernet ios mobile wifi dual_band_ssid dual_sim at_sim dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
ucidef_set_release_version "7.4.4"
;;
RUTM08*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_set_hwinfo usb ethernet ios dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
RUTM09*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
ucidef_add_static_modem_info "$model" "1-2" "2" "primary" "gps_out"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_set_hwinfo usb ethernet ios gps mobile dual_sim dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
RUTM10*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_wlan_bssid_limit "wlan1" 4
ucidef_set_hwinfo usb ethernet ios wifi dual_band_ssid dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
RUTM11*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
ucidef_set_usb_jack "/usb1/1-1/"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_wlan_bssid_limit "wlan1" 4
ucidef_add_static_modem_info "$model" "1-2" "2" "primary" "gps_out"
ucidef_set_hwinfo usb ethernet ios gps mobile wifi dual_band_ssid dual_sim dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
RUTM12*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
ucidef_set_usb_jack "/usb1/1-2/1-2.3/"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_wlan_bssid_limit "wlan1" 4
ucidef_add_static_modem_info "$model" "1-1" "1" "primary" "gps_out"
ucidef_add_static_modem_info "$model" "1-2.2" "1"
ucidef_set_hwinfo usb ethernet ios gps mobile wifi dual_band_ssid dual_modem dsa hw_nat
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
x86)
ucidef_set_interface_wan "eth0"
ucidef_set_interface_lan "eth1"
ucidef_add_wlan_bssid_limit "wlan0" 4
ucidef_add_wlan_bssid_limit "wlan1" 4
ucidef_set_hwinfo usb wifi dual_band_ssid ethernet
ucidef_set_network_options "vlans" 4094 "readonly_vlans" 1
;;
*)
echo "Unsupported hardware. Network interfaces not intialized"
;;
esac
ucidef_set_interface "lan" "default_ip" "%%LAN_IP%%"
type ucidef_target_defaults &> /dev/null && \
ucidef_target_defaults "$model"
}
#~ Get model name for RUTX products
if ! model="$(mnf_info --name)" 2>/dev/null; then
model="$(mnf_info --prod-code)" 2>/dev/null
fi
platform="$(cat /proc/device-tree/platform)" 2>/dev/null
board_config_update
setup_json "$model"
ucidef_set_board_platform "$platform"
board_config_flush
exit 0