Skip to content

broadband-modem-mbim: Sync status of SIM hot swap flag

Michał Mazur requested to merge mkm/ModemManager:hotswap into main

State of the sim_hot_swap_configured variable is never set in mm-broadband-modem-mbim.c. Variable with the same name is defined in mm-iface-modem.c and configured but it is private:

This variable controls state of PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO flag which needs to be set to handle SIM swap events. If it is false, SIM events are disabled in modem_3gpp_disable_unsolicited_events() and cleanup_unsolicited_events_3gpp() called when the 3gpp interface is disabling.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blob/main/src/mm-broadband-modem-mbim.c#L5866

    if (!iface->priv->sim_hot_swap_configured)
        self->priv->enable_flags &= ~PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO;

In addition, there was a bug in cleanup_unsolicited_events_3gpp() which caused most flags to be cleared (including PROCESS_NOTIFICATION_FLAG_SUBSCRIBER_INFO) when the modem was disabled. Both issues made it impossible to handle SIM swap events in disabled state.

Merge request reports