aboutsummaryrefslogtreecommitdiff
path: root/src/mm-sim-mbim.c
AgeCommit message (Collapse)Author
2023-03-15sim-mbim: remove unused variableAleksander Morgado
src/mm-sim-mbim.c:1134:30: warning: unused variable 'request' [-Wunused-variable] g_autoptr(MbimMessage) request = NULL; ^
2023-01-11sim-mbim: Reset cached SIM info when SIM is unlockedMichal Mazur
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/684
2022-10-27sim-mbim: read exact GID1/GID2 file sizeAleksander Morgado
2022-10-05sim-mbim: fix race condition when sync requested during preloadAleksander Morgado
This is an extremely tricky race condition. * During SIM object initialization, we try to load SIM type (first item loaded). * MMSimMbim SIM type loading step runs preload_subscriber_info(), which: ** Sets self->priv->preload = TRUE; so that it is not run anymore. ** Sets the sync monitor to clear preloaded info if sync needed. ** Runs the subscriber ready status operation asynchronously. ** Just before the subscriber ready status operation returns, the system goes to sleep. ** The resume logic kicks in, and we flag the modem with sync needed, which clears the self->priv->preload flag. * Then the subscriber ready status operation response arrives, and we store the IMSI and the other things. * When the next initialization step happens, given that self->priv->preload is cleared, we run attempt to run preload_subscriber_info() again, and this time it finds the info like IMSI is already set, so asserts: 0x00007cbcd287523f (libglib-2.0.so.0 - gtestutils.c: 3253) g_assertion_message 0x00007cbcd28752a2 (libglib-2.0.so.0 - gtestutils.c: 3279) g_assertion_message_expr 0x00005cbdab0a2dc0 (ModemManager - mm-sim-mbim.c: 253) subscriber_ready_status_ready 0x00007cbcd29a173b (libgio-2.0.so.0 - gtask.c: 1230) g_task_return_now 0x00007cbcd29a0799 (libgio-2.0.so.0 - gtask.c: 1300) g_task_return 0x00007cbcd2a548e0 (libmbim-glib.so.4 - mbim-device.c: 264) transaction_task_complete_and_free 0x00007cbcd2a562fc (libmbim-glib.so.4 - mbim-device.c: 1047) data_available 0x00007cbcd28534a6 (libglib-2.0.so.0 - gmain.c: 3417) g_main_context_dispatch 0x00007cbcd28537b1 (libglib-2.0.so.0 - gmain.c: 4211) g_main_context_iterate 0x00007cbcd2853a25 (libglib-2.0.so.0 - gmain.c: 4411) g_main_loop_run 0x00005cbdab034d26 (ModemManager - main.c: 217) main 0x00007cbcd25e16c5 (libc.so.6 + 0x000286c5) __libc_init_first 0x00007cbcd25e1781 (libc.so.6 + 0x00028781) __libc_start_main 0x00005cbdab034a40 (ModemManager + 0x00061a40) _start In order to solve this, upon a sync request the ongoing preload operation will be cancelled.
2022-09-30sim-mbim: fallback to AT commands if reading GID via MBIM failsAleksander Morgado
Older MBIM modems don't support the low level UICC reading extension defined by Microsoft. In those case, fallback to reading the GID values using AT commands wherever possible.
2022-09-12sim-mbim: implement loading GID1 and GID2 of active SIMAleksander Morgado
2022-09-12sim-mbim: preload id of active UICC applicationAleksander Morgado
This would be the application id that refers to the active SIM card.
2022-09-08sim-mbim: minor coding style fixAleksander Morgado
2022-08-09mm-sim-mbim: Fix compile failure if WITH_SUSPEND_RESUME is not setPavan Holla
Fixes 86f6d3351351f7143a7f1c5fb90ddb465089ac69
2022-08-01sim-mbim: clear cached subscriber info on modem sync requestAleksander Morgado
2022-03-22broadband-modem-mbim: update sim-type and esim-status of inactive slotsom
During initialization if the number of slots is more than 1 then update the sim-type and esim-status of the inactive slot as well.
2022-02-16sim-mbim: report error if decoding EID from APDU response failsAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/510
2022-02-01sim-mbim: don't crash if SIM IMSI not providedAleksander Morgado
E.g. if we have an eSIM without profiles.
2022-01-30sim-mbim,broadband-modem-mbim: store number of remaining attemptsMichal Mazur
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.
2022-01-30Revert "mm-sim-mbim: Remove update of remaining attempts"Michal Mazur
This reverts commit 46c5cd8b7279e6139466664f87d744a0553fa1c3.
2021-12-11sim-mbim: load 'SimType', 'Removability' and 'EsimStatus' propertiesAleksander Morgado
We can use the MBIMEx v3.0 support to load the SIM type, SIM removability details and eSIM status.
2021-12-11broadband-modem-mbim,sim-mbim: support subscriber ready status from MBIMEx 3.0Aleksander Morgado
Whenever MBIMEx v3.0 is enabled, the logic should parse the response and indication messages using the updated format.
2021-12-11sim-mbim: common method for Subscriber Ready StatusAleksander Morgado
Instead of running the Susbcriber Ready Status separately for IMSI and ICCID, we run it only once and store the results in a new private struct. It only saves one request/response right now, but it will save more once introduced other SIM parameters loaded with the same method.
2021-09-19sim-mbim: always close UICC channel, even on errorAleksander Morgado
Don't close the UICC channel only when the EID was successfully load. If for any reason it failed, also close the channel.
2021-09-19sim-mbim: coding style fixes in the EID loadingAleksander Morgado
2021-09-19sim-mbim: add support for loading eid via mbim protocolSom_SP
Support is added to set eid dbus interface property using MBIM protocol when the inserted sim is esim.
2021-09-10core: remove execution bit from file modes in source filesAleksander Morgado
2021-07-26mm-sim-mbim: Remove trailing F in ICCIDPavan Holla
QMI modems remove trailing F in 19 digit ICCID. Do the same on MBIM modems for consistency.
2021-07-14mm-broadband-modem-mbim: implement the load_sim_slots() method for DSSAZhangMingjie
2021-07-06mm-sim-mbim: Remove update of remaining attemptsMichal Mazur
Calling the mm_iface_modem_update_unlock_retries function directly from pin_set_enter_ready caused a notification to be send too early with invalid number of attempts to unlock on MBIM modems. The mm_iface_modem_update_unlock_retries is already called for all modems from send_pin_ready (mm-base-sim.c).
2021-04-19sim-mbim: increase the timeout for the MBIM_CID_HOME_PROVIDER queryVincent Palatin
Increase the timeout from 10 seconds to 30 seconds when reading the operator information through the MBIM_CID_HOME_PROVIDER query. We have observed cases where it took more than 12 seconds on a Fibocom L850-GL modem with specific China Unicom SIMs. This timeout was actually the cause of a corruption of the operator name (e.g. returning '@' rather than the real operator name) on the Intel XMM7360 based L850-GL. The following scenario was happening: - the base-sim code sends a first MBIM 'home-provider' query to read the operator identifier. - this query times-out after 10 seconds. - the base-sim immediately sends another MBIM 'home-provider' query to read the operator name. - the modem returns a corrupted operator identifier. Intel helped for the debugging and indicates that when the first query happens, the modem starts reading the SIM files (EF SPN/PNN), apparently it's taking a long time, when it's receives the second query while the first one is not entirely processed, this triggers a bug (in the modem firmware) and returns a corrupted name.
2020-11-09broadband-modem-mbim: peeking MBIM port only in MBIM modemsAleksander Morgado
Move the logic out of the base modem, and make it applicable only for MBIM modems.
2020-08-28api,sim: new 'Active' propertyAleksander Morgado
In preparation for the multi-SIM setup, we need a way to tell whether a given SIM card is active or not in the system. On systems with one single SIM slot, the available SIM card will always be active. On Multi-SIM Single-Standby setups we may have multiple SIM slots with multiple SIM cards, but only one of them will be active at any given time. On Multi-SIM Multi-Standby setups we may have multiple SIM slots with multiple SIM cards that may be active at the same time. E.g. the QMI protocol allows up to 5 different active SIM cards (primary, secondary, tertiary...).
2020-04-08error-helpers: port to use object loggingAleksander Morgado
2020-04-08sim-mbim: port to use object loggingAleksander Morgado
2017-09-07sim-mbim: update unlock retries information after PIN operationsBen Chan
After MMSimMbim performs a MBIM_CID_PIN set operation, it calls mm_iface_modem_update_lock_info() (through its base class MMBaseSim) to refresh the unlock retries information, which results in a MBIM_CID_PIN query. However, a MBIM_CID_PIN query reports only the information of one PIN type and the PIN type can't be specified, we need to deduce the number of retries left for a specific PIN type from the response of a MBIM_CID_PIN set operation for that PIN type. To allow that, this patch modifies MMSimMbim to update the unlock retries information after a PIN operation based on the response to the MBIM_CID_PIN set operation.
2017-06-30sim-mbim: port MMSimMbim to use GTaskBen Chan
2017-03-29core: remove explicit GDestroyNotify cast on g_free / g_object_unrefBen Chan
g_free and g_object_unref are in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_free and g_object_unref is thus not needed.
2014-12-30mbim: use the new response checker helper methodAleksander Morgado
mbim_message_response_get_result() is available in libmbim-glib 1.11.1.
2014-07-06sim: rename 'MMSim' to 'MMBaseSim'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-02-13ports: rename 'MMMbimPort' to 'MMPortMbim'Aleksander Morgado
2013-12-10sim-mbim: prevent potential leak when loading SIM idenitifier and IMSIBen Chan
This patch addresses a potential memory leak when load_sim_identifier or load_imsi in MMSimMbim is called but the caller does not provide a GAsyncReadyCallback.
2013-12-10sim-mbim: prevent potential leak when loading operator idenitifier and nameBen Chan
This patch addresses a potential memory leak when load_operator_identifier or load_operator_name in MMSimMbim is called but the caller does not provide a GAsyncReadyCallback. Reported by Aleksander Morgado <aleksander@lanedo.com>
2013-12-03sim-mbim: implement operator identifier and name loadingBen Chan
2013-04-17sim-mbim: add TODO about the home provider infoAleksander Morgado
2013-04-17broadband-modem-mbim,sim-mbim: update message creator/parser namesAleksander Morgado
Sync with libmbim commit: commit b73673bf30a82e95819deb17296c9234399f0795 Author: Aleksander Morgado <aleksander@lanedo.com> Date: Thu Apr 11 20:07:12 2013 +0200 mbim-codegen: properly define the 4 types of messages that we may have
2013-04-17sim-mbim: implement SIM identifier and IMSI loadingAleksander Morgado
2013-04-17sim-mbim: these modems don't allow to enable/disable/change PIN if lockedAleksander Morgado
2013-04-17sim-mbim: implement PIN changingAleksander Morgado
2013-04-17sim-mbim: implement PIN enabling/disablingAleksander Morgado
2013-04-17broadband-modem-mbim,sim-mbim: consider MBIM result errorsAleksander Morgado
2013-04-17sim-mbim: implement PUK unlockingAleksander Morgado
2013-04-17mbim-port: no longer needed to request next transaction IDAleksander Morgado
Already handled by the MbimDevice if none given.
2013-04-17sim-mbim: implement PIN unlockingAleksander Morgado
2013-04-17mbim: add initial MBIM support skeletonAleksander Morgado