* [PATCH 0/1] Add pin retry count support for mbm
@ 2011-02-01 13:45 Jeevaka Badrappan
2011-02-01 13:45 ` [PATCH 1/1] atmodem: " Jeevaka Badrappan
0 siblings, 1 reply; 4+ messages in thread
From: Jeevaka Badrappan @ 2011-02-01 13:45 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
Hi,
Following patch adds pin retry count support for mbm modem.
Regards,
Jeevaka
Jeevaka Badrappan (1):
atmodem: Add pin retry count support for mbm
drivers/atmodem/sim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] atmodem: Add pin retry count support for mbm
2011-02-01 13:45 [PATCH 0/1] Add pin retry count support for mbm Jeevaka Badrappan
@ 2011-02-01 13:45 ` Jeevaka Badrappan
2011-02-01 15:37 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Jeevaka Badrappan @ 2011-02-01 13:45 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2279 bytes --]
---
drivers/atmodem/sim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index dfd40f8..d9c0d8d 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -58,6 +58,7 @@ static const char *clck_prefix[] = { "+CLCK:", NULL };
static const char *huawei_cpin_prefix[] = { "^CPIN:", NULL };
static const char *xpincnt_prefix[] = { "+XPINCNT:", NULL };
static const char *cpinr_prefixes[] = { "+CPINR:", "+CPINRE:", NULL };
+static const char *epin_prefix[] = { "*EPIN:", NULL };
static const char *none_prefix[] = { NULL };
static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -555,6 +556,45 @@ error:
CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
}
+static void at_epin_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_sim_pin_retries_cb_t cb = cbd->cb;
+ const char *final = g_at_result_final_response(result);
+ GAtResultIter iter;
+ struct ofono_error error;
+ int retries[OFONO_SIM_PASSWORD_INVALID];
+ size_t i;
+ static enum ofono_sim_password_type password_types[] = {
+ OFONO_SIM_PASSWORD_SIM_PIN,
+ OFONO_SIM_PASSWORD_SIM_PUK,
+ OFONO_SIM_PASSWORD_SIM_PIN2,
+ OFONO_SIM_PASSWORD_SIM_PUK2,
+ };
+
+ decode_at_error(&error, final);
+
+ if (!ok) {
+ cb(&error, NULL, cbd->data);
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "*EPIN:"))
+ goto error;
+
+ BUILD_PIN_RETRIES_ARRAY(password_types, ARRAY_SIZE(password_types),
+ retries);
+
+ cb(&error, retries, cbd->data);
+
+ return;
+
+error:
+ CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
+}
+
static void at_cpinr_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -621,6 +661,12 @@ static void at_pin_retries_query(struct ofono_sim *sim,
return;
break;
+ case OFONO_VENDOR_MBM:
+ if (g_at_chat_send(sd->chat, "AT*EPIN?", epin_prefix,
+ at_epin_cb, cbd, g_free) > 0)
+ return;
+
+ break;
default:
if (g_at_chat_send(sd->chat, "AT+CPINR", cpinr_prefixes,
at_cpinr_cb, cbd, g_free) > 0)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] atmodem: Add pin retry count support for mbm
2011-02-01 13:45 ` [PATCH 1/1] atmodem: " Jeevaka Badrappan
@ 2011-02-01 15:37 ` Marcel Holtmann
0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2011-02-01 15:37 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 209 bytes --]
Hi Jeevaka,
> drivers/atmodem/sim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 46 insertions(+), 0 deletions(-)
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 0/1] Add pin retry count support for mbm
@ 2011-02-01 12:37 Jeevaka Badrappan
0 siblings, 0 replies; 4+ messages in thread
From: Jeevaka Badrappan @ 2011-02-01 12:37 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
Hi,
Following patch adds pin retry count support for mbm modem.
Regards,
Jeevaka
Jeevaka Badrappan (1):
atmodem: Add pin retry count support for mbm
drivers/atmodem/sim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-01 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 13:45 [PATCH 0/1] Add pin retry count support for mbm Jeevaka Badrappan
2011-02-01 13:45 ` [PATCH 1/1] atmodem: " Jeevaka Badrappan
2011-02-01 15:37 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2011-02-01 12:37 [PATCH 0/1] " Jeevaka Badrappan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.