Skip to content

Commit e69a031

Browse files
committed
qmodem: add support for dialing and monitoring MTK_T7XX devices.
1 parent 4578191 commit e69a031

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

luci/luci-app-qmodem/root/usr/share/qmodem/modem_ctrl.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ get_at_cfg(){
6767
duns=$(ls /dev/mhi_DUN*)
6868
ttys=$(ls /dev/ttyUSB*)
6969
ttyacms=$(ls /dev/ttyACM*)
70-
all_ttys="$duns $ttys $ttyacms"
70+
wwanNatN=$(ls /dev/wwan* |grep -E wwan[0-9]at[0-9])
71+
all_ttys="$duns $ttys $ttyacms $wwanNatN"
7172
json_add_array other_ttys
7273
for tty in $all_ttys; do
7374
[ -n "$tty" ] && json_add_string "" "$tty"

luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ get_driver()
7979
if [ "$type" == "l" ];then
8080
link=$(basename $(ls -l $i | awk '{print $11}'))
8181
case $link in
82+
"mtk_t7xx")
83+
mode="mtk_pcie"
84+
break
85+
;;
8286
"qmi_wwan"*)
8387
mode="qmi"
8488
break
@@ -608,6 +612,9 @@ dial(){
608612
"rndis")
609613
at_dial_monitor
610614
;;
615+
"mtk_pcie")
616+
at_dial_monitor
617+
;;
611618
*)
612619
mbim_dial
613620
;;

luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ get_default_metric()
4040
_get_associated_usb_by_path()
4141
{
4242
local cfg="$1"
43-
echo $target_slot
43+
m_debug $target_slot
4444
config_get _get_slot $cfg slot
4545
if [ "$target_slot" == "$_get_slot" ];then
4646
config_get associated_usb $cfg associated_usb
47-
echo \[$target_slot\]associated_usb:$associated_usb
47+
m_debug \[$target_slot\]associated_usb:$associated_usb
4848
fi
4949

5050
}
@@ -171,9 +171,17 @@ scan_pcie_slot_interfaces()
171171
dun_device=$(ls "$wwan0_path" | grep wwan0at0)
172172
[ ! -z "$dun_device" ] && dun_device_path="$wwan0_path/$dun_device"
173173
[ ! -z "$dun_device_path" ] && dun_devices=$(basename "$dun_device_path")
174+
fi
174175
fi
176+
#mt_t7xx device
177+
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]")
175183
fi
176-
m_debug "net_devices: $net_devices dun_devices: $dun_devices"
184+
echo "net_devices: $net_devices dun_devices: $dun_devices"
177185
at_ports="$dun_devices"
178186
[ -n "$net_devices" ] && get_associate_usb $slot
179187
if [ -n "$associated_usb" ]; then
@@ -250,7 +258,7 @@ scan_usb_slot_interfaces()
250258
;;
251259
esac
252260
done
253-
echo "net_devices: $net_devices tty_devices: $tty_devices"
261+
m_debug "net_devices: $net_devices tty_devices: $tty_devices"
254262
at_ports="$tty_devices"
255263
validate_at_port
256264
}

0 commit comments

Comments
 (0)