static gboolean reconnect_rild(gpointer user_data) { struct ofono_modem *modem = (struct ofono_modem *) user_data; struct mtk_data *md = ofono_modem_get_data(modem); ofono_info("[slot %d] trying to reconnect", md->slot); if (create_gril(modem) < 0) return TRUE; /* Reconnected: do not call this again */ return FALSE; }
int ril_enable(struct ofono_modem *modem) { int ret; DBG(""); ret = create_gril(modem); if (ret < 0) g_timeout_add_seconds(RILD_CONNECT_RETRY_TIME_S, connect_rild, modem); return -EINPROGRESS; }
static int ril_enable(struct ofono_modem *modem) { int ret; DBG(""); ret = create_gril(modem); if (ret < 0) { DBG("create gril: %d, queue reconnect", ret); g_timeout_add_seconds(2, connect_rild, modem); } return -EINPROGRESS; }
static gboolean connect_rild(gpointer user_data) { struct ofono_modem *modem = (struct ofono_modem *) user_data; ofono_info("%s: Connecting %p to rild...", __func__, modem); if (create_gril(modem) < 0) { DBG("Connecting %p to rild failed, retry timer continues...", modem); return TRUE; } return FALSE; }
static gboolean connect_rild(gpointer user_data) { struct ofono_modem *modem = (struct ofono_modem *) user_data; struct ril_data *rd = ofono_modem_get_data(modem); ofono_info("Trying to reconnect to rild..."); if (rd->rild_connect_retries++ < RILD_MAX_CONNECT_RETRIES) { if (create_gril(modem) < 0) return TRUE; } else { ofono_error("Failed to connect to rild."); return TRUE; } return FALSE; }
static gboolean connect_rild(gpointer user_data) { struct ofono_modem *modem = (struct ofono_modem *) user_data; struct mtk_data *md = ofono_modem_get_data(modem); ofono_info("Trying to reconnect to slot %d...", md->slot); if (md->rild_connect_retries++ < RILD_MAX_CONNECT_RETRIES) { if (create_gril(modem) < 0) return TRUE; } else { ofono_error("Exiting, can't connect to rild."); exit(0); } return FALSE; }
static int mtk_enable(struct ofono_modem *modem) { int ret; /* We handle SIM states due to MTK peculiarities */ ofono_modem_set_driver_watches_sim(modem, TRUE); ret = create_gril(modem); if (ret < 0) g_timeout_add_seconds(RILD_CONNECT_RETRY_TIME_S, connect_rild, modem); /* * We will mark the modem as powered when we receive an event that * confirms that the radio is in a state different from unavailable */ return -EINPROGRESS; }