* [PATCH] avoid stk atom is removed when sim pin is blocked
@ 2013-09-11 17:51 caiwen.zhang
2013-09-11 17:41 ` Denis Kenzior
0 siblings, 1 reply; 5+ messages in thread
From: caiwen.zhang @ 2013-09-11 17:51 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]
From: Caiwen Zhang <caiwen.zhang@intel.com>
When sim pin is blocked after input wrong pin code three times,
modem will change to pre-sim status, at this time, STK function
should be available. stk atoms shouldn't be removed.
---
src/modem.c | 7 ++++++-
src/stk.c | 4 ++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/modem.c b/src/modem.c
index 01b0e35..7124d53 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -196,7 +196,12 @@ struct ofono_atom *__ofono_modem_add_atom(struct ofono_modem *modem,
atom = g_new0(struct ofono_atom, 1);
atom->type = type;
- atom->modem_state = modem->modem_state;
+ /* to avoid STK is removed when modem change to
+ MODEM_STATE_PRE_SIM status */
+ if (type == OFONO_ATOM_TYPE_STK)
+ atom->modem_state = MODEM_STATE_PRE_SIM;
+ else
+ atom->modem_state = modem->modem_state;
atom->destruct = destruct;
atom->data = data;
atom->modem = modem;
diff --git a/src/stk.c b/src/stk.c
index 01c95b5..a00a425 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -3196,6 +3196,10 @@ struct ofono_stk *ofono_stk_create(struct ofono_modem *modem,
if (driver == NULL)
return NULL;
+ /* STK may already exist, in the case that restore from pin blocked */
+ if (__ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_STK) != NULL)
+ return NULL;
+
stk = g_try_new0(struct ofono_stk, 1);
if (stk == NULL)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] avoid stk atom is removed when sim pin is blocked
2013-09-11 17:51 [PATCH] avoid stk atom is removed when sim pin is blocked caiwen.zhang
@ 2013-09-11 17:41 ` Denis Kenzior
2013-09-12 1:14 ` Zhang, Caiwen
0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2013-09-11 17:41 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Hi Caiwen,
On 09/11/2013 12:51 PM, caiwen.zhang(a)intel.com wrote:
> From: Caiwen Zhang <caiwen.zhang@intel.com>
>
> When sim pin is blocked after input wrong pin code three times,
> modem will change to pre-sim status, at this time, STK function
> should be available. stk atoms shouldn't be removed.
Can you please provide a reference to a 3GPP / ETSI document which
states that this is the case?
> ---
> src/modem.c | 7 ++++++-
> src/stk.c | 4 ++++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] avoid stk atom is removed when sim pin is blocked
2013-09-11 17:41 ` Denis Kenzior
@ 2013-09-12 1:14 ` Zhang, Caiwen
2013-09-12 13:32 ` Denis Kenzior
0 siblings, 1 reply; 5+ messages in thread
From: Zhang, Caiwen @ 2013-09-12 1:14 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
Hi Denis,
> > When sim pin is blocked after input wrong pin code three times, modem
> > will change to pre-sim status, at this time, STK function should be
> > available. stk atoms shouldn't be removed.
>
> Can you please provide a reference to a 3GPP / ETSI document which states
> that this is the case?
I don't see any spec states STK should be available or unavailable when SIM PIN is blocked.
But all the modems of many different manufacturers I ever used keep STK available after SIM PIN is blocked.
Here if we remove stk atom and recreate it after pin is reset, stk function will be unusable.
> > ---
> > src/modem.c | 7 ++++++-
> > src/stk.c | 4 ++++
> > 2 files changed, 10 insertions(+), 1 deletion(-)
> >
>
Regards,
Caiwen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] avoid stk atom is removed when sim pin is blocked
2013-09-12 1:14 ` Zhang, Caiwen
@ 2013-09-12 13:32 ` Denis Kenzior
2013-09-16 12:33 ` Zhang, Caiwen
0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2013-09-12 13:32 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]
Hi Caiwen,
On 09/11/2013 08:14 PM, Zhang, Caiwen wrote:
>
> Hi Denis,
>
>>> When sim pin is blocked after input wrong pin code three times, modem
>>> will change to pre-sim status, at this time, STK function should be
>>> available. stk atoms shouldn't be removed.
>>
>> Can you please provide a reference to a 3GPP / ETSI document which states
>> that this is the case?
>
> I don't see any spec states STK should be available or unavailable when SIM PIN is blocked.
> But all the modems of many different manufacturers I ever used keep STK available after SIM PIN is blocked.
>
> Here if we remove stk atom and recreate it after pin is reset, stk function will be unusable.
Again, please elaborate. Much of Sim Toolkit depends on access to files
that can only be accessed with PIN entered. So leaving STK atom in a
fully functional state is not the answer either.
Why would stk be unusuable. Is it that we cannot recover the Main Menu
state after re-creating it?
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] avoid stk atom is removed when sim pin is blocked
2013-09-12 13:32 ` Denis Kenzior
@ 2013-09-16 12:33 ` Zhang, Caiwen
0 siblings, 0 replies; 5+ messages in thread
From: Zhang, Caiwen @ 2013-09-16 12:33 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]
Hi Denis,
> >>> When sim pin is blocked after input wrong pin code three times,
> >>> modem will change to pre-sim status, at this time, STK function
> >>> should be available. stk atoms shouldn't be removed.
> >>
> >> Can you please provide a reference to a 3GPP / ETSI document which
> >> states that this is the case?
> >
> > I don't see any spec states STK should be available or unavailable when SIM
> PIN is blocked.
> > But all the modems of many different manufacturers I ever used keep STK
> available after SIM PIN is blocked.
> >
> > Here if we remove stk atom and recreate it after pin is reset, stk function will
> be unusable.
>
> Again, please elaborate. Much of Sim Toolkit depends on access to files that
> can only be accessed with PIN entered. So leaving STK atom in a fully
> functional state is not the answer either.
>
> Why would stk be unusuable. Is it that we cannot recover the Main Menu
> state after re-creating it?
Yes. There is no way to retrieve the main menu again. It also may at that time SAT isn't
stay at the main menu.
Regards,
Caiwen
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-16 12:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 17:51 [PATCH] avoid stk atom is removed when sim pin is blocked caiwen.zhang
2013-09-11 17:41 ` Denis Kenzior
2013-09-12 1:14 ` Zhang, Caiwen
2013-09-12 13:32 ` Denis Kenzior
2013-09-16 12:33 ` Zhang, Caiwen
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.