Commit Graph

5790 Commits

Author SHA1 Message Date
Aleksander Morgado
75036a4658 bearer-mbim: refactor disconnect_set_ready()
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-06 13:18:15 +02:00
Aleksander Morgado
e51ee31d50 broadband-bearer: run init sequence after flashing in disconnection
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-04 19:47:45 +02:00
Aleksander Morgado
f455ce33b4 mbm: set GPS data port for DellDW5560
See https://lists.freedesktop.org/archives/modemmanager-devel/2017-August/005506.html
2017-08-04 17:10:41 +02:00
Ben Chan
fbf397cd6f altair-lte: don't use send-delay=0
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-04 15:18:35 +02:00
Ben Chan
5828435b46 port-probe: remove unused variable 2017-08-04 15:17:31 +02:00
Ben Chan
f7eca732f9 sim-qmi: remove unused variables 2017-08-04 15:17:31 +02:00
Ben Chan
941a41d30f broadband-modem: ensure `match_info' is always initialized
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-04 15:15:41 +02:00
Ben Chan
e33aa01963 location-gps-nmea: fix memory leaks
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-04 15:07:56 +02:00
Ben Chan
24ed8d3e99 broadband-modem: fix an ineffective `g_assert (equip_id)'
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-04 15:00:27 +02:00
Ben Chan
0d3cca2c6f broadband-modem-qmi: fix potential use-after-freed issues
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-04 14:08:18 +02:00
Ben Chan
625c204761 huawei: remove redundant call to huawei_parse_auth_type()
This patch removes a redundant `encoded_auth = huawei_parse_auth_type (auth)`
in connect_3gpp_context_step().
2017-08-04 14:02:06 +02:00
Aleksander Morgado
f81a518515 bearer-mbim: minor update in debug log messages 2017-08-04 13:49:32 +02:00
Ben Chan
d58305bf1f bearer-mbim: avoid accessing invalid session_id and nw_error
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-04 13:41:26 +02:00
Ben Chan
e1823e605e huawei: ensure MMBearerConnectResult populated into GSimpleAsyncResult
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-03 12:35:40 +02:00
Ben Chan
0bb01ab68d sms-part-cdma: add missing break statements in cause_code_to_delivery_state
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-03 12:19:37 +02:00
Ben Chan
6132a4d2ae novatel: avoid calling qcdm_result_unref on NULL QcdmResult 2017-08-03 12:19:37 +02:00
Ben Chan
bae4590784 libmm-glib,firmware: fix unique_id checks
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-03 12:19:37 +02:00
Ben Chan
5accaf504f ublox: remove unused variable 2017-08-03 12:19:37 +02:00
Ben Chan
03bf0479ae plugin-manager: remove unused variable 2017-08-03 12:19:37 +02:00
Ben Chan
838173d50f call-list: remove unused variables 2017-08-03 12:19:37 +02:00
Ben Chan
06bbe67000 broadband-modem: remove unused variables 2017-08-03 12:19:37 +02:00
Ben Chan
8e645485e3 broadband-bearer: remove unused variable 2017-08-03 12:19:37 +02:00
Ben Chan
ae82e7d58c broadband-modem-mbim: remove unused variable 2017-08-03 12:18:59 +02:00
Carlo Lobrano
b5dba9ad1c telit-plugin: ignore QSS when SIM-ME interface is locked
With some modems, the lock/unlock of the SIM-ME interface with +CSIM=1/0
command is followed by #QSS unsolicited messages. With the current
implementation, this messages are mistaken for SIM swap events and so the
modem is first dropped and then re-probed.

With this patch, the plugin takes into account the SIM-ME lock state when
parsing #QSS unsolicited, so that the QSS handler can correctly
elaborate the messages that are not related to SIM swap events.
2017-08-01 10:11:12 +02:00
Aleksander Morgado
60092ed7ea broadband-modem: single g_object_get() call to read multiple properties 2017-08-01 10:11:02 +02:00
Carlo Lobrano
9cdc237241 sim hot swap: improved error management
Currently, when SIM hot swap fails in either mm-iface or plugin, the
ModemManager still opens ports context and prints a message saying that
SIM hot swap is supported and that it's waiting for SIM insertion,
instead of clearly saying that SIM hot swap is not working.

This patch:

1. introduces a new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED
   which is FALSE by default and set to TRUE only when
   setup_sim_hot_swap_finish() succeded.
2. subordinates the completion of SIM hot swap setup (in
   mm-broadband-modem) and the related messages to the the value of
   MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED

Finally, this patch replaces the MBIM's sim_hot_swap_on private property
with the new property MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED, since they have the
same meaning.
2017-08-01 10:02:01 +02:00
Valentin Blot
b2c7244b6c mmcli: description of the location-set-gps-refresh-rate option
Commit 6c35878f12 introduced a new option for
setting the refresh rate of location on DBus. This patch describes the option
in the man page.

https://bugs.freedesktop.org/show_bug.cgi?id=89924
2017-07-31 08:28:15 +02:00
Ben Chan
4e468d04ac bearer-mbim: avoid calling mbim_message_unref on NULL MbimMessage 2017-07-27 10:18:48 +02:00
Ben Chan
08f5b86c5d longcheer: port longcheer_custom_init to use GTask 2017-07-24 12:45:45 -07:00
Ben Chan
0dc719ed19 longcheer: port set_current_modes to use GTask 2017-07-21 10:33:17 -07:00
Ben Chan
bf8e75b8bd longcheer: port load_unlock_retries to use GTask 2017-07-21 10:33:17 -07:00
Ben Chan
4cb2232f0f longcheer: port load_supported_modes to use GTask 2017-07-21 10:33:17 -07:00
Ben Chan
aa0a6bed36 zte,icera: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask 2017-07-19 11:23:38 -07:00
Ben Chan
e8599340b4 zte: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask 2017-07-19 11:20:19 -07:00
Ben Chan
8370556318 zte: port modem_after_sim_unlock to use GTask 2017-07-19 11:20:19 -07:00
Ben Chan
9f67e22951 zte: port set_current_modes to use GTask 2017-07-19 11:20:19 -07:00
Ben Chan
289ab66faf zte: port load_supported_modes to use GTask 2017-07-19 11:05:20 -07:00
Ben Chan
c609c2bc46 zte: port load_unlock_retries to use GTask 2017-07-19 11:03:37 -07:00
Ben Chan
03d9619759 altair-lte: port modem_3gpp_load_subscription_state, altair_pco_info_changed to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
de4432da21 altair-lte: port modem_3gpp_disable_unsolicited_events to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
e2b161c684 altair-lte: port modem_3gpp_enable_unsolicited_events to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
00aaa1864a altair-lte: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
282ed056a6 altair-lte: port load_current_bands to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
2d82c505e4 altair-lte: port load_supported_bands to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
4ea38c26e0 altair-lte: port load_unlock_retries to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
e2e7121e44 altair-lte: port load_current_capabilities to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
a96e8f824b altair-lte: port modem_create_bearer to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
555883d107 altair-lte: port modem_3gpp_run_registration_checks to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
15109a8513 altair-lte: port disconnect_3gpp to use GTask 2017-07-19 17:26:40 +02:00
Ben Chan
710d5c036b altair-lte: port connect_3gpp to use GTask 2017-07-19 17:26:40 +02:00