From 19c1b9cbf6049c1b4389573962479b26a98610c9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 19 Oct 2010 11:56:45 +0200 Subject: [PATCH] ifxmodem: Enable SIM Toolkit with AT+CFUN=6 The current Infineon firmware overloads the AT+CFUN command with enabling SIM Toolkit and fetching of proactive commands. It seems to be safe to send this command in offline mode (AT+CFUN=4) and also in online mode (AT+CFUN=1). These are the two cases where SIM Toolkit atom would be initialized. --- drivers/ifxmodem/stk.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/ifxmodem/stk.c b/drivers/ifxmodem/stk.c index 5c331ed0..2066f583 100644 --- a/drivers/ifxmodem/stk.c +++ b/drivers/ifxmodem/stk.c @@ -46,7 +46,7 @@ struct stk_data { static const char *none_prefix[] = { NULL }; static const char *sate_prefix[] = { "+SATE:", NULL }; -static const char *stkprof_prefix[] = { "+STKPROF:", NULL }; +static const char *cfun_prefix[] = { "+CFUN:", NULL }; static void sate_cb(gboolean ok, GAtResult *result, gpointer user_data) { @@ -241,7 +241,7 @@ static void satf_notify(GAtResult *result, gpointer user_data) ofono_stk_proactive_session_end_notify(stk); } -static void stkprof_support_cb(gboolean ok, GAtResult *result, +static void cfun_support_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct ofono_stk *stk = user_data; @@ -256,11 +256,8 @@ static void stkprof_support_cb(gboolean ok, GAtResult *result, g_at_chat_register(sd->chat, "+SATN:", satn_notify, FALSE, stk, NULL); g_at_chat_register(sd->chat, "+SATF:", satf_notify, FALSE, stk, NULL); - g_at_chat_send(sd->chat, "AT+STKPROF?", stkprof_prefix, - NULL, NULL, NULL); - - g_at_chat_send(sd->chat, "AT+STKPROF=4,\"1F7F\"", none_prefix, - NULL, NULL, NULL); + g_at_chat_send(sd->chat, "AT+CFUN=6", none_prefix, + NULL, NULL, NULL); ofono_stk_register(stk); } @@ -280,8 +277,8 @@ static int ifx_stk_probe(struct ofono_stk *stk, unsigned int vendor, void *data) ofono_stk_set_data(stk, sd); - g_at_chat_send(sd->chat, "AT+STKPROF=?", stkprof_prefix, - stkprof_support_cb, stk, NULL); + g_at_chat_send(sd->chat, "AT+CFUN=?", cfun_prefix, + cfun_support_cb, stk, NULL); return 0; }