mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Some part of 6.1 RUTX support
This commit is contained in:
parent
cfce9f52b2
commit
21b307a2f6
16 changed files with 3061 additions and 370 deletions
|
@ -8,6 +8,9 @@
|
|||
. /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"
|
||||
|
||||
|
@ -16,96 +19,155 @@ setup_json() {
|
|||
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" "gps_out"
|
||||
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_static_modem_info "$model" "3-1" "2" "gps_out"
|
||||
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_static_modem_info "$model" "3-1" "2"
|
||||
ucidef_set_hwinfo dual_sim usb mobile wifi dual_band_ssid ethernet sfp_port
|
||||
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_hwinfo usb gps mobile wifi dual_band_ssid bluetooth ethernet ios
|
||||
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_static_modem_info "$model" "1-1" "2" "gps_out"
|
||||
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_static_modem_info "$model" "2-1" "2" "gps_out"
|
||||
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_static_modem_info "$model" "2-1" "2" "gps_out"
|
||||
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" "gps_out"
|
||||
ucidef_add_serial_capabilities "rs232 rs485" \
|
||||
"300 600 1200 2400 4800 9600 14400 19200 38400 56000 57600 115200 \
|
||||
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"
|
||||
ucidef_set_hwinfo dual_sim mobile gps ethernet ios
|
||||
"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*)
|
||||
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" "6@eth0"
|
||||
ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary config 0x0)"
|
||||
ucidef_set_interface_macaddr "wan" "$(macaddr_add "$(mtd_get_mac_binary config 0x0)" 1)"
|
||||
ucidef_add_static_modem_info "$model" "1-1" "1"
|
||||
[ "${model:7:1}" = "1" ] && ucidef_set_hwinfo mobile wifi \
|
||||
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_static_modem_info "$model" "1-1" "1"
|
||||
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"
|
||||
|
@ -114,16 +176,34 @@ setup_json() {
|
|||
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_static_modem_info "$model" "1-1" "1"
|
||||
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"
|
||||
|
@ -131,10 +211,12 @@ setup_json() {
|
|||
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"
|
||||
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"
|
||||
|
@ -142,65 +224,284 @@ setup_json() {
|
|||
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.4" "2" "gps_out"
|
||||
[ "${model:7:2}" = "06" ] && ucidef_set_hwinfo dual_sim usb gps \
|
||||
mobile wifi ethernet || ucidef_set_hwinfo dual_sim usb gps \
|
||||
mobile wifi ethernet ios
|
||||
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" \
|
||||
"200 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 \
|
||||
230400 460800 500000 576000" \
|
||||
"5 6 7 8"
|
||||
"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 1800 2400 4800 9600 19200 38400 57600 115200 230400 \
|
||||
460800 500000 576000 921600 1000000 1152000 1500000 2000000 \
|
||||
2500000 3000000" \
|
||||
"8"
|
||||
"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"
|
||||
ucidef_add_trb14x_lte_modem "$model"
|
||||
ucidef_add_nand_info "$model"
|
||||
[ "${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_add_trb14x_lte_modem "$model"
|
||||
ucidef_add_nand_info "$model"
|
||||
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
|
||||
;;
|
||||
TRB142* |\
|
||||
TRB145*)
|
||||
ucidef_set_interface_lan "rndis0"
|
||||
ucidef_add_trb14x_lte_modem "$model"
|
||||
ucidef_add_nand_info "$model"
|
||||
[ "${model:7:1}" = "2" ] && ucidef_set_hwinfo mobile || \
|
||||
ucidef_set_hwinfo mobile ios
|
||||
[ "${model:5:1}" = "2" ] && local rs="rs232"
|
||||
ucidef_add_serial_capabilities "${rs:-rs485}" \
|
||||
"300 600 1200 2400 4800 9600 19200 38400 57600 115200 460800" \
|
||||
"5 6 7 8"
|
||||
[ "${model:5:2}" = "23" -o "${model:5:2}" = "52" ] && \
|
||||
[ "${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"
|
||||
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
|
||||
model="$(mnf_info --name)" 2>/dev/null
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue