Commit Graph

7059 Commits

Author SHA1 Message Date
Aleksander Morgado
657d5e6180 NEWS: update MBIM reset operation info to include Qualcomm devices
We're using QMI over MBIM to perform the reset if the device is QMI
based.
2020-06-04 09:46:11 +02:00
Aleksander Morgado
1ef46cdf80 build: require libmbim 1.24-rc1 2020-06-03 17:32:19 +02:00
Aleksander Morgado
30428ed57d NEWS: update for 1.14.0 2020-06-03 17:29:57 +02:00
Aleksander Morgado
b81101972e docs,libmm-glib: add 1.14 index 2020-06-03 17:29:46 +02:00
Aleksander Morgado
d36df68226 wavecom: break loop matching 2G bands if exact combination found 2020-06-02 10:16:33 +02:00
Aleksander Morgado
a6607a5e7d wavecom: port to use g_autoptr() setup 2020-06-02 10:16:17 +02:00
Aleksander Morgado
08d40fe05d wavecom: fix GTask return handling when loading current caps 2020-06-02 10:01:43 +02:00
Aleksander Morgado
d8b70602c5 huawei: ignore NDISDUP disconnection errors
Running NDISDUP=1,0 on an already disconnected bearer/context will
report ERROR, so we can really ignore the result of the command,
because we're anyway going to get the correct bearer/context status
later on with the NDISSTATQRY checks.
2020-06-01 16:17:29 +00:00
Aleksander Morgado
472fb96bbe huawei: don't delay reporting network initiated disconnects
When a network-initiated event is received telling us that a
bearer/context is disconnected, we should handle and process it right
away, without thinking on whether there is going to be a
user-requested disconnect afterwards or not.

This effectively reverts the changes introduced in commit
21a5aaf4fe, which looks like was done to
handle synchronization issues with upper layers (e.g. with
NetworkManager or Shill).

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/205
2020-06-01 16:17:29 +00:00
Aleksander Morgado
15543794b7 filter: 'strict' is the new default
The 'strict' filter policy is less invasive, as it will not touch TTYs
unless there are clear indications that it may be a modem. Under this
mode, the ModemManager-provided blacklist database is not used.
2020-06-01 16:02:46 +00:00
Aleksander Morgado
82d38f701c filter: rename 'default' to 'legacy'
The old 'default' policy is renamed to 'legacy', and is considered now
deprecated.
2020-06-01 16:02:46 +00:00
Aleksander Morgado
6eca223705 shared-qmi: require minimum set of NMEA types before starting GNSS engine 2020-06-01 15:43:48 +00:00
Aleksander Morgado
fd28f94750 ci: always build libqmi with basic collection
Which must be the minimum set of supported messages required by
ModemManager.
2020-06-01 15:57:41 +02:00
Aleksander Morgado
10648f8d36 broadband-modem-qmi: plug memleak when changing current firmware
==80079== 104 (40 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 4,761 of 5,232
  ==80079==    at 0x483977F: malloc (vg_replace_malloc.c:309)
  ==80079==    by 0x5025AE9: g_malloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x5006223: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x505B0F4: g_array_sized_new (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x2008A3: firmware_change_current (mm-broadband-modem-qmi.c:8426)
  ==80079==    by 0x1AB5F3: select_auth_ready (mm-iface-modem-firmware.c:225)
  ==80079==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x17402E: authorize_ready (mm-base-modem.c:1363)
  ==80079==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x4E6DA26: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x15366D: check_authorization_ready (mm-auth-provider.c:99)
2020-06-01 15:28:52 +02:00
Aleksander Morgado
d848b10d24 iface-modem-firmware: plug memleak when listing images
==80079== 1,377 (48 direct, 1,329 indirect) bytes in 1 blocks are definitely lost in loss record 5,200 of 5,232
  ==80079==    at 0x483977F: malloc (vg_replace_malloc.c:309)
  ==80079==    by 0x5025AE9: g_malloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x5006223: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x4FEB59B: ??? (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x4FEE378: g_variant_builder_end (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x48F8314: mm_firmware_properties_get_dictionary (mm-firmware-properties.c:337)
  ==80079==    by 0x1AAF29: load_current_ready (mm-iface-modem-firmware.c:80)
  ==80079==    by 0x4E68653: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x4E68688: ??? (in /usr/lib/libgio-2.0.so.0.6400.2)
  ==80079==    by 0x502B58E: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x502D530: ??? (in /usr/lib/libglib-2.0.so.0.6400.2)
  ==80079==    by 0x502E542: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.6400.2)
2020-06-01 15:28:52 +02:00
Louis-Alexis Eyraud
3b35bbd47b huawei: fix memory leak when parsing HCSQ response
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/220
2020-05-29 15:47:54 +02:00
Giacinto Cifelli
df36f8d2d3 cinterion: fix syntax error for setting radio/bands/[23]g 2020-05-28 05:30:08 +02:00
Aleksander Morgado
3efe127aa8 iface-modem-voice: fix assertions in call setup/teardown logic 2020-05-27 15:51:26 +02:00
Giacinto Cifelli
0cc5a6ce4f cinterion: skip sim ready check for modules that don't support it 2020-05-27 05:33:12 +00:00
Aleksander Morgado
da7bc39f0c blacklist: add USB CEC adapters
These are not being probed when using the STRICT filter, so this
blacklist update is relevant only for DEFAULT filter type.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/212
2020-05-27 05:11:29 +00:00
Giacinto Cifelli
84ec3d2fcf cinterion: simplify check
no longer need to check the charset because of the fix in charsets,
that now accepts GSM and UCS2.
2020-05-26 14:26:14 +00:00
Aleksander Morgado
502c636516 zte: add MF667 port type hints
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/217
2020-05-26 15:05:52 +02:00
Aleksander Morgado
a399c7e42a charsets: take_and_convert() methods should support GSM encoding
The iconv() operation would fail because we wouldn't give any proper
charset string to convert to/from. Use our custom GSM encoding support
instead.
2020-05-26 15:05:52 +02:00
Aleksander Morgado
c994576953 charsets,test: extend UCS2->UTF-8 testing for the reverse operation 2020-05-26 15:05:52 +02:00
Aleksander Morgado
c4e6a0c4f6 charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8
This would really be an implementation detail, not a real use
case. Just don't warn in this case, as in the conversion in the
opposite direction.
2020-05-26 15:05:52 +02:00
Aleksander Morgado
87b8c9b295 cinterion: minor coding style fixes in new band management 2020-05-26 15:05:52 +02:00
Giacinto Cifelli
793132d56d cinterion: radio/band handling for LTE modems 2020-05-26 15:05:52 +02:00
Aleksander Morgado
0926031119 Revert "charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8"
This reverts commit 6a7dd87f30.

Reverting because the merge request was set to squash all together....
2020-05-26 15:04:20 +02:00
Giacinto Cifelli
6a7dd87f30 charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8
This would really be an implementation detail, not a real use
case. Just don't warn in this case, as in the conversion in the
opposite direction.
2020-05-26 12:45:40 +00:00
Aleksander Morgado
15a941fae5 broadband-modem-qmi: only use "Data Service Capabilities" array if content given
See https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/32#note_505065
2020-05-25 06:58:14 +00:00
Aleksander Morgado
29a68c94b9 huawei: ignore ^CCALLSTATE URCs for now
We will want to support these to avoid needing to have CLCC call
polling, but for now, just ignore them so that they don't interfere
with the call management.

For context, see:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/216
2020-05-22 10:58:29 +02:00
Aleksander Morgado
1eeec40ee8 iface-modem-voice: fix assert() when setting up call polling
If an incoming call is detected during the CLCC polling, the polling
timeout will already be set, so don't assert when checking the polling
id afterwards, just make sure we don't reset the timeout.

https://lists.freedesktop.org/archives/modemmanager-devel/2020-May/007866.html
2020-05-21 15:03:17 +02:00
Aleksander Morgado
98fa83a693 cinterion,tests: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg':
  cinterion/tests/test-modem-helpers-cinterion.c:56:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data,
                                                          ^
  cinterion/tests/test-modem-helpers-cinterion.c:58:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data,
                                                 ^
  cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg_response':
  cinterion/tests/test-modem-helpers-cinterion.c:209:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data,
                                                          ^
  cinterion/tests/test-modem-helpers-cinterion.c:211:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data,
                                                 ^
2020-05-19 13:49:53 +02:00
Aleksander Morgado
b71ae9ce72 wavecom: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  wavecom/mm-broadband-modem-wavecom.c: In function 'set_bands_3g':
  wavecom/mm-broadband-modem-wavecom.c:800:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
                                                    ^
  wavecom/mm-broadband-modem-wavecom.c: In function 'set_bands_2g':
  wavecom/mm-broadband-modem-wavecom.c:872:50: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_string = mm_common_build_bands_string ((MMModemBand *)bands_array_final->data,
                                                    ^
2020-05-19 13:45:34 +02:00
Aleksander Morgado
8bf1329481 libmm-glib,helpers: use locale-independent strtod()
Otherwise parsing may fail, e.g. as in this unit test:

  # Start of smoni tests
  # DEBUG: testing SMONI response: ^SMONI: 2G,71,-61,262,02,0143,83BA,33,33,3,6,G,NOCONN
  # DEBUG: testing SMONI response: ^SMONI: 2G,SEARCH,SEARCH
  # DEBUG: testing SMONI response: ^SMONI: 2G,673,-89,262,07,4EED,A500,16,16,7,4,G,5,-107,LIMSRV
  # DEBUG: testing SMONI response: ^SMONI: 2G,673,-80,262,07,4EED,A500,35,35,7,4,G,643,4,0,-80,0,S_FR
  # DEBUG: testing SMONI response: ^SMONI: 3G,10564,296,-7.5,-79,262,02,0143,00228FF,-92,-78,NOCONN
  **
  ERROR:cinterion/tests/test-modem-helpers-cinterion.c:1036:test_smoni_response: assertion failed (fabs (ecn0 - smoni_response_tests[i].ecn0) < 0.1): (0,5 < 0,1)
  Bail out! ERROR:cinterion/tests/test-modem-helpers-cinterion.c:1036:test_smoni_response: assertion failed (fabs (ecn0 - smoni_response_tests[i].ecn0) < 0.1): (0,5 < 0,1)
  Aborted (core dumped)
2020-05-19 13:44:23 +02:00
Aleksander Morgado
58ae8f4c24 cinterion,helpers: minor coding style fix 2020-05-19 13:44:23 +02:00
Aleksander Morgado
9bfc8a7829 novatel-lte: use GPtrArray to build a GStrv
novatel/mm-broadband-modem-novatel-lte.c: In function 'response_processor_nwmdn_ignore_at_errors':
  novatel/mm-broadband-modem-novatel-lte.c:241:19: error: cast increases required alignment of target type [-Werror=cast-align]
       own_numbers = (GStrv) g_array_free (array, FALSE);
                     ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
a2b0cee935 huawei,helpers: fix warnings with -Wcast-align
huawei/mm-modem-helpers-huawei.c: In function 'match_info_to_ip4_addr':
  huawei/mm-modem-helpers-huawei.c:193:39: error: cast increases required alignment of target type [-Werror=cast-align]
       *out_addr = GUINT32_SWAP_LE_BE (*((guint32 *) bin));
                                         ^
  /usr/include/glib-2.0/glib/gtypes.h:184:77: note: in definition of macro 'GUINT32_SWAP_LE_BE'
   #    define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((gint32) (val)))
                                                                               ^~~
2020-05-19 13:44:23 +02:00
Aleksander Morgado
bd2e6f5df4 huawei: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  huawei/mm-broadband-modem-huawei.c: In function 'set_current_bands':
  huawei/mm-broadband-modem-huawei.c:916: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
175bedf920 xmm: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  xmm/mm-shared-xmm.c: In function 'validate_and_build_command_set_current_bands':
  xmm/mm-shared-xmm.c:512:45: error: cast increases required alignment of target type [-Werror=cast-align]
           str = mm_common_build_bands_string ((const MMModemBand *)unapplied_bands->data, unapplied_bands->len);
                                               ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
ccf16e00a7 ublox,helpers: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  ublox/mm-modem-helpers-ublox.c: In function 'parse_bands_from_string':
  ublox/mm-modem-helpers-ublox.c:1612:48: error: cast increases required alignment of target type [-Werror=cast-align]
           tmpstr = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len);
                                                  ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
76d06ce697 cinterion,helpers: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  cinterion/mm-modem-helpers-cinterion.c: In function 'mm_cinterion_build_band':
  cinterion/mm-modem-helpers-cinterion.c:409:54: error: cast increases required alignment of target type [-Werror=cast-align]
           bands_string = mm_common_build_bands_string ((MMModemBand *)bands->data, bands->len);
                                                        ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
b0be4e895c telit,helpers: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  telit/mm-modem-helpers-telit.c: In function 'mm_telit_build_bnd_request':
  telit/mm-modem-helpers-telit.c:256:55: error: cast increases required alignment of target type [-Werror=cast-align]
               bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len);
                                                         ^
  telit/mm-modem-helpers-telit.c:275:55: error: cast increases required alignment of target type [-Werror=cast-align]
               bands_str = mm_common_build_bands_string ((const MMModemBand *)(bands_array->data), bands_array->len);
                                                         ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
301b6f0a64 plugins,tests: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  tests/test-helpers.c: In function 'mm_test_helpers_compare_bands':
  tests/test-helpers.c:41:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len);
                                                 ^
  tests/test-helpers.c:46:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->len);
                                                          ^
2020-05-19 13:44:23 +02:00
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