2009/10/25 andrzej zaborowski <[email protected]>:
> Now that I think of it if the current status is 'searching' then
> possibly there's no point calling driver->set_attached (see second
> patch).

I repeated the same typo in this patch, attached is a corrected version, sorry.

Regards
From d0f0331ea8d3f8c4df75069cfca082bb99ce0dfa Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <[email protected]>
Date: Sun, 25 Oct 2009 09:35:26 +0100
Subject: [PATCH 2/2] Don't ask driver to attach GPRS if modem is already searching for operator.

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

diff --git a/src/gprs.c b/src/gprs.c
index bcba99c..2769c27 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -543,7 +543,9 @@ static void gprs_netreg_update(struct ofono_gprs *gprs)
 	attach = gprs->powered && operator_ok;
 
 	if (gprs->attached != attach &&
-			!(gprs->flags & GPRS_FLAG_ATTACHING)) {
+			!(gprs->flags & GPRS_FLAG_ATTACHING) &&
+			!(attach && gprs->status ==
+				NETWORK_REGISTRATION_STATUS_SEARCHING)) {
 		gprs->flags |= GPRS_FLAG_ATTACHING;
 
 		gprs->driver->set_attached(gprs, attach, gprs_attach_callback,
@@ -892,9 +894,9 @@ static void set_registration_status(struct ofono_gprs *gprs, int status)
 				DATA_CONNECTION_MANAGER_INTERFACE,
 				"Attached", DBUS_TYPE_BOOLEAN,
 				&attached);
-
-		gprs_netreg_update(gprs);
 	}
+
+	gprs_netreg_update(gprs);
 }
 
 static void set_registration_location(struct ofono_gprs *gprs,
-- 
1.6.1

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to