* [PATCH 0/2] *** code puk fix ***
@ 2018-05-22 13:08 Florent Beillonnet
2018-05-22 13:08 ` [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085 Florent Beillonnet
2018-05-22 13:08 ` [PATCH 2/2] Rework at_pin_send_puk It seems that the function at_pin_send_puk should have been changed along with at_pin_send, because it's also refering to the at_pin_send_cb callback See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851 Florent Beillonnet
0 siblings, 2 replies; 6+ messages in thread
From: Florent Beillonnet @ 2018-05-22 13:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 965 bytes --]
*** The issue was that the puk code was not accepted by ofono.
First, it appears that the properties were not updated after entering pin code.
For instance, after a wrong pin code, the Retries property was still at 3.
The first patch fixes this issue.
Then, entering a correct puk code caused ofono to crash.
The second patch fixes this issue. ***
Florent Beillonnet (2):
Adding the ofono_sim_initialized_notify function after
ofono_sim_inserted_notify, as suggested by Denis Kenzior in this
commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085
Rework at_pin_send_puk It seems that the function at_pin_send_puk
should have been changed along with at_pin_send, because it's also
refering to the at_pin_send_cb callback See this commit :
ba9f126716db3ae0bf6a3139088d9657cfb8b851
drivers/atmodem/sim.c | 4 ++--
plugins/gemalto.c | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085
2018-05-22 13:08 [PATCH 0/2] *** code puk fix *** Florent Beillonnet
@ 2018-05-22 13:08 ` Florent Beillonnet
2018-05-23 14:44 ` Denis Kenzior
2018-05-22 13:08 ` [PATCH 2/2] Rework at_pin_send_puk It seems that the function at_pin_send_puk should have been changed along with at_pin_send, because it's also refering to the at_pin_send_cb callback See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851 Florent Beillonnet
1 sibling, 1 reply; 6+ messages in thread
From: Florent Beillonnet @ 2018-05-22 13:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 781 bytes --]
---
plugins/gemalto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/gemalto.c b/plugins/gemalto.c
index ec8174d..29e3b09 100644
--- a/plugins/gemalto.c
+++ b/plugins/gemalto.c
@@ -160,6 +160,7 @@ static void sim_ready_cb(gboolean present, gpointer user_data)
DBG("sim present: %d", present);
ofono_sim_inserted_notify(sim, present);
+ ofono_sim_initialized_notify(sim);
}
static void gemalto_ciev_notify(GAtResult *result, gpointer user_data)
@@ -576,6 +577,7 @@ static void gemalto_pre_sim(struct ofono_modem *modem)
if (data->sim && data->have_sim == TRUE)
ofono_sim_inserted_notify(data->sim, TRUE);
+ ofono_sim_initialized_notify(data->sim);
}
static void gemalto_post_sim(struct ofono_modem *modem)
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] Rework at_pin_send_puk It seems that the function at_pin_send_puk should have been changed along with at_pin_send, because it's also refering to the at_pin_send_cb callback See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851
2018-05-22 13:08 [PATCH 0/2] *** code puk fix *** Florent Beillonnet
2018-05-22 13:08 ` [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085 Florent Beillonnet
@ 2018-05-22 13:08 ` Florent Beillonnet
2018-05-23 14:05 ` Denis Kenzior
1 sibling, 1 reply; 6+ messages in thread
From: Florent Beillonnet @ 2018-05-22 13:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
---
drivers/atmodem/sim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index ab75b32..10dc800 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -1359,12 +1359,12 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
char buf[64];
int ret;
- cbd->user = sd;
+ cbd->user = sim;
snprintf(buf, sizeof(buf), "AT+CPIN=\"%s\",\"%s\"", puk, passwd);
ret = g_at_chat_send(sd->chat, buf, none_prefix,
- at_pin_send_cb, cbd, NULL);
+ at_pin_send_cb, cbd, g_free);
memset(buf, 0, sizeof(buf));
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Rework at_pin_send_puk It seems that the function at_pin_send_puk should have been changed along with at_pin_send, because it's also refering to the at_pin_send_cb callback See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851
2018-05-22 13:08 ` [PATCH 2/2] Rework at_pin_send_puk It seems that the function at_pin_send_puk should have been changed along with at_pin_send, because it's also refering to the at_pin_send_cb callback See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851 Florent Beillonnet
@ 2018-05-23 14:05 ` Denis Kenzior
0 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2018-05-23 14:05 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
Hi Florent,
On 05/22/2018 08:08 AM, Florent Beillonnet wrote:
> ---
> drivers/atmodem/sim.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
I went ahead and applied this after fixing up the commit header &
description. Please see doc/coding-style.txt, item M5 in particular.
Thanks!
Regards,
-Denis
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085
2018-05-22 13:08 ` [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085 Florent Beillonnet
@ 2018-05-23 14:44 ` Denis Kenzior
2018-05-25 9:15 ` Florent Beillonnet
0 siblings, 1 reply; 6+ messages in thread
From: Denis Kenzior @ 2018-05-23 14:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
Hi Florent,
On 05/22/2018 08:08 AM, Florent Beillonnet wrote:
> ---
> plugins/gemalto.c | 2 ++
> 1 file changed, 2 insertions(+)
You really shouldn't need to do this given that you have a URC inside
gemalto_ciev_notify() that does exactly this already.
No, I think there's a tiny bug in the core introduced by the commit you
reference above. Try this change?
@@ -847,7 +847,7 @@ static void sim_enter_pin_cb(const struct
ofono_error *error, void *data)
__ofono_dbus_pending_reply(&sim->pending, reply);
- if (sim->initialized)
+ if (sim->initialized || error->type != OFONO_ERROR_TYPE_NO_ERROR)
goto recheck;
if (sim->pin_type == OFONO_SIM_PASSWORD_SIM_PIN ||
Regards,
-Denis
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085
2018-05-23 14:44 ` Denis Kenzior
@ 2018-05-25 9:15 ` Florent Beillonnet
0 siblings, 0 replies; 6+ messages in thread
From: Florent Beillonnet @ 2018-05-25 9:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]
Hi Denis,
I'm sorry, I really messed up with my last mails with the header and
description of the commits.
I tryed your change, and indeed it seems to work properly now, so I think
you can apply it.
Thank you !
Florent
2018-05-23 16:44 GMT+02:00 Denis Kenzior <denkenz@gmail.com>:
> Hi Florent,
>
> On 05/22/2018 08:08 AM, Florent Beillonnet wrote:
>
>> ---
>> plugins/gemalto.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>
> You really shouldn't need to do this given that you have a URC inside
> gemalto_ciev_notify() that does exactly this already.
>
> No, I think there's a tiny bug in the core introduced by the commit you
> reference above. Try this change?
>
> @@ -847,7 +847,7 @@ static void sim_enter_pin_cb(const struct ofono_error
> *error, void *data)
>
> __ofono_dbus_pending_reply(&sim->pending, reply);
>
> - if (sim->initialized)
> + if (sim->initialized || error->type != OFONO_ERROR_TYPE_NO_ERROR)
> goto recheck;
>
> if (sim->pin_type == OFONO_SIM_PASSWORD_SIM_PIN ||
>
> Regards,
> -Denis
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1727 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-05-25 9:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 13:08 [PATCH 0/2] *** code puk fix *** Florent Beillonnet
2018-05-22 13:08 ` [PATCH 1/2] Adding the ofono_sim_initialized_notify function after ofono_sim_inserted_notify, as suggested by Denis Kenzior in this commit : 54d56d763e40bc44c99a9b24aa0477bd373ea085 Florent Beillonnet
2018-05-23 14:44 ` Denis Kenzior
2018-05-25 9:15 ` Florent Beillonnet
2018-05-22 13:08 ` [PATCH 2/2] Rework at_pin_send_puk It seems that the function at_pin_send_puk should have been changed along with at_pin_send, because it's also refering to the at_pin_send_cb callback See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851 Florent Beillonnet
2018-05-23 14:05 ` Denis Kenzior
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.