From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 3/4] modem: some debugs added for indicating modem state change
Date: Sat, 02 Oct 2010 08:09:58 +0200 [thread overview]
Message-ID: <1285999798.4231.23.camel@aeonflux> (raw)
In-Reply-To: <1285949201-2994-4-git-send-email-petteri.tikander@ixonos.com>
[-- Attachment #1: Type: text/plain, Size: 1563 bytes --]
Hi Petteri,
> src/modem.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/src/modem.c b/src/modem.c
> index f6ed1ab..e90f4dc 100644
> --- a/src/modem.c
> +++ b/src/modem.c
> @@ -380,20 +380,25 @@ static void modem_change_state(struct ofono_modem *modem,
>
> modem->modem_state = new_state;
>
> - if (old_state > new_state)
> + if (old_state > new_state) {
> + DBG("flush atoms");
> flush_atoms(modem, new_state);
> + }
just adding a DBG("") in flush_atoms() at the top would be a bit better
here.
> switch (new_state) {
> case MODEM_STATE_POWER_OFF:
> + DBG("MODEM_STATE_POWER_OFF");
> modem->call_ids = 0;
> break;
>
> case MODEM_STATE_PRE_SIM:
> + DBG("MODEM_STATE_PRE_SIM");
> if (old_state < MODEM_STATE_PRE_SIM && driver->pre_sim)
> driver->pre_sim(modem);
> break;
>
> case MODEM_STATE_OFFLINE:
> + DBG("MODEM_STATE_OFFLINE");
> if (old_state < MODEM_STATE_OFFLINE) {
> if (driver->post_sim)
> driver->post_sim(modem);
> @@ -403,6 +408,7 @@ static void modem_change_state(struct ofono_modem *modem,
> break;
>
> case MODEM_STATE_ONLINE:
> + DBG("MODEM_STATE_ONLINE");
> if (driver->post_online)
> driver->post_online(modem);
> break;
I would prefer if we just add a DBG() at the top of modem_change_state
function that indicates the previous and the new state. And you can just
to start as integer value. No need for the string here. They are 4
states only anyway.
Regards
Marcel
next prev parent reply other threads:[~2010-10-02 6:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-01 16:06 Fixed Dialing Petteri Tikander
2010-10-01 16:06 ` [RFC PATCH 1/4] sim: check if FD is enabled in the SIM-card Petteri Tikander
2010-10-01 16:06 ` [RFC PATCH 2/4] modem: Remove atoms " Petteri Tikander
2010-10-01 16:06 ` [RFC PATCH 3/4] modem: some debugs added for indicating modem state change Petteri Tikander
2010-10-01 16:06 ` [RFC PATCH 4/4] TODO: Owner of Fixed Dialing task Petteri Tikander
2010-10-02 6:11 ` Marcel Holtmann
2010-10-02 6:09 ` Marcel Holtmann [this message]
2010-10-01 16:25 ` [RFC PATCH 1/4] sim: check if FD is enabled in the SIM-card Jeevaka.Badrappan
2010-10-04 12:19 ` Petteri Tikander
2010-10-02 6:22 ` Marcel Holtmann
2010-10-04 16:17 ` Petteri Tikander
2010-10-05 0:03 ` Denis Kenzior
2010-10-04 13:31 ` Pekka Pessi
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=1285999798.4231.23.camel@aeonflux \
--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