From 7b878765c6c8025ca7a4594af798a3d892e5bc58 Mon Sep 17 00:00:00 2001 From: Rukun Mao Date: Thu, 31 Aug 2023 20:04:32 +0000 Subject: broadband-modem-mbim: reprobe modem and update SIM info after "nonInitialized" error When the subscriber ready status notification's ready state becomes "initialized" from "nonInitialized", it indicates a new SIM is inserted, for which a modem reprobe is needed. --- src/mm-broadband-modem-mbim.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c index f8bb4fa0..63821c9c 100644 --- a/src/mm-broadband-modem-mbim.c +++ b/src/mm-broadband-modem-mbim.c @@ -5152,6 +5152,11 @@ basic_connect_notification_subscriber_ready_status (MMBroadbandModemMbim *self, if ((self->priv->enabled_cache.last_ready_state != MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED && ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED) || (self->priv->enabled_cache.last_ready_state == MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED && + ready_state != MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED) || + /*SIM state becomes "not initialized" when queried shortly after being inserted. Its state + * transitions are: "not inserted" --> "not initialized" --> "initialized". To detect SIM + * hotswap event from this sequence, we need the check condition below*/ + (self->priv->enabled_cache.last_ready_state == MBIM_SUBSCRIBER_READY_STATE_NOT_INITIALIZED && ready_state != MBIM_SUBSCRIBER_READY_STATE_SIM_NOT_INSERTED)) { /* SIM has been removed or reinserted, re-probe to ensure correct interfaces are exposed */ mm_obj_dbg (self, "SIM hot swap detected"); -- cgit v1.2.3-70-g09d2