From 2712ae6ebf569f0f4e10d685e8f7a233252c3daf Mon Sep 17 00:00:00 2001 From: x-shark <958274685@qq.com> Date: Wed, 16 Apr 2025 14:07:50 +0000 Subject: [PATCH] feat: add sim8380g-m2 pcie mode,fix mhi pcie scan --- .../root/usr/share/qmodem/modem_scan.sh | 19 ++++++++++++------- .../root/usr/share/qmodem/modem_support.json | 19 +++++++++++++++++-- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh index e8b30ba..04b9d76 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh @@ -172,14 +172,16 @@ scan_pcie_slot_interfaces() [ ! -z "$dun_device" ] && dun_device_path="$wwan0_path/$dun_device" [ ! -z "$dun_device_path" ] && dun_devices=$(basename "$dun_device_path") fi - fi + fi #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]") + if [ -d "$wwan_path" ]; then + 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 fi echo "net_devices: $net_devices dun_devices: $dun_devices" at_ports="$dun_devices" @@ -299,6 +301,8 @@ match_config() [[ "$name" = *"T99W373"* ]] && name="t99w373" + [[ "$name" = *"SIM8380G"* ]] && name="SIM8380G-M2" + #rg200u-cn [[ "$name" = *"rg200u-cn"* ]] && name="rg200u-cn" @@ -321,7 +325,7 @@ get_modem_model() local at_port=$1 cgmm=$(at $at_port "AT+CGMM") sleep 1 - cgmm_1=$(at $at_port "AT+CGMM?") + cgmm_1=$(at $at_port "AT+CGMM") name_1=$(echo -e "$cgmm" |grep "+CGMM: " | awk -F': ' '{print $2}') name_2=$(echo -e "$cgmm_1" |grep "+CGMM: " | awk -F'"' '{print $2} '| cut -d ' ' -f 1) name_3=$(echo -e "$cgmm" | sed -n '2p') @@ -366,6 +370,7 @@ add() for trys in $(seq 1 3);do for at_port in $valid_at_ports; do m_debug "try at port $at_port;time $trys" + sleeps 1 get_modem_model "/dev/$at_port" [ $? -eq 0 ] && break || modem_name="" done diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_support.json b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_support.json index d2d451e..4272f05 100644 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_support.json +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_support.json @@ -750,6 +750,19 @@ "mbim" ] }, + "simcom_sim8380g-m2": { + "manufacturer": "simcom", + "platform": "qualcomm", + "data_interface": "pcie", + "define_connect": "1", + "wcdma_band": "1/2/3/4/5/8", + "lte_band": "1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/66/71", + "nsa_band": "1/2/3/5/7/8/12/20/28/40/41/48/66/71/77/78/79", + "sa_band": "1/2/3/5/7/8/12/20/28/40/41/48/66/71/77/78/79", + "modes": [ + "qmi" + ] + }, "rm500q-cn": { "manufacturer": "quectel", "platform": "qualcomm", @@ -1117,11 +1130,13 @@ "qualcomm": { "vendor_id": [ "1a0e", - "1e0e" + "1e0e", + "17cb" ], "product_id": [ "9001", - "9011" + "9011", + "0308" ] } },