aboutsummaryrefslogtreecommitdiff
path: root/src/mm-sim-mbim.c
diff options
context:
space:
mode:
authorMichal Mazur <mkm@semihalf.com>2021-12-15 16:07:36 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-01-30 13:48:48 +0000
commit5d4957935ba17c7c24ae92b82fc3fb90851f3235 (patch)
treee7ec4d9a9b900b9e9a3611dc4ee0c90642e053af /src/mm-sim-mbim.c
parentee87a6853228e0b4b5e6c132f0c90e8d094af441 (diff)
sim-mbim,broadband-modem-mbim: store number of remaining attempts
On MBIM modems the type of PIN cannot be specified in MBIM_CID_PIN query command and the modem responds only remaining attempts for the currently active lock. If PIN1 is unlocked and user tries to disable (or enable) it, MM won't get an update of remaining attempts in response to PIN Query. This value is returned only after the Set command and MM need to store it in all (pin/puk)_set_(enter/enable/change)_ready functions. Previous solution was to call the mm_iface_modem_update_unlock_retries directly from these functions but it caused the notification to be send too early and invalid number was displayed to user sometimes. Instead of this MM will store numbers of remaining attempts and send them in a single notification from modem_load_unlock_retries.
Diffstat (limited to 'src/mm-sim-mbim.c')
-rw-r--r--src/mm-sim-mbim.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mm-sim-mbim.c b/src/mm-sim-mbim.c
index e7b6547e..311647ad 100644
--- a/src/mm-sim-mbim.c
+++ b/src/mm-sim-mbim.c
@@ -84,20 +84,15 @@ update_modem_unlock_retries (MMSimMbim *self,
guint32 remaining_attempts)
{
MMBaseModem *modem = NULL;
- MMUnlockRetries *unlock_retries;
g_object_get (G_OBJECT (self),
MM_BASE_SIM_MODEM, &modem,
NULL);
g_assert (MM_IS_BASE_MODEM (modem));
- unlock_retries = mm_unlock_retries_new ();
- mm_unlock_retries_set (unlock_retries,
- mm_modem_lock_from_mbim_pin_type (pin_type),
- remaining_attempts);
- mm_iface_modem_update_unlock_retries (MM_IFACE_MODEM (modem),
- unlock_retries);
- g_object_unref (unlock_retries);
+ mm_broadband_modem_mbim_set_unlock_retries (MM_BROADBAND_MODEM_MBIM (modem),
+ mm_modem_lock_from_mbim_pin_type (pin_type),
+ remaining_attempts);
g_object_unref (modem);
}