Commit Graph
3684 Commits
Author SHA1 Message Date
Aleksander Morgado c7dee320c0 test-qcdm-serial-port: fix warnings with -Wsign-compare
test-qcdm-serial-port.c: In function 'wait_for_child':
  test-qcdm-serial-port.c:57:52: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
           if (d->child && (now.tv_sec - start.tv_sec > timeout)) {
                                                      ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado 71d8bb2ec8 iface-modem-messaging: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  mm-iface-modem-messaging.c: In function 'load_supported_storages_ready':
  mm-iface-modem-messaging.c:1154:53: error: cast increases required alignment of target type [-Werror=cast-align]
           mem1 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem1->data,
                                                       ^
  mm-iface-modem-messaging.c:1156:53: error: cast increases required alignment of target type [-Werror=cast-align]
           mem2 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem2->data,
                                                       ^
  mm-iface-modem-messaging.c:1158:53: error: cast increases required alignment of target type [-Werror=cast-align]
           mem3 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem3->data,
                                                       ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado ffbbec4a0d iface-modem-location: avoid warnings with -Wsign-compare
mm-iface-modem-location.c: In function 'location_gps_update_nmea':
  mm-iface-modem-location.c:272:61: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
                time (NULL) - ctx->location_gps_nmea_last_time >= mm_gdbus_modem_location_get_gps_refresh_rate (skeleton))) {
                                                               ^~
  mm-iface-modem-location.c:282:60: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
                time (NULL) - ctx->location_gps_raw_last_time >= mm_gdbus_modem_location_get_gps_refresh_rate (skeleton))) {
                                                              ^~
2020-05-19 13:44:23 +02:00
Aleksander Morgado 7ccec0bd71 iface-modem: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  mm-iface-modem.c: In function 'after_set_load_current_bands_ready':
  mm-iface-modem.c:2358:55: error: cast increases required alignment of target type [-Werror=cast-align]
           requested_str = mm_common_build_bands_string ((MMModemBand *)requested_bands->data, requested_bands->len);
                                                         ^
  mm-iface-modem.c:2359:55: error: cast increases required alignment of target type [-Werror=cast-align]
           current_str   = mm_common_build_bands_string ((MMModemBand *)current_bands->data, current_bands->len);
                                                         ^
  mm-iface-modem.c: In function 'validate_bands':
  mm-iface-modem.c:2474:48: error: cast increases required alignment of target type [-Werror=cast-align]
                                                  (const MMModemBand *)supported_bands_array->data,
                                                  ^
  mm-iface-modem.c: In function 'mm_iface_modem_set_current_bands':
  mm-iface-modem.c:2535:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array->data,
                                                    ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado 3476e140ad modem-helpers: use GPtrArray to build a GStrv
So that we avoid errors when building on ARM due to increasing target
type alignment.

  mm-modem-helpers.c: In function 'mm_3gpp_parse_cnum_exec_response':
  mm-modem-helpers.c:3206:21: error: cast increases required alignment of target type [-Werror=cast-align]
       return (array ? (GStrv) g_array_free (array, FALSE) : NULL);
                       ^
2020-05-19 13:44:23 +02:00
Giacinto Cifelli 8e033ba331 AT modem: charset definition in init
Charset definition moved from enable state machine to init state machine,
so that the right current charset is available also during further
initialization steps
2020-05-18 16:50:33 +02:00
Aleksander Morgado 503581a3ac port-qmi: plug memleak when explicitly releasing client
==43111== 24 bytes in 1 blocks are definitely lost in loss record 1,999 of 5,339
  ==43111==    at 0x483BB65: calloc (vg_replace_malloc.c:762)
  ==43111==    by 0x50259D1: g_malloc0 (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==43111==    by 0x22AAB8: mm_port_qmi_allocate_client (mm-port-qmi.c:201)
  ==43111==    by 0x2007F0: parent_enabling_started_ready (mm-broadband-modem-qmi.c:9114)
  ==43111==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==43111==    by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==43111==    by 0x1C535E: enabling_flash_done (mm-broadband-modem.c:10318)
  ==43111==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==43111==    by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==43111==    by 0x224F0B: flash_do (mm-port-serial.c:1776)
  ==43111==    by 0x502AC03: ??? (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==43111==    by 0x502B58E: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==43111==
2020-05-16 10:33:29 +02:00
Aleksander Morgado 0ddadbdc37 port: use correct enum to string conversion when logging
CC       mm-port.lo
    mm-port.c: In function 'log_object_build_id':
    mm-port.c:117:60: error: implicit conversion from 'MMPortType' to 'MMModemPortType' [-Werror=enum-conversion]
      117 |                             mm_modem_port_type_get_string (mm_port_get_port_type (self)));
          |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
2020-05-10 09:56:10 +02:00
Aleksander Morgado 83952c5a30 bearer-qmi: get correct bearer object pointer from task
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/207
2020-05-08 13:24:14 +02:00
Aleksander Morgado 18a7d9da7a broadband-modem-qmi: GByteArray can be casted to GArray in USSD encoding
Reported by: Maxim Anisimov <linaro85@yandex.ru>
2020-04-22 18:08:41 +02:00
Maxim Anisimov d3c5771b1f broadband-modem-qmi: USSD data in UTF-16 not always given
E.g. in the Quectel EP06-E only the ASCII/UCS-2 data TLV is given.
2020-04-22 18:08:41 +02:00
Maxim Anisimov 6086c6877c broadband-modem-qmi: fix unicode names in USSD iconv() operations
So that the limited iconv() in OpenWRT supports the conversion
properly.
2020-04-22 15:42:26 +02:00
Aleksander Morgado ae90ed66a2 broadband-modem-qmi: 3GPP USSD support
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/26
2020-04-20 16:48:52 +02:00
Aleksander Morgado 330e0b33a4 base-bearer: log connection attempt failure reason
We were logging it as debug, increase logging level to warning to make
sure it's always logged.
2020-04-10 11:45:03 +00:00
Aleksander Morgado 073043ca6b base-bearer: log stats on disconnection 2020-04-10 11:45:03 +00:00
Aleksander Morgado eebd7582bb base-bearer: don't run disconnection path multiple times 2020-04-10 11:45:03 +00:00
Aleksander Morgado 79daa3099e api,bearer: add 'total-rx-bytes', 'total-tx-bytes' and 'total-duration' stats
Compiling the amount of bytes transferred and received during all
tracked connection attempts, as well as the total duration of all the
connections.
2020-04-10 11:45:03 +00:00
Aleksander Morgado f325ef5902 api,bearer: add 'attempts' and 'failed-attempts' statistics
When we're reusing over and over the same bearer object, we can
provide statistical information about the number of connection
attempts that have been done and how many of them failed.
2020-04-10 11:45:03 +00:00
Aleksander Morgado 9c0a937cf3 broadband-modem-qmi: since 1.24.6 all strings are valid UTF-8 2020-04-10 08:24:52 +00:00
Aleksander Morgado 4758e49d87 broadband-modem-qmi: request operator reload explicitly
If the modem switches from one roaming operator to a different roaming
operator, the actual operator MCCMNC/description will change even if
the registration state keeps on being the same (roaming). Detect that,
and trigger operator info reloading explicitly.
2020-04-10 08:24:52 +00:00
Aleksander Morgado ff97a77631 broadband-modem-mbim: request operator reload explicitly
If the modem switches from one roaming operator to a different roaming
operator, the actual operator MCCMNC/description will change even if
the registration state keeps on being the same (roaming). Detect that,
and trigger operator info reloading explicitly.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/154
2020-04-10 08:24:52 +00:00
Aleksander Morgado 5313c25bd8 broadband-modem-qmi: explicitly disable autoconnect during enable
If the QMI device has autoconnect enabled, it will collide in one way
or another with the ModemManager triggered connection sequence,
usually because the user-requested settings are different to the
autoconnected ones.

So, detect whether autoconnect is enabled or not, and if it is,
explicitly disable it.
2020-04-09 15:48:23 +02:00
Aleksander Morgado a60beedcc5 port-qmi: allow users to release clients when no longer needed 2020-04-09 15:48:23 +02:00
Aleksander Morgado 32e2623052 iface-modem-3gpp: add 5GNR to full 3GPP act mask
So that the logic looking for 3GPP related registration info works in
the QMI modem object when selected network is reported as 'unknown'
but still the radio interfaces list reports 5GNR.

  <<<<<< TLV:
  <<<<<<   type       = "Serving System" (0x01)
  <<<<<<   length     = 6
  <<<<<<   value      = 01:02:01:00:01:0C
  <<<<<<   translated = [ registration_state = 'registered' cs_attach_state = 'detached' ps_attach_state = 'attached' selected_network = 'unknown' radio_interfaces = '{ [0] = '5gnr '}' ]
2020-04-09 12:38:50 +00:00
Aleksander Morgado 2293fbe6ba shared-qmi: include all possible 5G related combinations if SSP is supported 2020-04-09 12:38:50 +00:00
Aleksander Morgado c9ee47dd8f helpers-qmi: always log all queried capabilities when building current 2020-04-09 12:38:50 +00:00
Aleksander Morgado 426f69d64b tests,modem-helpers: regex number is index of an array, so starts at 0 2020-04-09 12:38:50 +00:00
Aleksander Morgado 8aec9e3889 test,modem-helpers: use MMModem3gppRegistrationState values in tests 2020-04-09 12:38:50 +00:00
Aleksander Morgado 28b0e2b439 modem-helpers: simplify logic to create array of GRegex
Iterate over the list of available patterns, instead of adding
them one by one.
2020-04-09 12:38:50 +00:00
Aleksander Morgado c78da3de7e broadband-modem: run +C5GREG state checks
The generic CREG parser is improved to also allow parsing +C5GREG
responses and URCs.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 040eb3880c helpers: use generic number parsing methods in CREG parser
This fixes the s8500 wave unit test, which was incorrectly parsing the
Act field reported as 'B' as "GSM" (strtol(B)=0)

Also, given that the generic parsing methods are able to parse numbers
from quoted strings, this change allows us to remove the Thuraya
specific CREG matching that just took into consideration quoted
strings. The Thuraya unit tests are also fixed up to provide proper
testing of the logic.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 40b36a25ca test,modem-helpers: remove obsolete comments in u-blox CREG tests
We already support "SMS only" registration state.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 7eee214b8e helpers: add additional AcT values from 27.007 2020-04-09 12:38:50 +00:00
Aleksander Morgado 68917f502e api: new 'attached RLOS' registration state
Reporting the state when the UE attaches to access restricted local
operator services.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 44ace9642c modem-helpers: improved +WS46 mode '25' handling
The mode '25' means different things on LTE-capable and
non-LTE-capable devices, so improve the logic to clarify that.
2020-04-09 12:38:50 +00:00
Aleksander Morgado f31182c08d iface-modem-3gpp: don't fixup CS network support
This is already done by the modem interface as soon as current
capabilities are loaded.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 05301f23a1 iface-modem-3gpp: new 5GS network support 2020-04-09 12:38:50 +00:00
Aleksander Morgado 9144a9fa34 helpers-qmi: support 5G capabilities and modes 2020-04-09 12:38:50 +00:00
Aleksander Morgado f912de3574 broadband-modem: support 5G in +WS46 to capabilities conversion 2020-04-09 12:38:50 +00:00
Aleksander Morgado 5db3fa88e9 api: new 5G mode 2020-04-09 12:38:50 +00:00
Aleksander Morgado 7354dc928f api: new 5GNR capability 2020-04-09 12:38:50 +00:00
Aleksander Morgado 0cd76bf1c4 api: deprecate MM_MODEM_CAPABILITY_LTE_ADVANCED
It's not used anywhere.
2020-04-09 12:38:49 +00:00
Aleksander Morgado 78266ac489 iface-modem: simplify is_cdma_only() check
The check needs to look for a matching single bit, so no need to make
it too complex.
2020-04-09 12:38:49 +00:00
Aleksander Morgado 6f82ea3732 log: force using the object logging API
Unless the generic API is explicitly allowed, as in the main.c source
file.
2020-04-09 07:35:56 +02:00
Aleksander Morgado 93e4c8625b plugin: don't match generic plugin by name 2020-04-08 17:53:42 +02:00
Aleksander Morgado 997e2cefb8 log: define per-module logging for shared utils and plugins 2020-04-08 17:53:42 +02:00
Aleksander Morgado e956bac47b log: common logging method definition for all testers and helpers 2020-04-08 17:53:42 +02:00
Aleksander Morgado f1e930d574 core: consolidate logging format in main daemon logic 2020-04-08 16:35:10 +02:00
Aleksander Morgado 2376859f36 charsets: report GError in byte_array_append() failures 2020-04-08 16:35:09 +02:00
Aleksander Morgado a2b57474dc error-helpers: port to use object logging 2020-04-08 16:35:09 +02:00