diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-11 12:40:55 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:06:46 +0200 |
commit | 1ca46cc0ec2fd407f3c70dcac11279dec4cc61d8 (patch) | |
tree | 0fb2bd7770d8c8cb95182fde383bb45204568eec | |
parent | b64f52cddc9dc1f49f167d010a8150671d0dd44a (diff) |
plugins: use default port grabbing on those plugins without special requirements
-rw-r--r-- | plugins/anydata/mm-plugin-anydata.c | 15 | ||||
-rw-r--r-- | plugins/cinterion/mm-plugin-cinterion.c | 25 | ||||
-rw-r--r-- | plugins/generic/mm-plugin-generic.c | 25 | ||||
-rw-r--r-- | plugins/gobi/mm-plugin-gobi.c | 24 | ||||
-rw-r--r-- | plugins/iridium/mm-plugin-iridium.c | 24 | ||||
-rw-r--r-- | plugins/linktop/mm-plugin-linktop.c | 36 | ||||
-rw-r--r-- | plugins/motorola/mm-plugin-motorola.c | 24 | ||||
-rw-r--r-- | plugins/novatel/mm-plugin-novatel.c | 22 | ||||
-rw-r--r-- | plugins/wavecom/mm-plugin-wavecom.c | 24 |
9 files changed, 0 insertions, 219 deletions
diff --git a/plugins/anydata/mm-plugin-anydata.c b/plugins/anydata/mm-plugin-anydata.c index b0c3a897..acc3aa7c 100644 --- a/plugins/anydata/mm-plugin-anydata.c +++ b/plugins/anydata/mm-plugin-anydata.c @@ -47,20 +47,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_port_type (probe), - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -90,5 +76,4 @@ mm_plugin_anydata_class_init (MMPluginAnydataClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/cinterion/mm-plugin-cinterion.c b/plugins/cinterion/mm-plugin-cinterion.c index f596b690..a656bee4 100644 --- a/plugins/cinterion/mm-plugin-cinterion.c +++ b/plugins/cinterion/mm-plugin-cinterion.c @@ -51,30 +51,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - - /* The Cinterion plugin cannot do anything with non-AT ports */ - if (!mm_port_probe_is_at (probe)) { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT port"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - MM_PORT_TYPE_AT, /* we only allow AT ports here */ - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -105,5 +81,4 @@ mm_plugin_cinterion_class_init (MMPluginCinterionClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/generic/mm-plugin-generic.c b/plugins/generic/mm-plugin-generic.c index 6c89d653..66babea5 100644 --- a/plugins/generic/mm-plugin-generic.c +++ b/plugins/generic/mm-plugin-generic.c @@ -55,30 +55,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - /* The generic plugin cannot do anything with non-AT and non-QCDM ports */ - if (!mm_port_probe_is_at (probe) && - !mm_port_probe_is_qcdm (probe)) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT/non-QCDM ports"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_port_type (probe), - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -106,5 +82,4 @@ mm_plugin_generic_class_init (MMPluginGenericClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/gobi/mm-plugin-gobi.c b/plugins/gobi/mm-plugin-gobi.c index 8181e2af..377069e0 100644 --- a/plugins/gobi/mm-plugin-gobi.c +++ b/plugins/gobi/mm-plugin-gobi.c @@ -45,29 +45,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - /* The Gobi plugin only handles AT and QCDM ports (for now) */ - if (!mm_port_probe_is_at (probe) && !mm_port_probe_is_qcdm (probe)) { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT/non-QCDM port"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_port_type (probe), - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -97,5 +74,4 @@ mm_plugin_gobi_class_init (MMPluginGobiClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/iridium/mm-plugin-iridium.c b/plugins/iridium/mm-plugin-iridium.c index 76664fc9..229803cb 100644 --- a/plugins/iridium/mm-plugin-iridium.c +++ b/plugins/iridium/mm-plugin-iridium.c @@ -51,29 +51,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - /* The Iridium plugin cannot do anything with non-AT ports */ - if (!mm_port_probe_is_at (probe)) { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT port"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - MM_PORT_TYPE_AT, /* we only allow AT ports here */ - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -108,5 +85,4 @@ mm_plugin_iridium_class_init (MMPluginIridiumClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/linktop/mm-plugin-linktop.c b/plugins/linktop/mm-plugin-linktop.c index 7c8f3249..38e127ce 100644 --- a/plugins/linktop/mm-plugin-linktop.c +++ b/plugins/linktop/mm-plugin-linktop.c @@ -45,41 +45,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - GUdevDevice *port; - const gchar *devfile; - - /* The Linktop plugin cannot do anything with non-AT ports */ - if (!mm_port_probe_is_at (probe)) { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT port"); - return FALSE; - } - - port = mm_port_probe_peek_port (probe); - - /* TODO: Why do we check for device file? */ - devfile = g_udev_device_get_device_file (port); - if (!devfile) { - g_set_error (error, 0, 0, "Could not get port's sysfs file."); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - MM_PORT_TYPE_AT, /* we only allow AT ports here */ - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -108,5 +73,4 @@ mm_plugin_linktop_class_init (MMPluginLinktopClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/motorola/mm-plugin-motorola.c b/plugins/motorola/mm-plugin-motorola.c index fca75f92..176bc0a9 100644 --- a/plugins/motorola/mm-plugin-motorola.c +++ b/plugins/motorola/mm-plugin-motorola.c @@ -47,29 +47,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - /* The Motorola plugin cannot do anything with non-AT ports */ - if (!mm_port_probe_is_at (probe)) { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT port"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - MM_PORT_TYPE_AT, /* we only allow AT ports here */ - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -102,5 +79,4 @@ mm_plugin_motorola_class_init (MMPluginMotorolaClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/novatel/mm-plugin-novatel.c b/plugins/novatel/mm-plugin-novatel.c index e8c05726..ca156618 100644 --- a/plugins/novatel/mm-plugin-novatel.c +++ b/plugins/novatel/mm-plugin-novatel.c @@ -49,27 +49,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - /* The Novatel plugin uses AT and net ports */ - if (!mm_port_probe_is_at (probe) && - !g_str_equal (mm_port_probe_get_port_subsys (probe), "net")) { - g_set_error (error, 0, 0, "Ignoring non-AT/net port"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - mm_port_probe_get_port_type (probe), - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -99,5 +78,4 @@ mm_plugin_novatel_class_init (MMPluginNovatelClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } diff --git a/plugins/wavecom/mm-plugin-wavecom.c b/plugins/wavecom/mm-plugin-wavecom.c index f55ccad1..94fc43ec 100644 --- a/plugins/wavecom/mm-plugin-wavecom.c +++ b/plugins/wavecom/mm-plugin-wavecom.c @@ -53,29 +53,6 @@ create_modem (MMPlugin *self, product)); } -static gboolean -grab_port (MMPlugin *self, - MMBaseModem *modem, - MMPortProbe *probe, - GError **error) -{ - /* The Wavecom plugin cannot do anything with non-AT ports */ - if (!mm_port_probe_is_at (probe)) { - g_set_error_literal (error, - MM_CORE_ERROR, - MM_CORE_ERROR_UNSUPPORTED, - "Ignoring non-AT port"); - return FALSE; - } - - return mm_base_modem_grab_port (modem, - mm_port_probe_get_port_subsys (probe), - mm_port_probe_get_port_name (probe), - MM_PORT_TYPE_AT, /* we only allow AT ports here */ - MM_AT_PORT_FLAG_NONE, - error); -} - /*****************************************************************************/ G_MODULE_EXPORT MMPlugin * @@ -104,5 +81,4 @@ mm_plugin_wavecom_class_init (MMPluginWavecomClass *klass) MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass); plugin_class->create_modem = create_modem; - plugin_class->grab_port = grab_port; } |