Discussion:
Stuck in modem driver enable
Mattias Månsson
2018-10-18 10:52:58 UTC
Permalink
We have implemented a driver for the Gemalto modem we are using and today I noticed that it got stuck in initialization (during enable). The problem is that the AT+CFUN=4 (which is the last step of our init) now returned a CME error. The error handling for this is inspired from all the other drivers:


static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
struct verimalto_data *data = ofono_modem_get_data(modem);

if (!ok) {
g_at_chat_unref(data->app);
data->app = NULL;

g_at_chat_unref(data->mdm);
data->mdm = NULL;

ofono_modem_set_powered(modem, FALSE);
return;
}

// Get initial SIM state
data->sim_state_query = at_util_sim_state_query_new(data->app,
2, 20, sim_state_cb, modem,
NULL);
}


This will put the modem in not powered state. The problem is that as it has not completed the initialization, there is now no interfaces at all set up. So we can not try to power it again or anything else. Are all these drivers having an issue with error handling or have I missed something else? And how could I handle it better?
Denis Kenzior
2018-10-18 22:48:01 UTC
Permalink
Hi Mattias,
Post by Mattias MÃ¥nsson
We have implemented a driver for the Gemalto modem we are using and
today I noticed that it got stuck in initialization (during enable). The
problem is that the AT+CFUN=4 (which is the last step of our init) now
returned a CME error. The error handling for this is inspired from all
static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
struct verimalto_data *data = ofono_modem_get_data(modem);
if (!ok) {
g_at_chat_unref(data->app);
data->app = NULL;
g_at_chat_unref(data->mdm);
data->mdm = NULL;
ofono_modem_set_powered(modem, FALSE);
return;
}
// Get initial SIM state
data->sim_state_query = at_util_sim_state_query_new(data->app,
2, 20, sim_state_cb, modem,
NULL);
}
This will put the modem in not powered state. The problem is that as it
has not completed the initialization, there is now no interfaces at all
What interfaces? DBus interfaces? You still have the Modem interface
present...
Post by Mattias MÃ¥nsson
set up. So we can not try to power it again or anything else. Are all
The above code does not actually trigger the removal of the Modem
itself. So that object is still present and you can still try to set
Powered to True. It might still fail the second time of course...
Post by Mattias MÃ¥nsson
these drivers having an issue with error handling or have I missed
something else? And how could I handle it better?
Not that I'm aware of. Is there perhaps something deeper happening here
than what you describe?

Regards,
-Denis

Loading...