diff options
author | Aleksander Morgado <aleksandermj@google.com> | 2022-07-16 15:02:08 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-07-16 22:24:20 +0200 |
commit | c994ae1b3a19dd605c979d216fda624afbb56a91 (patch) | |
tree | 45a9be75b2a790a548b72d76d97ced97f0c72393 /src/mm-shared-qmi.c | |
parent | ba3b15fe29167529d5087119ca7a73518e9d0358 (diff) |
shared-qmi: move indication callbacks out of the SIM hot swap setup
Diffstat (limited to 'src/mm-shared-qmi.c')
-rw-r--r-- | src/mm-shared-qmi.c | 80 |
1 files changed, 43 insertions, 37 deletions
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c index c5ac4d91..f91731b1 100644 --- a/src/mm-shared-qmi.c +++ b/src/mm-shared-qmi.c @@ -3561,46 +3561,10 @@ mm_shared_qmi_set_primary_sim_slot (MMIfaceModem *self, } /*****************************************************************************/ -/* SIM hot swap detection */ +/* UIM refresh indication handling */ #define REFRESH_START_TIMEOUT_SECS 3 -typedef enum { - SETUP_SIM_HOT_SWAP_STEP_FIRST, - SETUP_SIM_HOT_SWAP_STEP_UIM_REGISTER_SLOT_STATUS, - SETUP_SIM_HOT_SWAP_STEP_UIM_CHECK_SLOT_STATUS, - SETUP_SIM_HOT_SWAP_STEP_UIM_SLOT_STATUS_INDICATION, - SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_REGISTER_ALL, - SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_REGISTER_ICCID, - SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_REGISTER_IMSI, - SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_INDICATION, - SETUP_SIM_HOT_SWAP_STEP_LAST, -} SetupSimHotSwapStep; - -typedef struct { - SetupSimHotSwapStep step; - gboolean register_slot_status_supported; - gboolean get_slot_status_supported; - gboolean refresh_all_supported; - gboolean refresh_file_supported; -} SetupSimHotSwapContext; - -static void setup_sim_hot_swap_step (GTask *task); - -static void -setup_sim_hot_swap_context_free (SetupSimHotSwapContext *ctx) -{ - g_slice_free (SetupSimHotSwapContext, ctx); -} - -gboolean -mm_shared_qmi_setup_sim_hot_swap_finish (MMIfaceModem *self, - GAsyncResult *res, - GError **error) -{ - return g_task_propagate_boolean (G_TASK (res), error); -} - static void uim_refresh_complete (QmiClientUim *client, QmiUimSessionType session_type) @@ -3712,6 +3676,9 @@ uim_refresh_indication_cb (QmiClientUim *client, } } +/*****************************************************************************/ +/* UIM slot status indication handling */ + /* Modifies the sim at slot == index+1, based on the content of slot_status. * Primarily used when a hotswap occurs on the inactive slot */ static void @@ -3870,6 +3837,45 @@ uim_slot_status_indication_cb (QmiClientUim *client, priv->slots_status = g_array_ref (new_slots_status); } +/*****************************************************************************/ +/* SIM hot swap setup */ + +typedef enum { + SETUP_SIM_HOT_SWAP_STEP_FIRST, + SETUP_SIM_HOT_SWAP_STEP_UIM_REGISTER_SLOT_STATUS, + SETUP_SIM_HOT_SWAP_STEP_UIM_CHECK_SLOT_STATUS, + SETUP_SIM_HOT_SWAP_STEP_UIM_SLOT_STATUS_INDICATION, + SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_REGISTER_ALL, + SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_REGISTER_ICCID, + SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_REGISTER_IMSI, + SETUP_SIM_HOT_SWAP_STEP_UIM_REFRESH_INDICATION, + SETUP_SIM_HOT_SWAP_STEP_LAST, +} SetupSimHotSwapStep; + +typedef struct { + SetupSimHotSwapStep step; + gboolean register_slot_status_supported; + gboolean get_slot_status_supported; + gboolean refresh_all_supported; + gboolean refresh_file_supported; +} SetupSimHotSwapContext; + +static void setup_sim_hot_swap_step (GTask *task); + +static void +setup_sim_hot_swap_context_free (SetupSimHotSwapContext *ctx) +{ + g_slice_free (SetupSimHotSwapContext, ctx); +} + +gboolean +mm_shared_qmi_setup_sim_hot_swap_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return g_task_propagate_boolean (G_TASK (res), error); +} + static void uim_refresh_register_file_ready (QmiClientUim *client, GAsyncResult *res, |