From e9d15ae89959647c2bf1f28ab1725ce8e6e45a82 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sat, 24 Nov 2012 07:50:44 -0600 Subject: [PATCH] ifx: Rework SIM state handling When performing a SIM REFRESH, particularly NAA Initialization, we need to wait until the modem sends XSIMSTATE: 7, not XSIMSTATE:2. Even on normal initialization it seems safer to wait until XSIMSTATE:2. --- plugins/ifx.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/ifx.c b/plugins/ifx.c index eb30141..6936fd1 100644 --- a/plugins/ifx.c +++ b/plugins/ifx.c @@ -139,19 +139,24 @@ static void ifx_set_sim_state(struct ifx_data *data, int state) switch (state) { case 0: /* SIM not present */ + case 6: /* SIM Error */ + case 8: /* SIM Technical Problem */ case 9: /* SIM Removed */ ofono_sim_inserted_notify(data->sim, FALSE); break; case 1: /* PIN verification needed */ - case 2: /* PIN verification not needed – Ready */ - case 3: /* PIN verified – Ready */ case 4: /* PUK verification needed */ case 5: /* SIM permanently blocked */ - case 6: /* SIM Error */ case 7: /* ready for attach (+COPS) */ - case 8: /* SIM Technical Problem */ ofono_sim_inserted_notify(data->sim, TRUE); break; + case 2: /* PIN verification not needed – Ready */ + case 3: /* PIN verified – Ready */ + /* + * State 3 is handled in the SIM atom driver + * while for state 2 we should be waiting for state 7 + */ + break; case 10: /* SIM Reactivating */ case 11: /* SIM Reactivated */ case 12: /* SIM SMS Caching Completed */ -- 2.7.4