Skip to content
Snippets Groups Projects
Verified Commit 13fce479 authored by Jongmin Kim's avatar Jongmin Kim
Browse files

fcc-unlock: combine Quectel FCC unlock scripts for 1eac and 2c7c


Both scripts control MBIM ports and can be merged into a single script.

Signed-off-by: Jongmin Kim's avatarJongmin Kim <jmkim@debian.org>
parent 9ab4b7de
No related branches found
No related tags found
1 merge request!1308fcc-unlock: combine Quectel FCC unlock scripts and add support for RM520N
#!/bin/sh
# SPDX-License-Identifier: CC0-1.0
# 2021 Aleksander Morgado <aleksander@aleksander.es>
#
# Quectel EM120 FCC unlock operation
#
# require program name and at least 2 arguments
[ $# -lt 2 ] && exit 1
# first argument is DBus path, not needed here
shift
# second and next arguments are control port names
for PORT in "$@"; do
# match port type in Linux 5.14 and newer
grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null && {
MBIM_PORT=$PORT
break
}
# match port name in Linux 5.13
echo "$PORT" | grep -q MBIM && {
MBIM_PORT=$PORT
break
}
done
# fail if no MBIM port exposed
[ -n "$MBIM_PORT" ] || exit 2
# run mbimcli operation
mbimcli --device-open-proxy --device="/dev/$MBIM_PORT" --quectel-set-radio-state=on
exit $?
#!/bin/sh
# SPDX-License-Identifier: CC0-1.0
# 2021 Aleksander Morgado <aleksander@aleksander.es>
# 2022 Leah Oswald <mail@leahoswald.de>
# 2025 Jongmin Kim <jmkim@debian.org>
#
# Queltec EM05-G FCC unlock mechanism
# Quectel MBIM FCC unlock mechanism
# EM05-G, 2c7c:030a
# EM05-G (GR), 2c7c:0313
# EM05-G (RS), 2c7c:0314
# EM120, 1eac:1001
#
# require program name and at least 2 arguments
......@@ -14,16 +20,19 @@ shift
# second and next arguments are control port names
for PORT in "$@"; do
# match port name
# match port type in Linux 5.14 and newer
grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null ||
# match port name in Linux 5.13
echo "$PORT" | grep -q MBIM ||
echo "$PORT" | grep -q cdc-wdm && {
CDC_WDM_PORT=$PORT
MBIM_PORT="$PORT"
break
}
done
# fail if no cdc-wdm port exposed
[ -n "$CDC_WDM_PORT" ] || exit 2
# fail if no MBIM port exposed
[ -n "$MBIM_PORT" ] || exit 2
# run mbimcli operation
mbimcli --device-open-proxy --device="/dev/$CDC_WDM_PORT" --quectel-set-radio-state=on
mbimcli --device-open-proxy --device="/dev/$MBIM_PORT" --quectel-set-radio-state=on
exit $?
......@@ -14,7 +14,6 @@ examples = files(
'105b',
'1199',
'14c3',
'1eac',
'2c7c',
)
......@@ -32,7 +31,7 @@ vidpids = {
'413c:81a3': '1199',
'413c:81a8': '1199',
'14c3:4d75': '14c3',
'1eac:1001': '1eac',
'1eac:1001': '2c7c',
'2c7c:030a': '2c7c',
'2c7c:0313': '2c7c',
'2c7c:0314': '2c7c',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment