diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-02-08 15:33:17 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-02-08 15:33:17 -0600 |
commit | ea771ec186613c365a5404c6c178db512f651795 (patch) | |
tree | 87b73cbd9ae556c1ab90d2e24402a69dbcc78017 /src | |
parent | d11505f7510c31746c9bf642dbbf548991a6a40f (diff) | |
download | ofono-ea771ec186613c365a5404c6c178db512f651795.tar.bz2 |
Fix: Tweak gprs attach logic
We use driver_attached to track whether the driver is attached /
attaching. Unfortunately we only set it when set_attached succeeds.
Instead we should set it right away when calling set_attached, so we
cover pending attaches as well.
Diffstat (limited to 'src')
-rw-r--r-- | src/gprs.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -988,10 +988,10 @@ static void gprs_attach_callback(const struct ofono_error *error, void *data) { struct ofono_gprs *gprs = data; - if (error->type == OFONO_ERROR_TYPE_NO_ERROR) { - gprs->driver_attached = !gprs->driver_attached; + if (error->type == OFONO_ERROR_TYPE_NO_ERROR) gprs_attached_update(gprs); - } + else + gprs->driver_attached = !gprs->driver_attached; if (gprs->driver->registration_status) { gprs->driver->registration_status(gprs, registration_status_cb, @@ -1029,6 +1029,7 @@ 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; } static void netreg_status_changed(int status, int lac, int ci, int tech, @@ -1422,8 +1423,7 @@ void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status, int lac, int ci, int tech) { /* If we are not attached and haven't tried to attach, ignore */ - if (gprs->driver_attached == FALSE && - (gprs->flags & GPRS_FLAG_ATTACHING) == 0) + if (gprs->driver_attached == FALSE) return; if (gprs->status != status) |