qmodem: add support for dialing and monitoring MTK_T7XX devices.

This commit is contained in:
fujr 2025-04-16 14:01:43 +08:00
parent 4578191a4e
commit e69a0311fd
3 changed files with 21 additions and 5 deletions

View File

@ -67,7 +67,8 @@ get_at_cfg(){
duns=$(ls /dev/mhi_DUN*) duns=$(ls /dev/mhi_DUN*)
ttys=$(ls /dev/ttyUSB*) ttys=$(ls /dev/ttyUSB*)
ttyacms=$(ls /dev/ttyACM*) ttyacms=$(ls /dev/ttyACM*)
all_ttys="$duns $ttys $ttyacms" wwanNatN=$(ls /dev/wwan* |grep -E wwan[0-9]at[0-9])
all_ttys="$duns $ttys $ttyacms $wwanNatN"
json_add_array other_ttys json_add_array other_ttys
for tty in $all_ttys; do for tty in $all_ttys; do
[ -n "$tty" ] && json_add_string "" "$tty" [ -n "$tty" ] && json_add_string "" "$tty"

View File

@ -79,6 +79,10 @@ get_driver()
if [ "$type" == "l" ];then if [ "$type" == "l" ];then
link=$(basename $(ls -l $i | awk '{print $11}')) link=$(basename $(ls -l $i | awk '{print $11}'))
case $link in case $link in
"mtk_t7xx")
mode="mtk_pcie"
break
;;
"qmi_wwan"*) "qmi_wwan"*)
mode="qmi" mode="qmi"
break break
@ -608,6 +612,9 @@ dial(){
"rndis") "rndis")
at_dial_monitor at_dial_monitor
;; ;;
"mtk_pcie")
at_dial_monitor
;;
*) *)
mbim_dial mbim_dial
;; ;;

View File

@ -40,11 +40,11 @@ get_default_metric()
_get_associated_usb_by_path() _get_associated_usb_by_path()
{ {
local cfg="$1" local cfg="$1"
echo $target_slot m_debug $target_slot
config_get _get_slot $cfg slot config_get _get_slot $cfg slot
if [ "$target_slot" == "$_get_slot" ];then if [ "$target_slot" == "$_get_slot" ];then
config_get associated_usb $cfg associated_usb config_get associated_usb $cfg associated_usb
echo \[$target_slot\]associated_usb:$associated_usb m_debug \[$target_slot\]associated_usb:$associated_usb
fi fi
} }
@ -173,7 +173,15 @@ scan_pcie_slot_interfaces()
[ ! -z "$dun_device_path" ] && dun_devices=$(basename "$dun_device_path") [ ! -z "$dun_device_path" ] && dun_devices=$(basename "$dun_device_path")
fi fi
fi fi
m_debug "net_devices: $net_devices dun_devices: $dun_devices" #mt_t7xx device
wwan_path="$slot_path/wwan"
net_devices=$(ls "$wwan_path" | grep -E "wwan[0-9]")
devices_path="$wwan_path/$net_devices"
if [ -d "$devices_path" ];then
mbim_devices=$(ls "$devices_path" | grep -E "wwan[0-9]mbim[0-9]")
dun_devices=$(ls "$devices_path" | grep -E "wwan[0-9]at[0-9]")
fi
echo "net_devices: $net_devices dun_devices: $dun_devices"
at_ports="$dun_devices" at_ports="$dun_devices"
[ -n "$net_devices" ] && get_associate_usb $slot [ -n "$net_devices" ] && get_associate_usb $slot
if [ -n "$associated_usb" ]; then if [ -n "$associated_usb" ]; then
@ -250,7 +258,7 @@ scan_usb_slot_interfaces()
;; ;;
esac esac
done done
echo "net_devices: $net_devices tty_devices: $tty_devices" m_debug "net_devices: $net_devices tty_devices: $tty_devices"
at_ports="$tty_devices" at_ports="$tty_devices"
validate_at_port validate_at_port
} }