* [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
@ 2010-11-03 12:06 Marit Henriksen
2010-11-03 13:37 ` Marcel Holtmann
2010-11-03 13:44 ` Denis Kenzior
0 siblings, 2 replies; 5+ messages in thread
From: Marit Henriksen @ 2010-11-03 12:06 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]
From: Marit Henriksen <marit.henriksen@stericsson.com>
When adding the use of pin event *EPEV also to at_pin_send_puk_cb,
it becomes identical to at_pin_send_cb, and can be removed.
---
drivers/atmodem/sim.c | 44 +-------------------------------------------
1 files changed, 1 insertions(+), 43 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 3abd1d8..9cfdc65 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -647,48 +647,6 @@ error:
CALLBACK_WITH_FAILURE(cb, data);
}
-static void at_pin_send_puk_cb(gboolean ok, GAtResult *result,
- gpointer user_data)
-{
- struct cb_data *cbd = user_data;
- struct sim_data *sd = cbd->user;
- ofono_sim_lock_unlock_cb_t cb = cbd->cb;
- struct ofono_error error;
-
- decode_at_error(&error, g_at_result_final_response(result));
-
- if (!ok)
- goto done;
-
- switch (sd->vendor) {
- case OFONO_VENDOR_IFX:
- /*
- * On the IFX modem, AT+CPIN? can return READY too
- * early and so use +XSIM notification to detect
- * the ready state of the SIM.
- */
- sd->ready_id = g_at_chat_register(sd->chat, "+XSIM",
- at_xsim_notify,
- FALSE, cbd, g_free);
- return;
- case OFONO_VENDOR_MBM:
- /*
- * On the MBM modem, AT+CPIN? keeps returning SIM PIN
- * for a moment after successful AT+CPIN="..", but then
- * sends *EPEV when that changes.
- */
- sd->ready_id = g_at_chat_register(sd->chat, "*EPEV",
- at_epev_notify,
- FALSE, cbd, g_free);
- return;
- }
-
-done:
- cb(&error, cbd->data);
-
- g_free(cbd);
-}
-
static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data)
@@ -706,7 +664,7 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
snprintf(buf, sizeof(buf), "AT+CPIN=\"%s\",\"%s\"", puk, passwd);
ret = g_at_chat_send(sd->chat, buf, none_prefix,
- at_pin_send_puk_cb, cbd, NULL);
+ at_pin_send_cb, cbd, NULL);
memset(buf, 0, sizeof(buf));
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
2010-11-03 12:06 [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead Marit Henriksen
@ 2010-11-03 13:37 ` Marcel Holtmann
2010-11-03 13:44 ` Denis Kenzior
1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2010-11-03 13:37 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
Hi Marit,
> When adding the use of pin event *EPEV also to at_pin_send_puk_cb,
> it becomes identical to at_pin_send_cb, and can be removed.
> ---
> drivers/atmodem/sim.c | 44 +-------------------------------------------
> 1 files changed, 1 insertions(+), 43 deletions(-)
I am fine with this patch, but I have let Denis have a second look.
Since getting this right for IFX took me three attempts. Most likely
that was my own stupidity, but just in case ;)
Regards
Marcel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
2010-11-03 12:06 [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead Marit Henriksen
2010-11-03 13:37 ` Marcel Holtmann
@ 2010-11-03 13:44 ` Denis Kenzior
1 sibling, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2010-11-03 13:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3006 bytes --]
Hi Marit,
On 11/03/2010 07:06 AM, Marit Henriksen wrote:
> From: Marit Henriksen <marit.henriksen@stericsson.com>
>
> When adding the use of pin event *EPEV also to at_pin_send_puk_cb,
> it becomes identical to at_pin_send_cb, and can be removed.
> ---
> drivers/atmodem/sim.c | 44 +-------------------------------------------
> 1 files changed, 1 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
> index 3abd1d8..9cfdc65 100644
> --- a/drivers/atmodem/sim.c
> +++ b/drivers/atmodem/sim.c
> @@ -647,48 +647,6 @@ error:
> CALLBACK_WITH_FAILURE(cb, data);
> }
>
> -static void at_pin_send_puk_cb(gboolean ok, GAtResult *result,
> - gpointer user_data)
> -{
> - struct cb_data *cbd = user_data;
> - struct sim_data *sd = cbd->user;
> - ofono_sim_lock_unlock_cb_t cb = cbd->cb;
> - struct ofono_error error;
> -
> - decode_at_error(&error, g_at_result_final_response(result));
> -
> - if (!ok)
> - goto done;
> -
> - switch (sd->vendor) {
> - case OFONO_VENDOR_IFX:
> - /*
> - * On the IFX modem, AT+CPIN? can return READY too
> - * early and so use +XSIM notification to detect
> - * the ready state of the SIM.
> - */
> - sd->ready_id = g_at_chat_register(sd->chat, "+XSIM",
> - at_xsim_notify,
> - FALSE, cbd, g_free);
> - return;
> - case OFONO_VENDOR_MBM:
> - /*
> - * On the MBM modem, AT+CPIN? keeps returning SIM PIN
> - * for a moment after successful AT+CPIN="..", but then
> - * sends *EPEV when that changes.
> - */
> - sd->ready_id = g_at_chat_register(sd->chat, "*EPEV",
> - at_epev_notify,
> - FALSE, cbd, g_free);
> - return;
> - }
I'm fine with this patch but do note that it does not apply. I guess
that is because the OFONO_VENDOR_MBM part is not in the upstream repository.
Applying: atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb
instead.
fatal: sha1 information is lacking or useless (drivers/atmodem/sim.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 atmodem: Remove at_pin_send_puk_cb, and use
at_pin_send_cb instead.
When you have resolved this problem run "git am -3 --resolved".
If you would prefer to skip this patch, instead run "git am -3 --skip".
To restore the original branch and stop patching run "git am -3 --abort".
> -
> -done:
> - cb(&error, cbd->data);
> -
> - g_free(cbd);
> -}
> -
> static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
> const char *passwd,
> ofono_sim_lock_unlock_cb_t cb, void *data)
> @@ -706,7 +664,7 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
> snprintf(buf, sizeof(buf), "AT+CPIN=\"%s\",\"%s\"", puk, passwd);
>
> ret = g_at_chat_send(sd->chat, buf, none_prefix,
> - at_pin_send_puk_cb, cbd, NULL);
> + at_pin_send_cb, cbd, NULL);
>
> memset(buf, 0, sizeof(buf));
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
@ 2010-11-03 14:35 Marit Henriksen
2010-11-03 14:40 ` Marcel Holtmann
0 siblings, 1 reply; 5+ messages in thread
From: Marit Henriksen @ 2010-11-03 14:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]
From: Marit Henriksen <marit.henriksen@stericsson.com>
When adding the use of pin event *EPEV also to at_pin_send_puk_cb,
it becomes identical to at_pin_send_cb, and can be removed.
---
New patch, this one should apply:)
drivers/atmodem/sim.c | 44 +-------------------------------------------
1 files changed, 1 insertions(+), 43 deletions(-)
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 3abd1d8..9cfdc65 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -647,48 +647,6 @@ error:
CALLBACK_WITH_FAILURE(cb, data);
}
-static void at_pin_send_puk_cb(gboolean ok, GAtResult *result,
- gpointer user_data)
-{
- struct cb_data *cbd = user_data;
- struct sim_data *sd = cbd->user;
- ofono_sim_lock_unlock_cb_t cb = cbd->cb;
- struct ofono_error error;
-
- decode_at_error(&error, g_at_result_final_response(result));
-
- if (!ok)
- goto done;
-
- switch (sd->vendor) {
- case OFONO_VENDOR_IFX:
- /*
- * On the IFX modem, AT+CPIN? can return READY too
- * early and so use +XSIM notification to detect
- * the ready state of the SIM.
- */
- sd->ready_id = g_at_chat_register(sd->chat, "+XSIM",
- at_xsim_notify,
- FALSE, cbd, g_free);
- return;
- case OFONO_VENDOR_MBM:
- /*
- * On the MBM modem, AT+CPIN? keeps returning SIM PIN
- * for a moment after successful AT+CPIN="..", but then
- * sends *EPEV when that changes.
- */
- sd->ready_id = g_at_chat_register(sd->chat, "*EPEV",
- at_epev_notify,
- FALSE, cbd, g_free);
- return;
- }
-
-done:
- cb(&error, cbd->data);
-
- g_free(cbd);
-}
-
static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data)
@@ -706,7 +664,7 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
snprintf(buf, sizeof(buf), "AT+CPIN=\"%s\",\"%s\"", puk, passwd);
ret = g_at_chat_send(sd->chat, buf, none_prefix,
- at_pin_send_puk_cb, cbd, NULL);
+ at_pin_send_cb, cbd, NULL);
memset(buf, 0, sizeof(buf));
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
2010-11-03 14:35 Marit Henriksen
@ 2010-11-03 14:40 ` Marcel Holtmann
0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2010-11-03 14:40 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 750 bytes --]
Hi Marit,
> When adding the use of pin event *EPEV also to at_pin_send_puk_cb,
> it becomes identical to at_pin_send_cb, and can be removed.
> ---
> New patch, this one should apply:)
please also do [PATCH v2] so we know which version it is. git am will
strip these nicely away from us.
> drivers/atmodem/sim.c | 44 +-------------------------------------------
> 1 files changed, 1 insertions(+), 43 deletions(-)
Applying: atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
error: patch failed: drivers/atmodem/sim.c:647
error: drivers/atmodem/sim.c: patch does not apply
Patch failed at 0001 atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
It does not apply.
Regards
Marcel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-03 14:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-03 12:06 [PATCH] atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead Marit Henriksen
2010-11-03 13:37 ` Marcel Holtmann
2010-11-03 13:44 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2010-11-03 14:35 Marit Henriksen
2010-11-03 14:40 ` Marcel Holtmann
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.