diff options
author | Dan Williams <dan@ioncontrol.co> | 2024-11-19 22:51:35 -0600 |
---|---|---|
committer | Dan Williams <dan@ioncontrol.co> | 2024-12-27 23:42:09 -0600 |
commit | 60de5751b47f015d3a28bcb91354f3a966f64f9e (patch) | |
tree | 8aed905f3377a8257796a9bc027d1b4c91cd0b26 | |
parent | 377a1248658c3296a9f9ddc5e9bf17e154cb9fcf (diff) |
port-probe: add some QCDM/DIAG response bytes to non-AT responses
Seen on a Qualcomm-based Quectel EG915Q on the diag port:
ModemManager[34547]: <dbg> [1732077670.330527] [ttyUSB0/at] <-- ' \0\0\0\8\0\0\0\2\0\0\0\0`%\160$"\6\169\128\200\1\30\197\142\0G\184\225\128\0\1+\127\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254'
Signed-off-by: Dan Williams <dan@ioncontrol.co>
-rw-r--r-- | src/mm-port-probe.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 91f101e2..27f4b6e4 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -895,6 +895,13 @@ static const guint8 zerobuf[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static const guint8 quectel_qcdm[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, +}; + static gboolean is_non_at_response (const guint8 *data, gsize len) { @@ -910,6 +917,12 @@ is_non_at_response (const guint8 *data, gsize len) return TRUE; } + /* Observed on a Quectel EG915Q Qualcomm-based device's DIAG port */ + for (i = 0; (len >= sizeof (quectel_qcdm)) && (i < len - sizeof (quectel_qcdm)); i++) { + if (!memcmp (&data[i], quectel_qcdm, sizeof (quectel_qcdm))) + return TRUE; + } + /* Check for a well-known non-AT response. There are some ports (eg many * Icera-based chipsets, Qualcomm Gobi devices before their firmware is * loaded, Sierra CnS ports) that just shouldn't be probed for AT capability |