* [PATCH] gprs: Correctly set driver_attached
@ 2014-04-09 10:13 Brian Ruptash
0 siblings, 0 replies; only message in thread
From: Brian Ruptash @ 2014-04-09 10:13 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]
It seems to me gprs->driver_attached must always be set prior to
calling gprs->driver->set_attached(), since if set_attached() fails the
callback inverts driver_attached to revert to its prior state.
---
src/gprs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gprs.c b/src/gprs.c
index e379f7b..6fffe73 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1593,8 +1593,8 @@ static void gprs_netreg_update(struct ofono_gprs *gprs)
gprs->flags |= GPRS_FLAG_ATTACHING;
- gprs->driver->set_attached(gprs, attach, gprs_attach_callback, gprs);
gprs->driver_attached = attach;
+ gprs->driver->set_attached(gprs, attach, gprs_attach_callback, gprs);
}
static void netreg_status_changed(int status, int lac, int ci, int tech,
@@ -2178,6 +2178,8 @@ void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status)
detach:
gprs->flags |= GPRS_FLAG_ATTACHING;
+
+ gprs->driver_attached = FALSE;
gprs->driver->set_attached(gprs, FALSE, gprs_attach_callback, gprs);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-09 10:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 10:13 [PATCH] gprs: Correctly set driver_attached Brian Ruptash
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox