diff options
author | Dan Williams <dcbw@redhat.com> | 2009-06-28 14:05:05 -0400 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2009-06-28 14:05:05 -0400 |
commit | 6077763d90b69cfc60b23f383c4529f966facaaf (patch) | |
tree | 81ae20133a6ea116d58ddc2ee86644f4e1c9eb0a /src/mm-plugin.c | |
parent | 112f2da19dbe8dcd8f32b998459298e7c1884c67 (diff) |
asynchronous and deferred port detection
Allow plugins to perform asynchronous port detection, and to defer port detection
until later. This moves the prober bits into MMPluginBase so that all plugins
can take adavantage of it only when needed; the probing is not done at udev time.
Furthermore, plugins like Novatel can flip the secondary ports over the AT mode
through deferred detection, by deferring the secondary ports until the main port
has been detected and AT$NWDMAT has been sent.
This commit also finishes the port of the rest of the plugins (except mbm) over
to the new port detection methods and plugin API.
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r-- | src/mm-plugin.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index c3425538..12df9dab 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -10,16 +10,31 @@ mm_plugin_get_name (MMPlugin *plugin) return MM_PLUGIN_GET_INTERFACE (plugin)->get_name (plugin); } -guint32 +MMPluginSupportsResult mm_plugin_supports_port (MMPlugin *plugin, const char *subsys, - const char *name) + const char *name, + MMSupportsPortResultFunc callback, + gpointer user_data) { 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); + g_return_val_if_fail (callback != NULL, FALSE); - return MM_PLUGIN_GET_INTERFACE (plugin)->supports_port (plugin, subsys, name); + return MM_PLUGIN_GET_INTERFACE (plugin)->supports_port (plugin, subsys, name, callback, user_data); +} + +void +mm_plugin_cancel_supports_port (MMPlugin *plugin, + const char *subsys, + const char *name) +{ + g_return_if_fail (MM_IS_PLUGIN (plugin)); + g_return_if_fail (subsys != NULL); + g_return_if_fail (name != NULL); + + MM_PLUGIN_GET_INTERFACE (plugin)->cancel_supports_port (plugin, subsys, name); } MMModem * |