Commit Graph

1982 Commits

Author SHA1 Message Date
Aleksander Morgado
47dd9fffac cinterion: support ^SLCC URCs as part of voice management
This command will give us URCs whenever the extended list of current
calls changes, which includes information about the actual state of
each call, even for calls in waiting state.

Therefore, as this is a URC that applies to all calls, it's enabled
and disabled as part of the modem voice interface, instead of doing it
as part of the call object itself (i.e. not treated as an in-call URC).
2019-07-11 23:01:08 +02:00
Aleksander Morgado
e931c0ae9c cinterion: implement reset 2019-07-11 23:00:50 +02:00
Aleksander Morgado
0f8580f36e cinterion: port type hints for the PLS8
The first two ports are AT control ports (application/modem). We rely
on AT^SQPORT to decide which one is which.

The last two ports are unknown and we explicitly ignore them to make
port probing much quicker.
2019-07-11 23:00:50 +02:00
Aleksander Morgado
ed7be29111 broadband-modem,voice: disable unsolicited events 2019-07-11 23:00:50 +02:00
Ben Chan
8d8b3a722a misc: use g_regex_match() for simplicity
This CL converts a few g_regex_match_full() expressions to their
equivalent g_regex_match() in order to simplify the code, i.e.

  g_regex_match_full (regex, str, strlen (str), 0, 0, &match_info, NULL)

is equivalent to:

  g_regex_match_full (regex, str, -1, 0, 0, &match_info, NULL)

or simply:

  g_regex_match (regex, str, 0, &match_info)
2019-07-10 14:48:22 -07:00
Aleksander Morgado
1d52e5c24d cinterion: make custom +CIEV parser much more generic
The custom +CIEV parser configured for Cinterion modems was
exclusively matching the "psinfo" indicator updates, which were the
ones really used afterwards.

But, in order to avoid having undesired URCs mixed with other command
responses, we should anyway match any +CIEV indicator reported, not
only "psinfo".

The text indicator ids used in +CIEV seem to bee specific to Cinterion
devices when they're configured via AT^SIND, so we do a generic match
for any lowercase ascii text as indicator id.
2019-06-13 18:43:06 +02:00
Aleksander Morgado
ca5f2e8b3e ublox,tests: expect error if empty band list when parsing UACT? 2019-06-13 11:28:26 +02:00
Aleksander Morgado
20c5d7fd92 ublox: return error when no bands are parsed
If load_current_bands_finish() returns a NULL GArray, we must set the
GError or otherwise the daemon will segfault when the caller
dereferences the GError:

    current_bands = MM_IFACE_MODEM_GET_INTERFACE (self)->load_current_bands_finish (self, res, &error);
    if (!current_bands) {
        /* Errors when getting current bands won't be critical */
        mm_warn ("couldn't load current Bands: '%s'", error->message);
        g_error_free (error);
    }

This may happen with an empty but balid +UACT response, e.g.:
   AT+UACT?
   +UACT: ,,,
   OK

Or when it replies a full empty string:
   AT+UACT?
   OK
2019-06-13 10:26:53 +02:00
Aleksander Morgado
8092e301fc port-serial: allow deciding whether the command is queued last or run next
By default all the commands we were sending through the serial port
were added at the tail of the pending queue, but we may want to queue
them at the head in very specific cases (e.g. while sending an SMS).
2019-06-03 03:50:22 +00:00
Aleksander Morgado
8ec9789e3c quectel: add port type hints for the Quectel LTE-A EG06
ttyUSB0 (if #0): QCDM/DIAG port
 ttyUSB1 (if #1): GPS data port
 ttyUSB2 (if #2): AT primary port
 ttyUSB3 (if #3): AT secondary port
2019-05-30 17:28:13 +02:00
Aleksander Morgado
7f822fbc50 xmm,shared: don't assume parent object implements location support
E.g. when MM is built without QMI support, the MBIM modem won't have
any location support, as the only location implementation is based on
QMI over MBIM.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/125
2019-05-28 22:56:54 +02:00
Aleksander Morgado
254da81ebd telit: loading access tech should never use cached replies 2019-05-18 16:00:19 +02:00
Aleksander Morgado
44eac9e974 shared-xmm: implement support for MSB A-GPS 2019-04-09 12:24:39 +00:00
Aleksander Morgado
b77aa7ab0e location,agps: explicitly specify that MSA A-GPS is implemented
The A-GPS based implementations we currently have assume MSA A-GPS, so
rename the MMModemLocationSource enum value to reflect that.
2019-04-09 12:24:39 +00:00
Ben Chan
49f391b10d altair-lte: remove unused fields in DetailedDisconnectContext 2019-04-08 13:30:14 -07:00
Aleksander Morgado
210dc0be47 plugins,dell: port type hints for the DW5820e module 2019-04-08 12:45:28 +02:00
Ben Chan
7f78ef5010 via: fix memory leak in parent_setup_registration_checks_ready
This patch fixes a potential memory leak in
parent_setup_registration_checks_ready() where the allocated
SetupRegistrationChecksResults may be leaked when the MMIfaceModemCdma
parent's setup_registration_checks() fails.
2019-04-03 10:57:14 -07:00
Sven Schwermer
7e4a8d9566 ublox: add LISA/SARA-U2 alternative port types
When configuring these modems with AT+UUSBCONF=2, i.e. CDC-ECM + 4x
CDC-ACM, they also enumerate with a different PID on the USB. We need to
adjust the udev rules for that case in order to ignore the non-AT ports.

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-04-03 13:17:19 +02:00
Aleksander Morgado
147facd2ec plugins,test: setup new simple keyfile tester 2019-04-02 12:14:03 +02:00
Aleksander Morgado
2719265cbd dell,dw5821e: install carrier config mapping 2019-04-02 12:14:03 +02:00
Aleksander Morgado
8c053f637a dell,dw5821e: allow unmanaged GPS even when raw/nmea enabled
The raw/nmea GPS source setup is using QMI LOC operations, so there is
no point in disallowing the control of the unmanaged GPS source, as
the GPS data TTY is exclusively used for unmanaged GPS.
2019-04-02 08:40:26 +00:00
Ben Chan
43d454ab7f ublox: fix out-of-bounds array accesses
This patch fixes several invalid checks like this:

   array[i] && i < G_N_ELEMENTS (array)

which should instead be:

   i < G_N_ELEMENTS (array) && array[i]

to avoid an out-of-bounds access of the array.

Fixes: c1aa658802
2019-03-29 13:34:10 -07:00
Aleksander Morgado
0944e59252 ublox: parse +UGCNTRD stats as unsigned 64bit values
[1551646332.583651] (ttyACM2): --> 'AT+UGCNTRD<CR>'
  [1551646332.626567] (ttyACM2): <-- '<CR><LF>+UGCNTRD: 1,0,0,0,0<CR><LF><CR><LF>+UGCNTRD: 2,1397316870,113728263578,1397316870,113728263578<CR><LF><CR><LF>OK<CR><LF>'
  [1551646332.627120] Reloading stats failed: Couldn't load primary PDP context 2 statistics: Error parsing session RX bytes
2019-03-29 10:07:29 +00:00
Aleksander Morgado
5ef3c8eeb1 dell,dw5821e: firmware update support only if QMI is enabled 2019-03-13 10:57:43 +01:00
Daniele Palmas
c7be4af542 telit: add Telit MBIM broadband modem
Modes and band support are added through AT commands.
2019-02-28 16:09:10 +01:00
Daniele Palmas
3921c120b3 telit: move shared functions to mm-shared-telit 2019-02-28 15:42:28 +01:00
Aleksander Morgado
1093c124b4 dell,dw5821e: use DMS extension method to load properly formatted firmware version
And require libqmi 1.23.1.
2019-02-26 23:57:29 +01:00
Aleksander Morgado
0f6f89801e ublox: fix parser to report only bands supported by the module
We were filtering the 4G bands supported by the module when parsing
+UBANDSEL responses, e.g. so that we would not reply unsupported bands
for a given ubandsel value.

But we need the same filtering in 2G and 3G bands, because for example
some modules may support a specific 4G band with a given ubandsel
value, but NOT the associated 3G band. E.g. the TOBY-R200 supports
EUTRAN-4 but not UTRAN-4.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
278a72643a ublox,tests: fix R-200 UBANDSEL response tester 2019-01-30 12:10:03 +01:00
Aleksander Morgado
74bdc97b34 ublox: use fixed array sizes when iterating 2019-01-30 12:10:03 +01:00
Aleksander Morgado
8b9053822b ublox: fix loop looking for a specific 4g band value
We cannot have the ubandsel value comparision inside the for(;;) stop
conditions, because that would mean the loop would stop whenever the
comparison fails. We want to look for a value, so we need to loop the
whole array and stop once we find it only.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
36b5e1ee20 ublox: the whole list of supported bands is known
So, assert() if for any reason we're asking to use a band that we
don't find in the list.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
fec1c43f80 ublox: don't create array with totally unrelated size 2019-01-30 12:10:03 +01:00
Aleksander Morgado
de5b9e441f ublox: coding style fixes 2019-01-30 12:10:03 +01:00
Aleksander Morgado
d8cf219644 ublox,helpers: remove unit tests for supported bands
We're hardcoding the supported bands for each u-blox model, so there
really is no point in having unit tests for them.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
437fb830c8 ublox,helpers: assume all SARA/LARA devices require COPS 2019-01-30 12:10:03 +01:00
Aleksander Morgado
ea01ac73e2 ublox: COPS based registration requests with 120s AT command timeout 2019-01-30 12:10:03 +01:00
Aleksander Morgado
1d7f2c1a61 ublox: initial power state logic only required when CFUN used
When we're changing modes or bands, we only need to keep track of the
initial power state when CFUN=4/CFUN=1 based logic is used. When using
COPS, we do not need to track initial power state or recover it after
the operation.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
d12b919787 ublox,helpers: fix missing ubandsel support initializations 2019-01-30 12:10:03 +01:00
Aleksander Morgado
b1d69a69f9 ublox,helpers: rename enum
We're not going to use CFUN/COPS just for bands, but also for modes,
so use more generic names.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
308d9e4ddb ublox: fix band setting operation
If both UBANDSEL and UACT are unsupported, we were not initializing
the command variable.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
2677524f6a ublox: fix current bands loading completion
If both UACT and UBANDSEL are unsupported, the async operation was
never completed.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
c3f4fe063f ublox: rework support config loading
Make mm_ublox_get_support_config() return FALSE only when GError is
set. And also, prepare a preload_support_config() method to be run
before using any information from the support configuration (i.e.
don't do it in load_supported_bands(), do it in load_current_bands()
or in set_current_bands().
2019-01-30 12:10:03 +01:00
Aleksander Morgado
f2e3798bb3 ublox: really subclass register_in_network()
The implemented register_in_network() was totally unused.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
755964c9eb ublox: fix missing return in method definition
acquire_power_operation (MMBroadbandModemUblox  *self,
     ^~~~~~~~~~~~~~~~~~~~~~~
    ublox/mm-broadband-modem-ublox.c:74:1: error: no previous prototype for ‘acquire_power_operation’ [-Werror=missing-prototypes]
2019-01-30 12:10:03 +01:00
Aleksander Morgado
421b5e48e0 ublox,helpers: remove unused variable
ublox/mm-modem-helpers-ublox.c:1291:14: error: unused variable ‘found’ [-Werror=unused-variable]
         gboolean found;
                  ^~~~~
2019-01-30 12:10:03 +01:00
Aleksander Morgado
3575fe3528 ublox,helpers: fix mixed declarations and code
ublox/mm-modem-helpers-ublox.c:1298:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
       guint i, j, k;
       ^~~~~
2019-01-30 12:10:03 +01:00
Aleksander Morgado
4b507f3255 ublox: fix double task completion
If mm_ublox_get_supported_bands() and mm_ublox_get_support_config()
both failed, we would be completing the GTask twice. Fix it by
chaining both steps so that the second one is not run if the first one
is already failed.
2019-01-30 12:10:03 +01:00
Aleksander Morgado
bbb96cd3f9 ublox: minor indentation fixes 2019-01-30 12:10:03 +01:00
Mark-Jablonsky
c1aa658802 ublox: add band detection support for additional modems
The u-blox plugin was originally written to support the TOBY-L4 only.
This caused issues with mmcli reporting the correct supported and
current bands because the logic was based only for the TOBY-L4 and
the AT commands used in the implementaion are only supported by
a couple of modems.

There is now a hard-coded modem list that contains the supported bands
and the supported modes. A hard-coded list was chosen over a logic
based list because ublox modems only report the frequency of the bands
they support in the current mode they are in. For further justification,
the reported frequency could relate to multiple bands that are not all
supported by the modem, and not all the supported bands are always caught
depending on the mode the modem is in (e.g. 2G, 3G, 4G). The only
realiable way to retrieve the correct supported bands is to have the list
hard-coded. Based off of the modem, the code chooses whether it is
appropriate to issue +UACT or +UBANDSEL to retrieve the current bands list.
Additionally, the appropriate AT command of +CFUN=4 or +COPS=2 is chosen
to detach from the network when the mmcli --set-current-bands command is
issued. The new setup also adds a header file that contains the modem list.
This should make adding support for future additional modems easier as long
as future modems stick to the same AT command interface that is currently
supported by the plugin.
2019-01-30 12:10:03 +01:00