Commit Graph

7030 Commits

Author SHA1 Message Date
Aleksander Morgado
130ea74cc9 iface-modem: move sim hot swap ready to correct place in sequence 2020-08-01 10:01:57 +02:00
Giacinto Cifelli
4f1da87972 cinterion: IMT family SGAUTH
some ITM family modems require full parameters:
	AT^SGAUTH=cid,type,user,pwd
even when type is AUTH_NONE.
Fortunately, all modules of the IMT family tolerate this syntax,
so it can be adopted for the entire family.
2020-07-27 11:34:16 +00:00
Giacinto Cifelli
07ac85e2f7 cinterion: ignore ^SYSSTART urc 2020-07-27 12:24:17 +02:00
Giacinto Cifelli
408ec530e0 cinterion: extend SGAUTH syntax
AT^SGAUTH syntax depends on the modem family:
  AT^SGAUTH=cid,type,user,pwd   for the IMT family
  AT^SGAUTH=cid,type,pwd,user   for the rest
2020-07-27 09:42:03 +02:00
Giacinto Cifelli
cec6fe9cce cinterion: radio/band single scfg line: no variance
the AT^SCFG="Radio/Band" command does not return a different answer
for different charsets.
This code was working previously because the charset was left to default (GSM)
at the time of this operation, and therefore the string was unchanged anyway.
2020-07-26 13:33:05 +00:00
Giacinto Cifelli
4d58278d7f changed default authentication algorithm to CHAP
CHAP is almost universal nowadays, and so it is a better default
than PAP

Not changed for uBlox, that prefers an error if not specified,
and for Huawei, which uses NONE with user/pwd and has 2 CHAP choices
2020-07-24 16:34:40 +02:00
Sven Schwermer
c70b355718 qmi: Network registration via SSSP if possible
Doing the network registration via Set System Selection Preference is
preferable because it doesn't override the currently set allowed mode,
i.e. access technology.

https://lists.freedesktop.org/archives/modemmanager-devel/2020-July/007972.html

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2020-07-16 08:13:10 +00:00
Justin Standring
47a28114ba broadband-modem-qmi: fix -Wempty-body warning
mm-broadband-modem-qmi.c: In function 'process_common_info':
  mm-broadband-modem-qmi.c:2897:30: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
               /* both apply */ ;
                                ^

Signed-off-by: Justin Standring <justin.standring@taitradio.com>
2020-07-16 13:37:55 +12:00
Justin Standring
6ec12add1b broadband-modem-qmi: fix object logging with WITH_NEWEST_QMI_COMMANDS
mm-broadband-modem-qmi.c: In function 'common_signal_info_get_quality':
  mm-broadband-modem-qmi.c:1469:21: error: 'self' undeclared (first use in this function)
           mm_obj_dbg (self, "RSSI (CDMA): %d dBm", cdma1x_rssi);
                       ^~~~
  mm-broadband-modem-qmi.c:1469:21: note: each undeclared identifier is reported only once for each function it appears in
           mm_obj_dbg (self, "RSSI (CDMA): %d dBm", cdma1x_rssi);
                       ^~~~
  mm-broadband-modem-qmi.c: In function 'process_gsm_info':
  mm-broadband-modem-qmi.c:2992:25: error: 'self' undeclared (first use in this function)
               mm_obj_dbg (self, "no GSM service reported");
                           ^~~~
  mm-broadband-modem-qmi.c: In function 'process_wcdma_info':
  mm-broadband-modem-qmi.c:3100:25: error: 'self' undeclared (first use in this function)
               mm_obj_dbg (self, "no WCDMA service reported");
                           ^~~~
  mm-broadband-modem-qmi.c: In function 'process_lte_info':
  mm-broadband-modem-qmi.c:3209:25: error: 'self' undeclared (first use in this function)
               mm_obj_dbg (self, "no LTE service reported");
                           ^~~~
  mm-broadband-modem-qmi.c: In function 'config_signal_info_ready':
  mm-broadband-modem-qmi.c:4890:21: error: 'self' undeclared (first use in this function)
           mm_obj_dbg (self, "QMI operation failed: '%s'", error->message);
                       ^~~~

Signed-off-by: Justin Standring <justin.standring@taitradio.com>
2020-07-16 13:37:46 +12:00
Aleksander Morgado
e98bc7cc08 broadband-modem-qmi: fix parsing of USSD indications with UTF-16 data
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/240
2020-07-08 11:40:41 +02:00
Aleksander Morgado
a131c6953a cinterion: quote user/password strings in AT^SGAUTH calls
The ELS61 doesn't like authentication given without quotes:
  [modem3/ttyACM1/at] --> 'AT^SGAUTH=8,1,tm,t-mobile<CR>'
  [modem3/ttyACM1/at] <-- '<CR><LF>+CME ERROR: 4<CR><LF>'

Only when user/pass strings are quoted it works:
  [modem6/ttyACM1/at] --> 'AT^SGAUTH=8,1,"t-mobile","tm"<CR>'
  [modem6/ttyACM1/at] <-- '<CR><LF>OK<CR><LF>'
2020-07-06 16:54:07 +02:00
Aleksander Morgado
0a89a9ae4e cinterion: if user OR password given, don't set the other as (null)
[modem2/ttyACM1/at] --> 'AT^SGAUTH=8,1,t-d1,(null)<CR>'
  [modem2/ttyACM1/at] <-- '<CR><LF>+CME ERROR: 4<CR><LF>'

We should use an empty string instead.
2020-07-06 16:23:57 +02:00
Aleksander Morgado
e933fe1413 cinterion: increase SWWAN connection attempt timeout
It's critical not to timeout early on devices with AT ports, or we may
end up flagging the modem as invalid.

  ModemManager[26829]: <debug> [1593097973.552712] [modem1/ttyACM0/at] --> 'AT^SWWAN=1,2,1<CR>'
  ....
  ModemManager[26829]: <debug> [1593098064.195217] [modem1] couldn't connect bearer: Serial command timed out
  ....
  ModemManager[26829]: <error> [1593098091.167987] [modem1] port ttyACM0 timed out 10 consecutive times, marking modem as invalid
2020-07-06 16:23:36 +02:00
Aleksander Morgado
bdbd0fc049 iface-modem-signal: port skeleton update logic to use g_autoptr 2020-07-04 06:37:07 +02:00
Aleksander Morgado
3d138f9f80 iface-modem-signal: remove unneeded skeleton clear attempt
It won't do anything because clear_values() tries to get the skeleton
from the modem object, and the skeleton hasn't been set at that point.
2020-07-04 06:37:07 +02:00
Aleksander Morgado
c79dcf7940 cinterion,signal: ^SMONI=? support check may be cached 2020-07-04 06:37:07 +02:00
Aleksander Morgado
ee262a473d cinterion,signal: report error from parent signal support check 2020-07-04 06:37:07 +02:00
Aleksander Morgado
2cb8e5ef5d cinterion,signal: minor coding style fixes 2020-07-04 06:37:07 +02:00
Aleksander Morgado
900f318d53 docs,libmm-glib: add missing nr5g methods in signal interface 2020-07-04 06:35:25 +02:00
Aleksander Morgado
6f6c090076 broadband-modem: remove misleading comment
5GNR is not 3GPP2
2020-07-04 06:35:25 +02:00
Aleksander Morgado
24670498bc broadband-modem-qmi: minor alignment updates 2020-07-04 06:35:25 +02:00
Aleksander Morgado
10ee7f4cd9 mbim,signal: make sure output pointers are always set
E.g. if 'gsm' pointer is given, make sure it's always set (either to a
MMSignal or to NULL).
2020-07-04 05:50:41 +02:00
Aleksander Morgado
0dd1f12222 mbim,signal: provide 5G signal info if loaded by parent implementation 2020-07-04 05:50:41 +02:00
Walter Hagstrom
88923ffe39 iface-modem-signal: added 5G signal information
Extended the ModemManager Signal interface to include 5G signal
information for RSRP, RSRQ and SINR via libqmi.  Also extended mmci
to print 5G signal info.
2020-07-04 05:50:41 +02:00
Aleksander Morgado
711b17278e build: require 5G signal info support from libqmi 1.27.1 2020-07-04 05:50:41 +02:00
Adrien Plazas
6df9cc0844 plugin: define an autofree value to NULL
This satisfies -Werror=maybe-uninitialized.
2020-07-03 08:26:57 +02:00
Daniele Palmas
fff47478cc telit: added port type hints for default MEx10G1 composition
While at this change also the previous generic reference to ME910
in order to differentiate between ME910C1 (based on MDM9206) and
MEx10G1 (based on MDM9205).
2020-07-02 13:09:19 +02:00
Aleksander Morgado
23f8b580c3 quectel,shared: implement custom time support check
We require CTZU=3 during the time support check, instead of CTZU=1, so
that the Quectel modem reports localtime instead of UTC time in +CCLK.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/233
2020-06-30 13:12:25 +02:00
Aleksander Morgado
ffca45d9cc quectel,shared: add GPS trace handler 2020-06-29 08:53:00 +00:00
Aleksander Morgado
70b7218b7b huawei: only flag GPS source as enabled if it was successful 2020-06-29 08:53:00 +00:00
Aleksander Morgado
af8afcc6c9 quectel,shared: only flag GPS source as enabled if it was successful 2020-06-29 08:53:00 +00:00
Aleksander Morgado
619b054e5c libmm-glib,location: avoid warnings when no traces available
ModemManager[201411]: <debug> [1593417744.011884] [modem0/ttyUSB1/gps] <-- '$GPVTG,,T,,M,,N,,K,N*2C<CR><LF>$GPGSA,A,1,,,,,,,,,,,,,,,*1E<CR><LF>$GPGGA,,,,,,0,,,,,,,,*66<CR><LF>$GPRMC,,V,,,,,,,,,,N*53<CR><LF>'

    (ModemManager:201411): GLib-CRITICAL **: 10:02:24.054: g_strjoinv: assertion 'str_array != NULL' failed

    Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap.
    0x00007ffff7832473 in g_logv () from /usr/lib/libglib-2.0.so.0
    (gdb) bt
    #0  0x00007ffff7832473 in g_logv () at /usr/lib/libglib-2.0.so.0
    #1  0x00007ffff78326f0 in g_log () at /usr/lib/libglib-2.0.so.0
    #2  0x00007ffff7846b5e in g_strjoinv () at /usr/lib/libglib-2.0.so.0
    #3  0x00007ffff7ee9663 in mm_location_gps_nmea_get_string_variant (self=0x5555557dde50) at mm-location-gps-nmea.c:246
    #4  0x00005555555e7c47 in build_location_dictionary (previous=0x0, location_3gpp=0x55555573e660, location_gps_nmea=0x5555557dde50, location_gps_raw=0x0, location_cdma_bs=0x0)
        at mm-iface-modem-location.c:183
    ...
    (gdb) fr 3
    #3  0x00007ffff7ee9663 in mm_location_gps_nmea_get_string_variant (self=0x5555557dde50) at mm-location-gps-nmea.c:246
    246	    built = g_strjoinv ("\r\n", traces);
    (gdb) p traces
    $1 = (GStrv) 0x0
2020-06-29 08:53:00 +00:00
Aleksander Morgado
60211b51b1 quectel,shared: use QGPS=? test to check capabilities 2020-06-29 08:53:00 +00:00
Aleksander Morgado
58dbb68fa0 quectel,qmi: add QGPS based fallback support 2020-06-29 08:53:00 +00:00
Aleksander Morgado
78d19c10ba quectel,shared: port GPS enabling to use AT sequence 2020-06-29 08:53:00 +00:00
Aleksander Morgado
41ba7d667a huawei: simplify GPS stop logic
The NMEA data port is closed right before stopping the engine.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
aa4851ed03 huawei: port GPS enabling to use AT sequence 2020-06-29 08:53:00 +00:00
Aleksander Morgado
bbca65d682 quectel,shared: skip QGPS? check after enabling/disabling failures
If any enabling/disabling command fails, we consider the operation
failed, regardless of the QGPS status. This is because e.g. enabling
involves more operations than just QGPS=1, and so we should treat a
failure in the command sequence as a failure in the whole operation.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
bbfc10d7c5 huawei: minor refactor in GPS enabling/disabling logic 2020-06-29 08:53:00 +00:00
Aleksander Morgado
538ed3f24e quectel,shared: don't report GPS capabilities if no GPS port found
The QGPS based implementation needs the existence of a port flagged as
GPS data; if there is no such port, we cannot provide GPS support.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
77f6637750 quectel,shared: fix reporting supported location capabilities
The method that reports what location capabilities are supported must
report the capabilities provided by the parent interface plus the
additional capabilities supported by the shared implementation.

Also, simplify the logic a bit reducing the amount of implemented
methods.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
0f9d69fd35 quectel,shared: private context at beginning of source file 2020-06-29 08:53:00 +00:00
Aleksander Morgado
234ba4544b quectel: coding style fixes in the QGPS logic 2020-06-29 08:53:00 +00:00
Aleksander Morgado
5a9d321346 quectel,shared: fix parent location disabling
The GTask must be passed as user_data.
2020-06-29 08:53:00 +00:00
ArenM
df393df147 quectel: implement GPS support with +QGPS
Quectel modems allow provide location information via AT commands.
Add this as a location source.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
4b37b7d3cf base-modem,at: response processors return a more specific enum
Instead of using the FALSE return of the method to indicate either a
fatal error (if result_error was set) or the continuation request (if
result_error wasn't set), provide a enum that has explicit states for
all three possible values (failure, success or continue).
2020-06-28 15:07:34 +02:00
Aleksander Morgado
c4d82aaf1e base-modem,at: improve documentation on response processor methods 2020-06-28 15:07:34 +02:00
Aleksander Morgado
7e3863897e broadband-modem: run implicit disabling if enabling fails
The disabling sequence is updated so that the steps to disable the
interfaces never fail. This is done so that the modem is not left
in an "inconsistent" enabled state, if e.g. the modem is enabled and
one of the disabling steps for the interfaces ends up failing. In this
case, it is preferred to say that the modem is disabled, than having
it wrongly enabled.

The enabling sequence is updated so that if any of the steps to enable
the interfaces fail, we end up running an implicit disabling operation
to disable all the interfaces. This is to attempt to cleanup whatever
we had enabled during the enabling operation, including e.g. the open
ports context.
2020-06-28 08:17:25 +00:00
Aleksander Morgado
408e9f327e broadband-modem-qmi: fix assertion when disabling unsolicited events
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/230
2020-06-24 09:31:30 +02:00
Aleksander Morgado
c6d213d652 broadband-modem-qmi,bearer-qmi: avoid depending on the client version
The QMI client version is an information provided by the QMI protocol
only when QMUX or MBIM backends are used, it won't be available when
e.g. QRTR is used. The logic in ModemManager should not rely on this
information.
2020-06-23 12:29:05 +00:00