aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-sim.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-05-16 13:34:54 +0200
committerAleksander Morgado <aleksander@aleksander.es>2022-05-20 09:03:54 +0000
commitb497de325a15700612e7bc83be238204f41153e6 (patch)
tree52f748b99c8577ddd37561cec0763c42ef07e18e /src/mm-base-sim.c
parentc987757a2c133f2e3be89c3a7590b8538f4bbe18 (diff)
iface-modem: common SIM event reporting logic
We no longer have separate mm_base_modem_process_sim_event() and mm_broadband_modem_sim_hot_swap_detected() methods. The only difference between both of them was that one of them would attempt to cleanup the ports context associated to the SIM hot swap event logic as soon as a swap was detected, in order to avoid queueing up multiple such events. The previous logic wasn't working well, though, as there could be mixed AT+QMI or AT+MBIM devices that would also require that same cleanup and so we didn't always know which one should have been called. Now we have a single mm_iface_modem_process_sim_event() method, which will trigger the reprobe and disabling, but which will also perform the cleanup of the SIM ports swap setup as specified by the implementation. So, if a plugin explicitly initializes the serial ports context for SIM hot swap handling, it should also explicitly clean it up. Also, the initialization of the serial ports context for SIM hot swap handling is no longer done automatically for all modems, it will be done only for those modems using it; i.e. the modems that explicitly report support SIM hot swap handling using AT URCs.
Diffstat (limited to 'src/mm-base-sim.c')
-rw-r--r--src/mm-base-sim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mm-base-sim.c b/src/mm-base-sim.c
index 22b54ba1..7d3f3cf4 100644
--- a/src/mm-base-sim.c
+++ b/src/mm-base-sim.c
@@ -98,7 +98,7 @@ reprobe_if_puk_discovered (MMBaseSim *self,
MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK)) {
mm_obj_dbg (self, "Discovered PUK lock, discarding old modem...");
- mm_base_modem_process_sim_event (self->priv->modem);
+ mm_iface_modem_process_sim_event (MM_IFACE_MODEM (self->priv->modem));
}
}
@@ -905,7 +905,7 @@ handle_send_puk_ready (MMBaseSim *self,
if (sim_error) {
mm_obj_info (self, "Received critical sim error. SIM might be permanently blocked. Reprobing...");
- mm_base_modem_process_sim_event (self->priv->modem);
+ mm_iface_modem_process_sim_event (MM_IFACE_MODEM (self->priv->modem));
}
handle_send_puk_context_free (ctx);