From 3ad4e5ab21873e7b4ed44f3314bd08d1e075eb53 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 29 Sep 2010 23:23:29 +0900 Subject: atmodem: Update IFX specific SIM ready checking It seems that the XSIM notification doesn't really send SIM ready status. It sends ready to attach instead: > AT+CPIN="0000"\r < \r\nOK\r\n < \r\n+XLOCK: "PN",5,0,"PU",5,0,"PP",5,0,"PC",5,0,"PS",5,0\r\n < \r\n+XSIM: 7\r\n So either SIM ready or ready to attach is received more to the post_sim state. --- drivers/atmodem/sim.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c index 987dd7c1..d0a7148c 100644 --- a/drivers/atmodem/sim.c +++ b/drivers/atmodem/sim.c @@ -554,9 +554,13 @@ static void at_xsim_notify(GAtResult *result, gpointer user_data) if (!g_at_result_iter_next_number(&iter, &state)) return; - /* check for state 3 (PIN verified – Ready) */ - if (state != 3) + switch (state) { + case 3: /* PIN verified – Ready */ + case 7: /* ready for attach (+COPS) */ + break; + default: return; + } cb(&error, cbd->data); -- cgit v1.2.3