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.h | |
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.h')
-rw-r--r-- | src/mm-plugin.h | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/mm-plugin.h b/src/mm-plugin.h index 71120112..d31be1e4 100644 --- a/src/mm-plugin.h +++ b/src/mm-plugin.h @@ -83,19 +83,10 @@ struct _MMPlugin { const char *subsys, const char *name); - /* Will only be called if the plugin returns a value greater than 0 for - * the supports_port() method for this port. The plugin should create and - * return a new modem for the port's device if there is no existing modem - * to handle the port's hardware device, or should add the port to an - * existing modem and return that modem object. If an error is encountered - * while claiming the port, the error information should be returned in the - * error argument, and the plugin should return NULL. - */ - MMBaseModem * (*grab_port) (MMPlugin *self, - const char *subsys, - const char *name, - MMBaseModem *existing, - GError **error); + /* Given all the list of ports, launch creation of a new modem object */ + MMBaseModem * (*create_modem) (MMPlugin *self, + GList *ports, + GError **error); }; GType mm_plugin_get_type (void); @@ -120,10 +111,8 @@ void mm_plugin_supports_port_cancel (MMPlugin *plugin, const char *subsys, const char *name); -MMBaseModem *mm_plugin_grab_port (MMPlugin *plugin, - const char *subsys, - const char *name, - MMBaseModem *existing, +MMBaseModem *mm_plugin_create_modem (MMPlugin *plugin, + GList *ports, GError **error); #endif /* MM_PLUGIN_H */ |