Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v2] fix can't attach GPRS issue
Date: Thu, 02 Jun 2011 02:51:31 -0500	[thread overview]
Message-ID: <4DE74103.3010500@gmail.com> (raw)
In-Reply-To: <1305009484-27363-1-git-send-email-caiwen.zhang@windriver.com>

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

Hi Caiwen,

On 05/10/2011 01:38 AM, Caiwen Zhang wrote:
> This patch is to fix the issue that can't attach GPRS after detach it. 
> 

I'd like to see a complete AT log of this situation if possible.  It
sounds like there's something else going on here...

> Cause:
>   When start detaching GPRS, driver_attched value is set to FALSE, if
> device registered to GPRS network during GPRS detaching, driver_attched is set to TURE.
> After that, GPRS attaching will always be ignored because driver_attched is always TURE.
> It seems the definition of driver_attched is confused.
> 
> Scenario:
>   When device is unregistered(+CREG: 2), GPRS is detached. During GPRS detaching, device
> registered to network again(+CREG: 1, xxx, xxx).

Really sounds like your firmware is too twitchy.  Why does it report
CREG: 2 and then immediately finds registration?  Is this related to
cell roaming or technology switch?

> 
> Solution:
>   variable attached represents the GPRS attach status, it only be TRUE, when CGATT=1 and 
> CGREG is registered or roaming(roaming allowed). variable driver_attached represents CGATT
> status of the driver. its value will only be changed after set_attached successfully or 
> GPRS detached notified. variable pending_attached represents the pending status of CGATT.
> 

Can you try the attached patch and tell me if this fixes your problem?

Regards,
-Denis

[-- Attachment #2: 0001-gprs-Experimental-fix-for-twitchy-Huawei-firmware.patch --]
[-- Type: text/plain, Size: 869 bytes --]

>From 4e02f2b46ce7b930b2c3ee6228d8c43e529a2254 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Thu, 2 Jun 2011 02:48:05 -0500
Subject: [PATCH] gprs: Experimental fix for twitchy Huawei firmware

---
 src/gprs.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index acbfa56..b9e3105 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -2108,6 +2108,14 @@ void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status)
 		return;
 	}
 
+	/*
+	 * If we're already taking action, e.g. attaching or detaching, then
+	 * ignore this notification for now, we will take appropriate action
+	 * after the set_attach operation has completed
+	 */
+	if (gprs->flags & GPRS_FLAG_ATTACHING)
+		return;
+
 	/* We registered without being powered */
 	if (gprs->powered == FALSE)
 		goto detach;
-- 
1.7.3.4


  reply	other threads:[~2011-06-02  7:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10  6:38 [PATCH v2] fix can't attach GPRS issue Caiwen Zhang
2011-06-02  7:51 ` Denis Kenzior [this message]
2011-06-03  2:15   ` Zhang, Caiwen
2011-06-02  9:13     ` Denis Kenzior
2011-06-03  3:42       ` Zhang, Caiwen
2011-06-02 12:22         ` Denis Kenzior
2011-06-07  7:24           ` Zhang, Caiwen
2011-06-06  2:00             ` 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=4DE74103.3010500@gmail.com \
    --to=denkenz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox