diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-06-05 15:25:38 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:06:44 +0200 |
commit | 815693661c7f6a4225d271d2cec67e59bad8e070 (patch) | |
tree | 4bd354e4713a5eb11a95d50e56b6ed2e2afe30e3 /src/mm-plugin.c | |
parent | 4add521a98e59c9fbaaf30d965771ca01f748242 (diff) |
core: compile all ports before creating the modem object
Before this, we only exported the modem to DBus when all ports were organized,
in order to make sure that we select as primary port the one we really want and
not the first AT port grabbed. Given that to get all the ports organized we also
needed to wait to get all the ports grabbed, we can now also defer the creation
of the modem object until all the ports get grabbed. This allows us to create
different types of objects based on the ports available (e.g. we can now create
QMI-supported modem objects if we see a QMI port around).
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r-- | src/mm-plugin.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index 950efc4c..6418e295 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -84,17 +84,14 @@ mm_plugin_supports_port_cancel (MMPlugin *plugin, } MMBaseModem * -mm_plugin_grab_port (MMPlugin *plugin, - const char *subsys, - const char *name, - MMBaseModem *existing, - GError **error) +mm_plugin_create_modem (MMPlugin *plugin, + GList *ports, + GError **error) { - g_return_val_if_fail (MM_IS_PLUGIN (plugin), FALSE); - g_return_val_if_fail (subsys != NULL, FALSE); - g_return_val_if_fail (name != NULL, FALSE); + if (MM_PLUGIN_GET_INTERFACE (plugin)->create_modem) + return MM_PLUGIN_GET_INTERFACE (plugin)->create_modem (plugin, ports, error); - return MM_PLUGIN_GET_INTERFACE (plugin)->grab_port (plugin, subsys, name, existing, error); + return NULL; } /*****************************************************************************/ |