if (g_str_has_prefix(event, "NW DETACH ") ||
g_str_has_prefix(event, "ME DETACH ")) {
- ofono_gprs_attach_notify(gprs, 0);
+ ofono_gprs_detached_notify(gprs);
return;
}
}
void ofono_gprs_status_notify(struct ofono_gprs *gprs,
int status, int lac, int ci, int tech);
-void ofono_gprs_attach_notify(struct ofono_gprs *gprs, int attached);
+void ofono_gprs_detached_notify(struct ofono_gprs *gprs);
int ofono_gprs_driver_register(const struct ofono_gprs_driver *d);
void ofono_gprs_driver_unregister(const struct ofono_gprs_driver *d);
{ }
};
-void ofono_gprs_attach_notify(struct ofono_gprs *gprs, int attached)
+void ofono_gprs_detached_notify(struct ofono_gprs *gprs)
{
- if (gprs->driver_attached != attached &&
- !(gprs->flags & GPRS_FLAG_ATTACHING)) {
- gprs->driver_attached = attached;
+ if (gprs->driver_attached == FALSE)
+ return;
- gprs_netreg_update(gprs);
- }
+ gprs->driver_attached = FALSE;
+
+ gprs_attached_update(gprs);
+
+ /* TODO: The network forced a detach, we should wait for some time
+ * and try to re-attach
+ */
}
static void set_registration_status(struct ofono_gprs *gprs, int status)