Commit Graph
100 Commits
Author SHA1 Message Date
Ben Chan cc5880898c decode: untabify 2019-09-04 10:37:39 -07:00
Ben Chan 65f26b3875 README: fix typo 2019-09-04 10:35:52 -07:00
Ben Chan 07c8a2b4f6 base-sim: avoid unnecessary MM_BASE_MODEM() call on MMBaseModem object
The 'modem' field in _MMBaseSimPrivate is already a MMBaseModem object.
2019-08-29 18:40:16 +00:00
Ben Chan ee8695178d docs: untabify 2019-08-29 12:05:09 +00:00
Ben Chan 6f0c72e4f2 introspection: untabify 2019-08-29 12:05:09 +00:00
Ben Chan 5efa15b83f broadband-modem-mbim: fix potential dereference of null GByteArray
ussd_decode() expects a non-null GByteArray while process_ussd_message()
could potentially passes a null GByteArray to ussd_decode(). This
patch fixes the issue by having process_ussd_message() always creates a
GByteArray.
2019-08-25 12:38:55 +00:00
Ben Chan c6cf7cf094 libmm-glib,firmware-update-settings: handle null self pointer
mm_firmware_update_settings_get_variant() checks for a null `self'
pointer when accessing `self->priv->method', but doesn't perform the
null check when accessing other members of
MMFirmwareUpdateSettingsPrivate.

This patch fixes mm_firmware_update_settings_get_variant() to fully
handle a null `self' pointer.
2019-08-03 09:16:39 -07:00
Ben Chan ee63bf4033 cinterion: fix memory leak in common_test_ctzu_urc() 2019-08-02 20:03:38 -07:00
Ben Chan 13cf94a187 iface-modem-firmware: remove explicit GDestroyNotify cast on g_free
g_free is in form of  `void (*)(gpointer)`, which matches the
GDestroyNotify signature. An explicit GDestroyNotify cast on g_free is
thus not needed.
2019-08-02 19:58:01 -07:00
Ben Chan c363c59840 charsets: use G_N_ELEMENTS (t)' instead of sizeof (t) / sizeof (t[0])' 2019-08-02 19:58:01 -07:00
Ben Chan bf54159e93 test: untabify 2019-07-31 22:27:45 -07:00
Ben Chan 500844af73 shared-qmi: fix potentially uninitialized 'mcc' variable
mm-shared-qmi.c:358:9: error: variable 'mcc' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]
    if (operator_id && !mm_3gpp_parse_operator_id (operator_id, &mcc, &mnc, &error)) {
        ^~~~~~~~~~~
mm-shared-qmi.c:367:9: note: uninitialized use occurs here
    if (mcc) {
        ^~~
mm-shared-qmi.c:358:9: note: remove the '&&' if its condition is always true
    if (operator_id && !mm_3gpp_parse_operator_id (operator_id, &mcc, &mnc, &error)) {
        ^~~~~~~~~~~~~~
mm-shared-qmi.c:339:51: note: initialize the variable 'mcc' to silence this warning
    guint16                                    mcc;
                                                  ^
                                                   = 0
2019-07-26 17:04:30 -07: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
Ben Chan 79df43f0d7 broadband-modem: remove unused CallManagerStateContext defintion 2019-04-09 11:11:54 +00:00
Ben Chan 49f391b10d altair-lte: remove unused fields in DetailedDisconnectContext 2019-04-08 13:30:14 -07:00
Ben Chan 9dac5ece77 build: make compiler warning options compatible with clang
This patch updates m4/compiler-warnings.m4 as follows to make it more
compatible with clang:

* clang doesn't support -Wunused-but-set-variable, which can be replaced
  with -Wunused-variable as the latter covers unused variables with or
  without an assigned value and is supported by gcc and clang.

* -Wno-unused-function is added to let clang ignore unused functions that
  are auto-generated.
2019-04-05 08:02:14 +00: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
Ben Chan 84fe52a1e6 modem-helpers: fix memory leak in mm_3gpp_parse_pdu_cmgl_response
This patch fixes a potential memory leak in
mm_3gpp_parse_pdu_cmgl_response() where the allocated MM3gppPduInfo may
be leaked when failing to parse the +CMGL response.
2019-04-03 10:53:01 -07: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
Ben Chan 0d6e2dc9f5 altair-lte: use mm_autoptr instead of g_autoptr
commit 397faef3c5 ("mm-common-helpers: add mm_autoptr helpers for
GRegex and GMatchInfo") introduces mm_autoptr(), which implements
g_autoptr() that isn't available before glib 2.44. This patch fixes the
code to consistently uses mm_autoptr().
2018-12-13 10:48:21 +01:00
Ben Chan 03fdb33e1c cli,output: include string.h for strlen()
This patch fixes the following compiler warning:

mmcli-output.c:783:19: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
            aux = strlen (section_infos[field_infos[item_l->field].section].name);
                  ^
2018-11-30 11:36:07 +01:00
Ben Chan 9389265bab cli,call: fix incorrect string conversion of MMCallStateReason enum
This patch fixes the following issue with string conversion of a MMCallStateReason enum:

mmcli-call.c:160:88: error: implicit conversion from enumeration type 'MMCallStateReason' to different enumeration type 'MMCallState' [-Werror,-Wenum-conversion]
    mmcli_output_string (MMC_F_CALL_PROPERTIES_STATE_REASON, mm_call_state_get_string (mm_call_get_state_reason (call)));
                                                             ~~~~~~~~~~~~~~~~~~~~~~~~  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-11-30 11:35:10 +01:00
Ben Chan bf1b396596 tests: use memcmp() instead of g_assert_cmpmem() for now
g_assert_cmpmem() isn't available until glib 2.46, while the minimum
glib version required by ModemManager is 2.36. This patch replaces the
uses of g_assert_cmpmem() with memcmp() instead.
2018-11-08 17:00:59 +01:00
Ben Chan 2522efb359 broadband-modem-mbim: update ms-basic-connect-extensions naming
libmbim 1.17.4 (commit 3eeaa4248b98 "ms-basic-connect-extensions: rename
service") added a MS prefix to the Basic Connectivity Extensions
service. This patch updates the MMBroadbandModemMbim code accordingly.
2018-11-07 09:52:30 +01:00
Ben Chan 864679543b build: ignore generated ChangeLog 2018-10-27 10:09:51 +02:00
Ben Chan aa85aeae3d libqcdm: remove useless checks on always true condition
result.c: In function ‘qcdm_result_add_u8_array’:
result.c:338:36: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
     qcdm_return_if_fail (array_len >= 0);

result.c: In function ‘qcdm_result_add_u16_array’:
result.c:418:36: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
     qcdm_return_if_fail (array_len >= 0);
                                    ^
2018-10-27 10:09:51 +02:00
Ben Chan 737eff557d modem-helpers: remove useless checks on always true condition
mm-modem-helpers.c:3075:31: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
     g_return_val_if_fail (idx >= 0, NULL);
                               ^
2018-10-27 10:09:51 +02:00
Ben Chan b76db60313 ublox: fix username and password passed to +UAUTHREQ 2018-10-26 10:56:57 -07:00
Ben Chan be81f7e5a2 sim-qmi: use QMI UIM service to read IMSI if needed
If a QMI modem doesn't support the deprecated DMS_UIM_GET_IMSI command,
use the UIM_READ_TRANSPARENT command to read EFimsi on the SIM to
determine the IMSI.
2018-10-26 09:50:51 -07:00
Ben Chan 055177fdf0 sim-qmi: use QMI UIM service to read ICCID if needed
If a QMI modem doesn't support the deprecated DMS_UIM_GET_ICCID command,
use the UIM_READ_TRANSPARENT command to read EFiccid on the SIM to
determine the ICCID.
2018-10-26 09:50:01 -07:00
Ben Chan 942bdeaec2 modem-helpers: new helper to convert binary-coded decimals
This patch adds a mm_bcd_to_string() helper function to convert a byte
array representing a binary-coded decimal (BCD) number to a string
representing the equivalent decimal number.
2018-10-26 09:50:01 -07:00
Ben Chan 408a2a9c6c altair-lte: migrate from SubscriptionState to Pco property
In preparation of deprecating the SubscriptionState property in the
Modem3gpp interface, this CL updates the altair-lte plugin to update the
Pco property in the Modem3gpp interface upon receiving %PCOINFO
notification.
2018-10-26 09:41:44 -07:00
Ben Chan beb1aab178 sierra: remove unused 'self' variable in scact_periodic_query_ready() 2018-10-22 11:23:29 +02:00
Ben Chan 55e011b5da broadband-bearer: remove unused 'self' variables 2018-10-22 11:23:24 +02:00
Ben Chan 14ca3efb7f xmm: remove unused 'priv' variable in xact_query_bands_ready() 2018-10-20 13:57:18 +02:00
Ben Chan 9c03ce033c base-call: remove unused 'self' variables 2018-10-20 13:56:13 +02:00
Ben Chan 436f9ef7e6 core: use g_clear_pointer() to avoid explicitly checking and resetting pointers 2018-10-18 13:17:36 +02:00
Ben Chan 7de6b6f2e1 core: remove unnecessary NULL checks for g_match_info_free()
g_match_info_free() already check if the given pointer is NULL and does
nothing on a NULL pointer.
2018-10-18 13:17:36 +02:00
Ben Chan 749b806c30 core: remove unnecessary NULL checks for g_free()
g_free() already check if the given pointer is NULL and does nothing on
a NULL pointer.
2018-10-18 13:17:36 +02:00
Ben Chan 04ca18c01f modem-helpers-qmi: include string.h for memset()
This patch fixes the following compiler warning:

mm-modem-helpers-qmi.c:568:5: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned int)' [-Werror,-Wimplicit-function-declaration]
    memset (extended_qmi_lte_bands, 0, extended_qmi_lte_bands_size * sizeof (guint64));
    ^
2018-10-17 11:05:46 +02:00
Ben Chan b134272532 sim-qmi: avoid unnecessary MM_SIM_QMI() call on MMSimQmi object 2018-10-16 12:07:43 -07:00
Ben Chan f7cb84788e base-modem: remove explicit GDestroyNotify cast on g_object_unref
g_object_unref is in form of  `void (*)(gpointer)`, which matches the
GDestroyNotify signature. An explicit GDestroyNotify cast on
g_object_unref is thus not needed.
2018-10-06 14:50:04 +02:00
Ben Chan a68bbbc1b9 port-serial: port mm_port_serial_flash to use GTask 2018-10-04 09:13:24 +02:00
Ben Chan f3e1e699cf port-serial: port mm_port_serial_reopen to use GTask 2018-10-04 09:09:51 +02:00
Ben Chan 21420e450d broadband-modem: port modem_cdma_register_in_network to use GTask 2018-09-07 08:35:44 -07:00
Ben Chan fcec3b3355 broadband-modem: port modem_cdma_setup_registration_checks to use GTask 2018-09-07 08:35:44 -07:00
Ben Chan c0607ede9b broadband-modem: port modem_cdma_setup_cleanup_unsolicited_events to use GTask 2018-09-07 08:35:44 -07:00
Ben Chan a51a0ba23e broadband-modem: port modem_load_access_technologies to use GTask 2018-09-07 08:35:44 -07:00
Ben Chan 1b3b2e26a7 test,modem-helpers: remove unnecessary NULL check for g_free()
g_free() handles a NULL pointer properly, so there is no need to have a
NULL check before calling g_free().
2018-08-29 08:35:46 +02:00
Ben Chan c49f60db02 libmm-glib,pco: add missing documentation for MMPco 2018-08-28 10:50:39 +02:00
Ben Chan 0520836afa mbim: fix inconsistency in WITH_QMI guards 2018-08-23 09:44:28 +02:00
Ben Chan 6530683cfb broadband-modem-mbim: add missing guard for shared_qmi_init()
Fixes: 9e42a19742
2018-08-22 17:21:34 +02:00
Ben Chan 2729b08696 port-mbim: add missing guard for try_qmi_over_mbim in mm_port_mbim_open()
Fixes: c0cc694c67
2018-08-22 17:21:24 +02:00
Ben Chan 7c5cfa13a1 xmm: include string.h for strlen()
This patch fixes the following compiler warning:

xmm/mm-modem-helpers-xmm.c:388:38: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
    g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error);
                                     ^
2018-08-21 23:11:29 +02:00
Ben Chan f6c310ba82 shared-qmi: include string.h for memset()
This patch fixes the following compiler warning:

mm-shared-qmi.c:447:9: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Werror,-Wimplicit-function-declaration]
        memset (buf, 0, sizeof (buf));
        ^
2018-08-21 23:11:08 +02:00
Ben Chan b8ab473662 cli: print 'Pco' property in Modem3gpp interface 2018-08-18 13:34:06 -07:00
Ben Chan 930a5879d4 broadband-modem-mbim: update 'Pco' property in Modem3gpp interface
This patch changes MMBroadbandModemMbim to update the 'Pco' property in
the Modem3gpp interface upon receiving a MBIM_CID_PCO notification.
2018-08-18 13:34:06 -07:00
Ben Chan d46aa0c36a modem-3gpp: add 'Pco' property to Modem3gpp interface
This patch adds a 'Pco' property to the Modem3gpp interface for tracking
PCOs that the modem has received from the network.
2018-08-18 13:34:06 -07:00
Ben Chan eb327b4203 libmm-glib,pco: add helpers for managing a list of MMPco 2018-08-18 13:34:06 -07:00
Ben Chan 28e64d0018 libmm-glib: add MMPco for handling raw PCO data 2018-08-18 13:29:46 -07:00
Ben Chan d21dd6cf1f broadband-modem: initialize 'tac' in registration_status_check_ready()
mm-broadband-modem.c:4395:13: error: variable 'tac' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm-broadband-modem.c:4407:75: note: uninitialized use occurs here
    mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid);
                                                                          ^~~
mm-broadband-modem.c:4395:9: note: remove the 'if' if its condition is always true
        if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm-broadband-modem.c:4380:9: error: variable 'tac' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if (cgreg) {
        ^~~~~
mm-broadband-modem.c:4407:75: note: uninitialized use occurs here
    mm_iface_modem_3gpp_update_location (MM_IFACE_MODEM_3GPP (self), lac, tac, cid);
                                                                          ^~~
mm-broadband-modem.c:4380:5: note: remove the 'if' if its condition is always false
    if (cgreg) {
    ^~~~~~~~~~~~
mm-broadband-modem.c:4280:15: note: initialize the variable 'tac' to silence this warning
    gulong tac;
              ^
               = 0
2018-08-10 11:06:19 +02:00
Ben Chan 2773475f43 build: require libmbim 1.17.3
libmbim 1.17.3 adds the support for MBIM_CID_PCO, which is used by
commit d68078b2ce ("broadband-modem-mbim: check if modem implements
MBIM_CID_PCO").
2018-08-09 13:37:05 +02:00
Ben Chan 30eef126a1 broadband-modem-mbim: subscribe to MBIM_CID_PCO notifications
This patch changes MMBroadbandModem to subscribe to MBIM_CID_PCO
notifications if the modem supports that.
2018-08-08 16:22:40 +02:00
Ben Chan d68078b2ce broadband-modem-mbim: check if modem implements MBIM_CID_PCO
Being a part of a series that adds PCO support for MBIM modems that
implement the MBIM_CID_PCO extension, this patch issues a
MBIM_CID_DEVICE_SERVICES query during the modem initialization to check
if a modem implements MBIM_CID_PCO. If the modem does, ModemManager will
subscribe to MBIM_CID_PCO notifications to get PCO updates.
2018-08-08 16:22:40 +02:00
Ben Chan 1990d9e982 modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError
Commit 2a97e39cdd in libmim ("libmbim-glib: add additional cause codes
to MbimNwError") added additional cause codes to MbimNwError. This
patch maps some of those MbimNwError to MMMobileEquipmentError.

This patch requires libmbim >= 1.17.1
2018-06-02 18:25:57 +02:00
Ben Chan cf86b6ab98 broadband-modem-qmi: replace ensure_qmi_client with GTask implementation
assure_qmi_client() was created to help migrating MMBroadbandModemQmi code
to use GTask. Now that all MMBroadbandModemQmi code has been migrated to
use GTask, this patch removes the old ensure_qmi_client() and rename
assure_qmi_client() as ensure_qmi_client().
2018-06-02 17:57:00 +02:00
Ben Chan bf4af8b82a broadband-modem-qmi: port modem_cdma_{activate,activate_manual} to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 856d931a7e broadband-modem-qmi: port load_initial_sms_parts to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 3cd9ae6321 broadband-modem-qmi: port messaging_set_default_storage to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 216fb6bbe8 broadband-modem-qmi: port messaging_{enable,disable}_unsolicited_events to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 52d0f9760b broadband-modem-qmi: port location_load_supl_server to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 6f44554b21 broadband-modem-qmi: port location_set_supl_server to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 44c3cceb5e broadband-modem-qmi: port disable_location_gathering to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 84a3ea7661 broadband-modem-qmi: port firmware_change_current to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 65767c1c88 broadband-modem-qmi: port firmware_check_support to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan f933b967be broadband-modem-qmi: port common_enable_disable_oma_unsolicited_events to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan fe46d2c7db broadband-modem-qmi: port common_setup_cleanup_oma_unsolicited_events to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan 456a09c655 broadband-modem-qmi: port oma_cancel_session to use GTask 2018-06-02 17:57:00 +02:00
Ben Chan ce7b3a7bb0 broadband-modem-qmi: port oma_start_client_initiated_session to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 311859d60f broadband-modem-qmi: port oma_accept_network_initiated_session to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 76bdaaba3e broadband-modem-qmi: port oma_load_features to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan f330ffdaa9 broadband-modem-qmi: port oma_setup to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 3455b01b57 broadband-modem-qmi: port modem_cdma_load_activation_state to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan e09e4692dc broadband-modem-qmi: port modem_cdma_run_registration_checks to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan d73f431987 broadband-modem-qmi: port modem_3gpp_{enable,disable}_unsolicited_registration_events to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 478232dc05 broadband-modem-qmi: port modem_3gpp_run_registration_checks to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan b6de1ad22e broadband-modem-qmi: port modem_3gpp_register_in_network to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan a3123cadd8 broadband-modem-qmi: port modem_3gpp_scan_networks to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan f3b2deadda broadband-modem-qmi: port modem_3gpp_load_enabled_facility_locks to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 8ad01d31ac broadband-modem-qmi: port common_setup_cleanup_unsolicited_registration_events to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan df0d2f9552 broadband-modem-qmi: port common_setup_cleanup_messaging_unsolicited_events to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 85eb5bdcbd broadband-modem-qmi: port common_setup_cleanup_unsolicited_events to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan baefe53ab9 broadband-modem-qmi: port common_enable_disable_unsolicited_events to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan c0669e98ae broadband-modem-qmi: port set_current_capabilities to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan bdc3729cba broadband-modem-qmi: port set_current_bands to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 4a53e7cc39 broadband-modem-qmi: port set_current_modes to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 7d8f0600e6 broadband-modem-qmi: port signal_load_values to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 8047f54083 broadband-modem-qmi: port load_power_state to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 0502fe042b broadband-modem-qmi: port load_signal_quality to use GTask 2018-06-02 17:56:59 +02:00
Ben Chan 77a875a1b0 broadband-modem-qmi: port load_current_modes to use GTask 2018-06-02 17:56:59 +02:00