From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH v4 1/2] atmodem: remove CGACT command
Date: Wed, 26 May 2010 18:12:31 +0200 [thread overview]
Message-ID: <1274890351.27220.168.camel@localhost.localdomain> (raw)
In-Reply-To: <20100526153615.2563.15365.stgit@potku.valot.fi>
[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]
Hi Kalle,
> It's enough that we shutdown PPP, no need to send CGACT after that.
> Recommended by Denis.
> ---
>
> drivers/atmodem/gprs-context.c | 51 +++++++++++++---------------------------
> 1 files changed, 16 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
> index ba5f0c0..9b32d59 100644
> --- a/drivers/atmodem/gprs-context.c
> +++ b/drivers/atmodem/gprs-context.c
> @@ -65,22 +65,6 @@ struct gprs_context_data {
> void *cb_data; /* Callback data */
> };
>
> -static void at_cgact_down_cb(gboolean ok, GAtResult *result, gpointer user_data)
> -{
> - struct cb_data *cbd = user_data;
> - ofono_gprs_context_cb_t cb = cbd->cb;
> - struct ofono_gprs_context *gc = cbd->user;
> - struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
> - struct ofono_error error;
> -
> - if (ok)
> - gcd->active_context = 0;
> -
> - decode_at_error(&error, g_at_result_final_response(result));
> -
> - cb(&error, cbd->data);
> -}
> -
> static void ppp_connect(const char *interface, const char *ip,
> const char *dns1, const char *dns2,
> gpointer user_data)
> @@ -104,13 +88,21 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
> struct ofono_gprs_context *gc = user_data;
> struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
>
> - if (gcd->state == STATE_ENABLING) {
> + DBG("");
> +
> + switch (gcd->state) {
> + case STATE_ENABLING:
> CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, FALSE, NULL,
> NULL, NULL, NULL, gcd->cb_data);
> - return;
> + break;
just double-checking that you really wanna have break; and not return;
here. So that gcd->state gets reset to STATE_IDLE.
> + case STATE_DISABLING:
> + CALLBACK_WITH_SUCCESS(gcd->down_cb, gcd->cb_data);
> + break;
> + default:
> + ofono_gprs_context_deactivated(gc, gcd->active_context);
> + break;
> }
>
> - ofono_gprs_context_deactivated(gc, gcd->active_context);
> gcd->active_context = 0;
> gcd->state = STATE_IDLE;
> }
Regards
Marcel
next prev parent reply other threads:[~2010-05-26 16:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 15:36 [PATCH v4 1/2] atmodem: remove CGACT command Kalle Valo
2010-05-26 15:36 ` [PATCH v4 2/2] atmodem: fix crash during context deactivation Kalle Valo
2010-05-26 17:37 ` Denis Kenzior
2010-05-26 16:12 ` Marcel Holtmann [this message]
2010-05-26 17:35 ` [PATCH v4 1/2] atmodem: remove CGACT command Kalle Valo
2010-05-26 17:37 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274890351.27220.168.camel@localhost.localdomain \
--to=marcel@holtmann.org \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox