@@ -172,14 +172,16 @@ scan_pcie_slot_interfaces()
172172 [ ! -z " $dun_device " ] && dun_device_path=" $wwan0_path /$dun_device "
173173 [ ! -z " $dun_device_path " ] && dun_devices=$( basename " $dun_device_path " )
174174 fi
175- fi
175+ fi
176176 # mt_t7xx device
177177 wwan_path=" $slot_path /wwan"
178- net_devices=$( ls " $wwan_path " | grep -E " wwan[0-9]" )
179- devices_path=" $wwan_path /$net_devices "
180- if [ -d " $devices_path " ]; then
181- mbim_devices=$( ls " $devices_path " | grep -E " wwan[0-9]mbim[0-9]" )
182- dun_devices=$( ls " $devices_path " | grep -E " wwan[0-9]at[0-9]" )
178+ if [ -d " $wwan_path " ]; then
179+ net_devices=$( ls " $wwan_path " | grep -E " wwan[0-9]" )
180+ devices_path=" $wwan_path /$net_devices "
181+ if [ -d " $devices_path " ]; then
182+ mbim_devices=$( ls " $devices_path " | grep -E " wwan[0-9]mbim[0-9]" )
183+ dun_devices=$( ls " $devices_path " | grep -E " wwan[0-9]at[0-9]" )
184+ fi
183185 fi
184186 echo " net_devices: $net_devices dun_devices: $dun_devices "
185187 at_ports=" $dun_devices "
@@ -299,6 +301,8 @@ match_config()
299301
300302 [[ " $name " = * " T99W373" * ]] && name=" t99w373"
301303
304+ [[ " $name " = * " SIM8380G" * ]] && name=" SIM8380G-M2"
305+
302306 # rg200u-cn
303307 [[ " $name " = * " rg200u-cn" * ]] && name=" rg200u-cn"
304308
@@ -321,7 +325,7 @@ get_modem_model()
321325 local at_port=$1
322326 cgmm=$( at $at_port " AT+CGMM" )
323327 sleep 1
324- cgmm_1=$( at $at_port " AT+CGMM? " )
328+ cgmm_1=$( at $at_port " AT+CGMM" )
325329 name_1=$( echo -e " $cgmm " | grep " +CGMM: " | awk -F' : ' ' {print $2}' )
326330 name_2=$( echo -e " $cgmm_1 " | grep " +CGMM: " | awk -F' "' ' {print $2} ' | cut -d ' ' -f 1)
327331 name_3=$( echo -e " $cgmm " | sed -n ' 2p' )
@@ -366,6 +370,7 @@ add()
366370 for trys in $( seq 1 3) ; do
367371 for at_port in $valid_at_ports ; do
368372 m_debug " try at port $at_port ;time $trys "
373+ sleeps 1
369374 get_modem_model " /dev/$at_port "
370375 [ $? -eq 0 ] && break || modem_name=" "
371376 done
0 commit comments