All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
To: ofono@ofono.org
Subject: Re: [PATCHv2 2/3] network: Add CPHS SPN, short-SPN fallbacks
Date: Mon, 19 Dec 2011 14:58:33 +0200	[thread overview]
Message-ID: <4EEF34F9.9050503@intel.com> (raw)
In-Reply-To: <4EEBE831.8030701@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]

Hello Denis,

On 12/17/2011 02:54 AM, Denis Kenzior wrote:
> I went ahead and applied this patch, but modified it heavily afterward.
>   Can you please check the changes starting at 7f18695f and make sure
> that things are still working as intended and I didn't screw anything up.

Everything works as expected, thanks for the help!

I just wonder now about the case when the SPN update would happen while the 
NETWORK_REGISTRATION_FLAG_READING_SPN is on.

diff --git a/src/network.c b/src/network.c
struct ofono_netreg {
[...]
         char *spn;
+       unsigned int spn_update;
  };
[...]

+static gboolean spn_update_cb(gpointer userdata)
+{
+       struct ofono_netreg *netreg = userdata;
+
+       if (netreg->flags & NETWORK_REGISTRATION_FLAG_READING_SPN)
+               return TRUE;
+
+       netreg->spn_update = 0;
+
+       sim_spn_changed(0, netreg);
+
+       return FALSE;
+}
+
  static void sim_spn_changed(int id, void *userdata)
  {
         struct ofono_netreg *netreg = userdata;
         gboolean had_spn;

-       if (netreg->flags & NETWORK_REGISTRATION_FLAG_READING_SPN)
+       if (netreg->flags & NETWORK_REGISTRATION_FLAG_READING_SPN) {
+               if (netreg->spn_update == 0)
+                       netreg->spn_update = g_timeout_add(1000,
+                                                       spn_update_cb, netreg);
+
                 return;
+       }
[...]

What do you think?

I will be sending SPN changes for src/gprs.c soon.

Regards,
Oleg
-- 
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki


  reply	other threads:[~2011-12-19 12:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 11:36 [PATCHv2 0/3] CPHS SPN, short-SPN support Oleg Zhurakivskyy
2011-12-13 11:36 ` [PATCHv2 1/3] network: Use netreg_emit_operator_display_name() Oleg Zhurakivskyy
2011-12-16  6:46   ` Denis Kenzior
2011-12-13 11:36 ` [PATCHv2 2/3] network: Add CPHS SPN, short-SPN fallbacks Oleg Zhurakivskyy
2011-12-17  0:54   ` Denis Kenzior
2011-12-19 12:58     ` Oleg Zhurakivskyy [this message]
2011-12-20  6:34       ` Denis Kenzior
2011-12-20 13:19         ` Oleg Zhurakivskyy
2011-12-20 15:32           ` Denis Kenzior
2011-12-21  8:48             ` Oleg Zhurakivskyy
2011-12-13 11:36 ` [PATCHv2 3/3] TODO: Remove completed CPHS SPN and short-SPN tasks Oleg Zhurakivskyy
2011-12-17  0:54   ` 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=4EEF34F9.9050503@intel.com \
    --to=oleg.zhurakivskyy@intel.com \
    --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 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.