aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-07api: define additional LTE frequency bandsAleksander Morgado
2017-09-07api: consolidate CDMA frequency enumerationsAleksander Morgado
Define new symbols with easier names, just based on the Band Class.
2017-09-07api: define additional UMTS frequency bandsAleksander Morgado
2017-09-07api: new MM_BAND_UTRAN_ enumerations for WCDMA bandsAleksander Morgado
Flag as deprecated the old names, and define new ones based on the defined UTRAN band numbers, equivalent to what was done for LTE bands.
2017-09-07api: define additional GSM frequency bandsAleksander Morgado
New definitions for not so common GSM frequency bands.
2017-09-07api: don't use intermediate variables for deprecation warningsAleksander Morgado
Using an intermediate constant variable breaks compilation with C compilers, as these variables cannot be used as initializers. Instead, define a deprecated type and cast all deprecated symbols to that type. We lose the information about what the new replacement symbol is, but we don't break compilation. E.g.: test.c: In function ‘main’: test.c:8:5: warning: ‘MMModemBandDeprecated’ is deprecated [-Wdeprecated-declarations] printf ("band: %d\n", MM_MODEM_BAND_U2100); ^~~~~~
2017-09-05plugin,port-probe: always cast SEND_DELAY value to guint64Aleksander Morgado
Program received signal SIGSEGV, Segmentation fault. strchr () at ../sysdeps/arm/armv6/strchr.S:28 28 ../sysdeps/arm/armv6/strchr.S: No such file or directory. (gdb) bt #0 strchr () at ../sysdeps/arm/armv6/strchr.S:28 #1 0x76b121c8 in g_param_spec_pool_lookup () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0 #2 0x76b0cf44 in g_object_new_valist () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0 #3 0x76b0d39c in g_object_new () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0 #4 0x75f75e40 in mm_plugin_create () at ublox/mm-plugin-ublox.c:99 #5 0x00031550 in load_plugin (path=0xe9b68 "/usr/lib/ModemManager/libmm-plugin-ublox.so") at mm-plugin-manager.c:1521 #6 load_plugins (error=0x7efffa68, self=0xdc4f0) at mm-plugin-manager.c:1574 #7 initable_init (initable=<optimized out>, cancellable=<optimized out>, error=0x7efffa68) at mm-plugin-manager.c:1679 #8 0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #9 0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #10 0x000324d0 in mm_plugin_manager_new (plugin_dir=0xe9c40 "/usr/lib/ModemManager", error=error@entry=0x7efffa68) at mm-plugin-manager.c:1620 #11 0x0002da08 in initable_init (initable=0xddb40, cancellable=<optimized out>, error=0x7efffa68) at mm-base-manager.c:1113 #12 0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #13 0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #14 0x0002e81c in mm_base_manager_new (connection=connection@entry=0xe1070, plugin_dir=plugin_dir@entry=0x9efb0 "/usr/lib/ModemManager", auto_scan=auto_scan@entry=1, initial_kernel_events=initial_kernel_events@entry=0x0, enable_test=0, error=0x7efffa68, error@entry=0x7efffa60) at mm-base-manager.c:957 #15 0x0002b6ec in bus_acquired_cb (connection=0xe1070, name=<optimized out>, user_data=<optimized out>) at main.c:87 #16 0x76c26864 in connection_get_cb () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #17 0x76bc76cc in g_task_return_now () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 #18 0x76bc7d50 in g_task_return () from ~/buildroot/output/staging/lib/libgio-2.0.so.0 See similar bug in GStreamer: https://bugzilla.gnome.org/show_bug.cgi?id=740191
2017-09-04base-sim: wrap in its own GTask the SIM id loading from the subclassAleksander Morgado
Instead of reusing the caller GTask, use a new GTask to wrap the execution of the subclass' async method implementation. Also, rename the _ready() methods implemented in the GObject initialization flow so that we can use the load_sim_identifier_ready() function name.
2017-09-04telit: reorder code to keep the bottom-top flow for async methodsAleksander Morgado
2017-09-04telit: explicitly flag as const the constant stringAleksander Morgado
2017-09-04telit: plug memleak when SIM object cannot be acquiredAleksander Morgado
The GTask wasn't being disposed.
2017-09-04telit: avoid leaking SIM objectAleksander Morgado
We were getting the SIM object for all paths, but only using (and disposing it) in the AFTER_POWER_UP_STEP_GET_SIM_IDENTIFIER step. Update the logic to only retrieve, use and dispose the SIM object in the step that is needed, and therefore avoid leaking it in the remaining steps.
2017-09-04telit-plugin: handle QSS unsolicited due to power state transitionsCarlo Lobrano
When transitioning between power-low and power-on modes, Telit modems switch the SIM off/on, which leads to the emission of #QSS unsolicited not related to actual SIM swaps. To handle this #QSS unsolicited, this patch: * disables reacting on #QSS unsolicited when modem_power_down is received * implements modem_after_power_up that: - checks whether the SIM has been changed, matching cached SIM Identifier with the value in the current SIM. If SIM Identifier, is different, sim hot swap ports detected is called. - re-enables reacting on #QSS unsolicited
2017-08-29broadband-modem: do not release SIM swap port contexts on disableCarlo Lobrano
Currently when the modem is disabled, it releases SIM hot swap ports context, and is not able to receive any notification about the SIM status. This patch keeps these ports opened when Modem is disabled and released them only when SIM swap is detected or when modem is released.
2017-08-29wavecom: fix async operation completionAleksander Morgado
2017-08-29blacklist: ignore Silicon Labs USB Zigbee donglesMario Limonciello
2017-08-22base-manager: avoid events of USB interface from removing MMDeviceBen Chan
When a USB modem is switching its USB configuration, udev may deliver the remove events of USB interfaces associated with the old USB configuration and the add events of USB interfaces associated with the new USB configuration in an interleaved fashion. An interleaved remove event of USB interface could trigger the special case handling code in mm-base-manager.c:device_removed() and incorrectly remove a MMDevice under probing. See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005626.html for more details. This patch adds a check to ensure that only remove events of USB device (i.e. not interface) can trigger the special handling code.
2017-08-16charsets: simplify check to see if conversion to charset possibleAleksander Morgado
Instead of having a method that returns the expected length after the conversion and the amount of input UTF-8 characters that couldn't be converted to the given charset, simplify the logic and just define a method that returns a boolean specifying whether the conversion is possible or not. Also, include unit tests.
2017-08-16charsets: ensure all methods are prefixed with 'mm_'Aleksander Morgado
2017-08-16charsets,test: refactor unit testsAleksander Morgado
These tests don't need fixtures, so use the simpler g_test_add_func() methods to add tests associated to a test path.
2017-08-15mm-broadband-modem-mbim: reprobe on mbim-proxy deathEric Caruso
In case mbim-proxy crashes, ModemManager needs to be able to recognize this and respawn the proxy so we don't lose access to the modem. Do this by subscribing to the device removal signal on MbimDevice and reprobing the modem when we lose the connection to mbim-proxy. We can't just restart mbim-proxy because the reopened mbim-proxy will give us a different client ID, and so unsolicitied notifications will fail and MM gets very confused otherwise.
2017-08-15kernel-device: assert 'vendor' and 'product' in get_device_ids()Aleksander Morgado
These two parameters must always be given.
2017-08-15kernel-device: expect non-NULL 'vendor' and 'product' argument in ↵Ben Chan
get_device_ids() get_device_ids() in mm-kernel-device-udev.c accepts a NULL 'vendor' or 'product' argument, but the current implementation could result in a potential NULL dereferences of the 'vendor' argument. Given that get_device_ids() is a local helper and its only caller provides a non-NULL 'vendor' and 'product' argument, this patch removes the NULL checks (i.e. get_device_ids() expects non-NULL 'vendor' and 'product'). This patch also rearranges the code such that the 'vendor' argument is updated only when the function returns TRUE, just like how the 'product' argument is handled.
2017-08-15charset: fix mm_charset_get_encoded_lenBen Chan
The while loop in mm_charset_get_encoded_len() iterates through each valid UTF-8 encoded character in the given NULL-terminated UTF-8 string. It uses g_utf8_find_next_char() to find the position of the next character. In case, g_utf8_find_next_char() returns NULL, it tries to find the end (i.e. the NULL character) of the string. This patch fixes the following issues in the while loop: 1. The loop uses both 'next' and 'end' to track the position of the next character in the string. When g_utf8_find_next_char() returns a non-NULL value, 'next' is essentially the same as 'end'. When g_utf8_find_next_char() returns NULL, 'next' remains NULL while 'end' is adjusted to track the end of the string (but is done incorrectly as described in #2). After the 'p = next' assignment, the 'while (*p)' check results in a NULL dereference. 'p' should thus be set to 'end' instead of 'next'. 'next' is thus redundant and can be removed. 2. When g_utf8_find_next_char() returns NULL and 'end' is adjusted to track the end of string, the 'while (*end++)' loop stops when finding the NULL character, but 'end' is advanced past the NULL character. After the 'p = end' assignment, the 'while (*p)' check results in a dereference of out-of-bounds pointer. 'while (*++end)' should be used instead given that 'p' doesn't point to a NULL character when 'end = p' happens. 'end' will be updated to point to the NULL character. After the 'p = end' assignment (fixed in #1), the 'while (*p)' check will properly stop the loop.
2017-08-12polkit: add missing Location interface method rulesAleksander Morgado
https://bugs.freedesktop.org/show_bug.cgi?id=102182
2017-08-12broadband-modem-mbim: explicitly remove notification handler on unrefAleksander Morgado
When we remove the last object reference, make sure the notification handler is also removed, or we may end up using an already freed object. https://retrace.fedoraproject.org/faf/reports/1815001/
2017-08-11plugin: fix forbidden_product_strings check in apply_post_probing_filtersBen Chan
This patch fixes a bug in apply_post_probing_filters() where it iterates through `self->priv->forbidden_product_strings' but incorrectly accesses `self->priv->product_strings[i]' inside the loop. `self->priv->forbidden_product_strings[i]' should be accessed instead.
2017-08-11libmm-glib,cdma: fix potential NULL dereferenceBen Chan
This patch fixes a potential NULL referenece issue in mm_cdma_manual_activation_properties_get_prl() where it accesses `self->priv->prl->data' when `self->priv->prl' could be potentially NULL.
2017-08-11libmm-glib,sms-properties: fix potential NULL dereferenceBen Chan
This patch fixes a potential NULL referenece issue in mm_sms_properties_get_data() where it accesses `self->priv->data->data' when `self->priv->data' could be potentially NULL.
2017-08-09modem-helpers: allow unquoted strings in +CCLK responsesAleksander Morgado
Also: * define the leading '+' as a escaped value * allow any number of spaces between '+CCLK' and the string value.
2017-08-09bearer-mbim: stop trying to reload stats on OperationNotAllowedAleksander Morgado
The Sierra Wireless EM7345 reports OperationNotAllowed when trying to load stats, just cancel stats reloading if so. ModemManager[8318]: [/dev/cdc-wdm1] Received message (translated)... >>>>>> Header: >>>>>> length = 48 >>>>>> type = command-done (0x80000003) >>>>>> transaction = 24 >>>>>> Fragment header: >>>>>> total = 1 >>>>>> current = 0 >>>>>> Contents: >>>>>> status error = 'OperationNotAllowed' (0x0000001c) >>>>>> service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df) >>>>>> cid = 'packet-statistics' (0x00000014)
2017-08-08iface-modem: remove unnecessary error checkBen Chan
This patch removes an unnecessary error check in the update_unlock_retries() where the error is never set.
2017-08-06bearer-mbim: refactor disconnect_set_ready()Aleksander Morgado
Try to make it more clear which are the different branches in the logic, and jump out as soon as the branch is finished.
2017-08-04broadband-bearer: run init sequence after flashing in disconnectionAleksander Morgado
The init-sequence configured for the TTY that is being used as data port must not be launched during the port reopen() sequence; instead we must run it manually after the port flashing has finished.
2017-08-04mbm: set GPS data port for DellDW5560Aleksander Morgado
See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005506.html
2017-08-04altair-lte: don't use send-delay=0Ben Chan
On the modem with firmware revision ALT3100_04_05_06_10_A8_TF (LTEUSB_02_04_05_10_53), it's observed that port probing doesn't complete successfully when send-delay=0 is used.
2017-08-04port-probe: remove unused variableBen Chan
2017-08-04sim-qmi: remove unused variablesBen Chan
2017-08-04broadband-modem: ensure `match_info' is always initializedBen Chan
This patch initializes `match_info' in registration_status_check_ready() to NULL by default, such that `match_info' is always initialized even if `self->priv->modem_3gpp_registration_regex' contains no elements. Though `self->priv->modem_3gpp_registration_regex' always contains some elements in the current implementation, it's better not to rely on that.
2017-08-04location-gps-nmea: fix memory leaksBen Chan
There are potential memory leaks in MMLocationGpsNmea: - When the `trace' string provided to location_gps_nmea_take_trace() isn't added to the hash table, its ownership is still considered transferred. It should thus be freed. Similarly, the `trace_type' string isn't added the hash table and should thus be freed. - mm_location_gps_nmea_add_trace() duplicates a given trace string and then passes the trace copy to location_gps_nmea_take_trace(). When location_gps_nmea_take_trace() returns FALSE, the ownership of the copy isn't transferred. mm_location_gps_nmea_add_trace() should thus free the copy. This patch fixes the above memory leaks by having location_gps_nmea_take_trace() always take the ownership of the `trace' string and internally free `trace' and `trace_type' when necessary.
2017-08-04broadband-modem: fix an ineffective `g_assert (equip_id)'Ben Chan
This patch fixes an ineffective `g_assert (equip_id)' in modem_load_equipment_identifier_finish(). After mm_parse_gsn() succeeds, `equip_id' is freed but not reset to NULL, so `g_assert (equip_id)' will never assert even if `imei', `meid', and `esn' are all NULL (though that shouldn't happen when mm_parse_gsn() succeeds).
2017-08-04broadband-modem-qmi: fix potential use-after-freed issuesBen Chan
This patch fixes some potential use-after-freed issues in dms_get_ids_ready(). When an invalid ESN / MEID is retrieved, `ctx->self->priv->esn' / `ctx->self->priv->meid' is freed but not reset to NULL. If no IMEI is retrieved, `str' can be set to the already freed `ctx->self->priv->esn' / `ctx->self->priv->meid' and then propagated to a GSimpleAsyncResult object.
2017-08-04huawei: remove redundant call to huawei_parse_auth_type()Ben Chan
This patch removes a redundant `encoded_auth = huawei_parse_auth_type (auth)` in connect_3gpp_context_step().
2017-08-04bearer-mbim: minor update in debug log messagesAleksander Morgado
2017-08-04bearer-mbim: avoid accessing invalid session_id and nw_errorBen Chan
This patch fixes an issue in disconnect_set_ready(). If mbim_message_connect_response_parse(), `session_id' and `nw_error' are not set to a valid value, and thus shouldn't be used.
2017-08-03huawei: ensure MMBearerConnectResult populated into GSimpleAsyncResultBen Chan
During the CONNECT_3GPP_CONTEXT_STEP_LAST step, connect_3gpp_context_step() conditionally creates and populates a MMBearerConnectResult object into the GSimpleAsyncResult object when the ipv4_config field of the Connect3gppContext struct is set. That assumes the ipv4_config field is always initialized in connect_dhcp_check_ready() during the CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG step. Instead of having such an assumption, this patch modifies connect_3gpp to always initialize the ipv4_config field, such that connect_3gpp_context_step() always populates a MMBearerConnectResult object into the GSimpleAsyncResult object.
2017-08-03sms-part-cdma: add missing break statements in cause_code_to_delivery_stateBen Chan
This patch fixes cause_code_to_delivery_state() by adding two missing break statements for the case ERROR_CLASS_TEMPORARY and ERROR_CLASS_PERMANENT in the `switch (error_class)` statement. Without the break statements, the switch always falls through to the default and returns MM_SMS_DELIVERY_STATE_UNKNOWN for an `error_class' of value ERROR_CLASS_TEMPORARY or ERROR_CLASS_PERMANENT.
2017-08-03novatel: avoid calling qcdm_result_unref on NULL QcdmResultBen Chan
2017-08-03libmm-glib,firmware: fix unique_id checksBen Chan
The following checks in mm_modem_firmware_select() and mm_modem_firmware_select_sync() could result in a NULL pointer dereference if `unique_id' is NULL: g_return_if_fail (unique_id != NULL || unique_id[0] == '\0') g_return_val_if_fail (unique_id != NULL || unique_id[0] == '\0', FALSE) This patch fixes the checks to properly verify that `unique_id' is neither NULL nor an empty string.
2017-08-03ublox: remove unused variableBen Chan