@@ -114,7 +114,7 @@ update_config()
114114 config_get en_bridge $modem_config en_bridge
115115 config_get do_not_add_dns $modem_config do_not_add_dns
116116 config_get dns_list $modem_config dns_list
117- [ " $manufacturer " == " fibocom " ] && [ " $platform " == " mediatek " ] && config_get mtk_check $modem_config mtk_check
117+ config_get connect_check $modem_config connect_check
118118 config_get global_dial main enable_dial
119119 # config_get ethernet_5g u$modem_config ethernet 转往口获取命令更新,待测试
120120 config_foreach get_associate_ethernet_by_path modem-slot
@@ -266,7 +266,7 @@ check_ip()
266266 " neoway" )
267267 case $platform in
268268 " unisoc" )
269- check_ip_command=' AT$MYUSBNETACT? '
269+ check_ip_command=" AT+CGPADDR=1 "
270270 ;;
271271 esac
272272 ;;
@@ -280,9 +280,6 @@ check_ip()
280280 local config=$( umbim -d $mbim_port config)
281281 ipaddr=$( echo " $config " | grep " ipv4address:" | awk ' {print $2}' | cut -d' /' -f1)
282282 ipaddr=" $ipaddr $( echo " $config " | grep " ipv6address:" | awk ' {print $2}' | cut -d' /' -f1) "
283- elif [ " $manufacturer " = " neoway" ]; then
284- # $MYURCACT: 0,1,"10.92.220.73"
285- ipaddr=$( at " $at_port " " $check_ip_command " | grep ' $MYUSBNETACT:' )
286283 else
287284 ipaddr=$( at " $at_port " " $check_ip_command " | grep +CGPADDR:)
288285 fi
@@ -315,10 +312,10 @@ check_ip()
315312 fi
316313}
317314
318- check_mtk_connection ()
315+ check_connection ()
319316{
320317 [ " $connection_status " = " 0" ] || [ " $connection_status " = " -1" ] && return 0
321- if [ " $mtk " -eq 1 ] && [ -n " $ipv4 " ] && [ -n " $modem_netcard " ]; then
318+ if [ -n " $ipv4 " ] && [ -n " $modem_netcard " ]; then
322319 for i in 1 2; do
323320 if ping -I " $modem_netcard " -w 1 1.1.1.1 > /dev/null 2>&1 ||
324321 ping -I " $modem_netcard " -w 2 8.8.8.8 > /dev/null 2>&1 ; then
@@ -331,18 +328,9 @@ check_mtk_connection()
331328 sleep 1
332329 done
333330 local ifup_time=$( ubus call network.interface.$interface6_name status 2> /dev/null | jsonfilter -e ' @.uptime' 2> /dev/null || echo 0)
334- if [ -n " $ifup_time " ] && [ " $ifup_time " -gt 5 ] && [ " $pdp_type " = " ipv4v6" ] && [ -n " $ipv6 " ]; then
335- for i in 1 2; do
336- if ping6 -I " $modem_netcard " -w 1 2400:3200::1 > /dev/null 2>&1 ||
337- ping6 -I " $modem_netcard " -w 2 2001:4860:4860::8888 > /dev/null 2>&1 ; then
338- break
339- fi
340- if [ $i -eq 2 ]; then
341- m_debug " IPv6 connection test failed, restarting IPv6 interface"
342- [ -n " $interface6_name " ] && ifdown " $interface6_name " && sleep 2 && ifup " $interface6_name "
343- fi
344- sleep 1
345- done
331+ if [ " $ifup_time " -gt 5 ] && [ " $pdp_type " = " ipv4v6" ]; then
332+ rdisc6 $origin_device &
333+ ndisc6 fe80::1 $origin_device &
346334 fi
347335 fi
348336 return 0
@@ -660,14 +648,15 @@ ecm_hang()
660648 at_command=" AT^NDISDUP=0,0"
661649 ;;
662650 " neoway" )
651+ delay=3
663652 at_command=' AT$MYUSBNETACT=0,0'
664653 ;;
665654 * )
666655 at_command=" ATI"
667656 ;;
668657 esac
669-
670658 fastat " ${at_port} " " ${at_command} "
659+ sleep " $delay "
671660}
672661
673662hang ()
@@ -819,7 +808,7 @@ at_dial()
819808 cgdcont_command=" AT+CGDCONT=1,\" $pdp_type \" ,\" $apn \" "
820809 ;;
821810 " mediatek" )
822- mtk=1
811+ delay=3
823812 if [ " $apn " = " auto" ]; then
824813 apn=" cbnet"
825814 fi
@@ -859,17 +848,13 @@ at_dial()
859848 at_command=' AT$MYUSBNETACT=0,1'
860849 cgdcont_command=" AT+CGDCONT=1,\" $pdp_type \" ,\" $apn \" "
861850 ;;
862- " unisoc" )
863- at_command=" "
864- cgdcont_command=" AT+CGDCONT=1,\" $pdp_type \" ,\" $apn \" "
865- ;;
866851 esac
867852 ;;
868853 esac
869854 m_debug " dialing vendor:$manufacturer ;platform:$platform ; $cgdcont_command ; $at_command "
870855 at " ${at_port} " " ${cgdcont_command} "
871856 fastat " $at_port " " $at_command "
872- [ " $mtk " -eq 1 ] && sleep 2
857+ sleep " $delay "
873858 if [ " $driver " = " mtk_pcie" ]; then
874859 fastat " $at_port " " AT+CGACT=0,3"
875860 mbim_port=$( echo " $at_port " | sed ' s/at/mbim/g' )
@@ -1058,7 +1043,7 @@ at_dial_monitor()
10581043 ipv4_cache=$ipv4
10591044 ipv6_cache=$ipv6
10601045 fi
1061- [ " $mtk_check " -eq 1 ] && { sleep 5; check_mtk_connection || { fastat " $at_port " " AT+CGACT=0,3 " && at_dial; }; } || sleep 15
1046+ [ " $connect_check " -eq 1 ] && { sleep 5; check_connection || { hang && at_dial; }; } || sleep 15
10621047 ;;
10631048 esac
10641049 check_logfile_line
0 commit comments