From 6077763d90b69cfc60b23f383c4529f966facaaf Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 28 Jun 2009 14:05:05 -0400 Subject: 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. --- src/mm-plugin.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/mm-plugin.c') 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 * -- cgit v1.2.3-70-g09d2