core: merge MMPluginBase' and MMPlugin'

There's no real point in maintaining a separate `MMPlugin' interface, as all the
plugins will inherit from `MMPluginBase', so just merge them and simplify
everything.
This commit is contained in:
Aleksander Morgado
2012-07-10 11:15:23 +02:00
parent 7e9d3e4b68
commit e5e46f489e
33 changed files with 1350 additions and 1582 deletions

4
TODO
View File

@@ -91,10 +91,6 @@ example to update the signal quality value or check registration status.
- MMModem (instead of MMBaseModem), MMModemBroadband, MMModemPots - MMModem (instead of MMBaseModem), MMModemBroadband, MMModemPots
- MMBearer, MMBearerBroadband, MMBearerPots - MMBearer, MMBearerBroadband, MMBearerPots
** MMPlugin: do we really need a separate interface for the plugin? Why not
just assume that all plugins need to provide objects subclassing
MMPluginBase?
** Test cases for CIEV responses. ** Test cases for CIEV responses.
** When a modem gets initialized for the first time it goes into DISABLED, but ** When a modem gets initialized for the first time it goes into DISABLED, but

View File

@@ -99,8 +99,8 @@
launched as requested by the given plugin. launched as requested by the given plugin.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_VENDOR_IDS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -118,8 +118,8 @@
expected to work only with a given specific product of a given vendor. expected to work only with a given specific product of a given vendor.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_PRODUCT_IDS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -130,8 +130,8 @@
any port detected with a subsystem not listed by the plugin. any port detected with a subsystem not listed by the plugin.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_SUBSYSTEMS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -142,8 +142,8 @@
any port detected being managed by a driver not listed by the plugin. any port detected being managed by a driver not listed by the plugin.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_DRIVERS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_DRIVERS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -154,8 +154,8 @@
any port detected which doesn't expose any of the given tags. any port detected which doesn't expose any of the given tags.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_UDEV_TAGS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_UDEV_TAGS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -186,8 +186,8 @@
AT or not. AT or not.
</para> </para>
<para> <para>
This configuration is specified by the <type>MM_PLUGIN_BASE_CUSTOM_INIT</type> This configuration is specified by the <type>MM_PLUGIN_CUSTOM_INIT</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -198,8 +198,8 @@
AT serial ports. AT serial ports.
</para> </para>
<para> <para>
This configuration is specified by the <type>MM_PLUGIN_BASE_ALLOWED_AT</type> This configuration is specified by the <type>MM_PLUGIN_ALLOWED_AT</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -211,8 +211,8 @@
in ports of the same device will get cancelled. in ports of the same device will get cancelled.
</para> </para>
<para> <para>
This configuration is specified by the <type>MM_PLUGIN_BASE_ALLOWED_SINGLE_AT</type> This configuration is specified by the <type>MM_PLUGIN_ALLOWED_SINGLE_AT</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -223,8 +223,8 @@
QCDM serial ports. QCDM serial ports.
</para> </para>
<para> <para>
This configuration is specified by the <type>MM_PLUGIN_BASE_ALLOWED_QCDM</type> This configuration is specified by the <type>MM_PLUGIN_ALLOWED_QCDM</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -250,8 +250,8 @@
it can handle this modem. it can handle this modem.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_VENDOR_STRINGS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_VENDOR_STRINGS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -268,8 +268,8 @@
expected to work only with a given specific product of a given vendor. expected to work only with a given specific product of a given vendor.
</para> </para>
<para> <para>
This filter is specified by the <type>MM_PLUGIN_BASE_ALLOWED_PRODUCT_STRINGS</type> This filter is specified by the <type>MM_PLUGIN_ALLOWED_PRODUCT_STRINGS</type>
property in the <structname>MMPluginBase</structname> object provided property in the <structname>MMPlugin</structname> object provided
by the plugin. by the plugin.
</para> </para>
</listitem> </listitem>
@@ -304,15 +304,15 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_IRIDIUM, g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
MM_PLUGIN_BASE_NAME, "Example", MM_PLUGIN_NAME, "Example",
/* Next items are pre-probing filters */ /* Next items are pre-probing filters */
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS, product_ids, MM_PLUGIN_ALLOWED_PRODUCT_IDS, product_ids,
/* Next items are probing sequence setup */ /* Next items are probing sequence setup */
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
/* No post-probing filters */ /* No post-probing filters */
NULL)); NULL));
@@ -332,17 +332,17 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_IRIDIUM, g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
MM_PLUGIN_BASE_NAME, "Example", MM_PLUGIN_NAME, "Example",
/* Next items are pre-probing filters */ /* Next items are pre-probing filters */
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
/* Next items are probing sequence setup */ /* Next items are probing sequence setup */
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
/* Next items are post-probing filters */ /* Next items are post-probing filters */
MM_PLUGIN_BASE_VENDOR_STRINGS, vendor_strings, MM_PLUGIN_VENDOR_STRINGS, vendor_strings,
MM_PLUGIN_BASE_PRODUCT_STRINGS, product_strings, MM_PLUGIN_PRODUCT_STRINGS, product_strings,
NULL)); NULL));
} }
</programlisting> </programlisting>
@@ -381,15 +381,15 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_NOKIA, g_object_new (MM_TYPE_PLUGIN_NOKIA,
MM_PLUGIN_BASE_NAME, "Example", MM_PLUGIN_NAME, "Example",
/* Next items are pre-probing filters */ /* Next items are pre-probing filters */
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
/* Next items are probing sequence setup */ /* Next items are probing sequence setup */
MM_PLUGIN_BASE_CUSTOM_INIT, custom_init, MM_PLUGIN_CUSTOM_INIT, custom_init,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
/* No post-probing filters */ /* No post-probing filters */
NULL)); NULL));

View File

@@ -24,7 +24,7 @@
#include "mm-plugin-anydata.h" #include "mm-plugin-anydata.h"
#include "mm-broadband-modem-anydata.h" #include "mm-broadband-modem-anydata.h"
G_DEFINE_TYPE (MMPluginAnydata, mm_plugin_anydata, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginAnydata, mm_plugin_anydata, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -32,7 +32,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -42,13 +42,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_anydata_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_anydata_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -71,11 +71,11 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_ANYDATA, g_object_new (MM_TYPE_PLUGIN_ANYDATA,
MM_PLUGIN_BASE_NAME, "AnyDATA", MM_PLUGIN_NAME, "AnyDATA",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_BASE_ALLOWED_QCDM, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE,
NULL)); NULL));
} }
@@ -87,8 +87,8 @@ mm_plugin_anydata_init (MMPluginAnydata *self)
static void static void
mm_plugin_anydata_class_init (MMPluginAnydataClass *klass) mm_plugin_anydata_class_init (MMPluginAnydataClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -19,7 +19,7 @@
#ifndef MM_PLUGIN_ANYDATA_H #ifndef MM_PLUGIN_ANYDATA_H
#define MM_PLUGIN_ANYDATA_H #define MM_PLUGIN_ANYDATA_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_ANYDATA (mm_plugin_anydata_get_type ()) #define MM_TYPE_PLUGIN_ANYDATA (mm_plugin_anydata_get_type ())
#define MM_PLUGIN_ANYDATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydata)) #define MM_PLUGIN_ANYDATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydata))
@@ -29,11 +29,11 @@
#define MM_PLUGIN_ANYDATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydataClass)) #define MM_PLUGIN_ANYDATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydataClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginAnydata; } MMPluginAnydata;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginAnydataClass; } MMPluginAnydataClass;
GType mm_plugin_anydata_get_type (void); GType mm_plugin_anydata_get_type (void);

View File

@@ -30,13 +30,13 @@
#include "mm-broadband-modem-cinterion.h" #include "mm-broadband-modem-cinterion.h"
#include "mm-log.h" #include "mm-log.h"
G_DEFINE_TYPE (MMPluginCinterion, mm_plugin_cinterion, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginCinterion, mm_plugin_cinterion, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -46,13 +46,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_cinterion_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_cinterion_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -86,11 +86,11 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_CINTERION, g_object_new (MM_TYPE_PLUGIN_CINTERION,
MM_PLUGIN_BASE_NAME, "Cinterion", MM_PLUGIN_NAME, "Cinterion",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_STRINGS, vendor_strings, MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
NULL)); NULL));
} }
@@ -102,8 +102,8 @@ mm_plugin_cinterion_init (MMPluginCinterion *self)
static void static void
mm_plugin_cinterion_class_init (MMPluginCinterionClass *klass) mm_plugin_cinterion_class_init (MMPluginCinterionClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -23,7 +23,7 @@
#ifndef MM_PLUGIN_CINTERION_H #ifndef MM_PLUGIN_CINTERION_H
#define MM_PLUGIN_CINTERION_H #define MM_PLUGIN_CINTERION_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_CINTERION (mm_plugin_cinterion_get_type ()) #define MM_TYPE_PLUGIN_CINTERION (mm_plugin_cinterion_get_type ())
#define MM_PLUGIN_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterion)) #define MM_PLUGIN_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterion))
@@ -33,11 +33,11 @@
#define MM_PLUGIN_CINTERION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterionClass)) #define MM_PLUGIN_CINTERION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterionClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginCinterion; } MMPluginCinterion;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginCinterionClass; } MMPluginCinterionClass;
GType mm_plugin_cinterion_get_type (void); GType mm_plugin_cinterion_get_type (void);

View File

@@ -32,7 +32,7 @@
#include "mm-serial-parsers.h" #include "mm-serial-parsers.h"
#include "mm-log.h" #include "mm-log.h"
G_DEFINE_TYPE (MMPluginGeneric, mm_plugin_generic, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginGeneric, mm_plugin_generic, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -40,7 +40,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -50,13 +50,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -88,10 +88,10 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_GENERIC, g_object_new (MM_TYPE_PLUGIN_GENERIC,
MM_PLUGIN_BASE_NAME, MM_PLUGIN_GENERIC_NAME, MM_PLUGIN_NAME, MM_PLUGIN_GENERIC_NAME,
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_BASE_ALLOWED_QCDM, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE,
NULL)); NULL));
} }
@@ -103,8 +103,8 @@ mm_plugin_generic_init (MMPluginGeneric *self)
static void static void
mm_plugin_generic_class_init (MMPluginGenericClass *klass) mm_plugin_generic_class_init (MMPluginGenericClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -17,7 +17,6 @@
#define MM_PLUGIN_GENERIC_H #define MM_PLUGIN_GENERIC_H
#include "mm-plugin.h" #include "mm-plugin.h"
#include "mm-plugin-base.h"
#define MM_TYPE_PLUGIN_GENERIC (mm_plugin_generic_get_type ()) #define MM_TYPE_PLUGIN_GENERIC (mm_plugin_generic_get_type ())
#define MM_PLUGIN_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGeneric)) #define MM_PLUGIN_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGeneric))
@@ -27,11 +26,11 @@
#define MM_PLUGIN_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGenericClass)) #define MM_PLUGIN_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGenericClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginGeneric; } MMPluginGeneric;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginGenericClass; } MMPluginGenericClass;
GType mm_plugin_generic_get_type (void); GType mm_plugin_generic_get_type (void);

View File

@@ -22,7 +22,7 @@
#include "mm-plugin-gobi.h" #include "mm-plugin-gobi.h"
#include "mm-broadband-modem-gobi.h" #include "mm-broadband-modem-gobi.h"
G_DEFINE_TYPE (MMPluginGobi, mm_plugin_gobi, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginGobi, mm_plugin_gobi, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -30,7 +30,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -40,13 +40,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_gobi_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_gobi_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -78,11 +78,11 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_GOBI, g_object_new (MM_TYPE_PLUGIN_GOBI,
MM_PLUGIN_BASE_NAME, "Gobi", MM_PLUGIN_NAME, "Gobi",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_DRIVERS, drivers, MM_PLUGIN_ALLOWED_DRIVERS, drivers,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_BASE_ALLOWED_QCDM, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE,
NULL)); NULL));
} }
@@ -94,8 +94,8 @@ mm_plugin_gobi_init (MMPluginGobi *self)
static void static void
mm_plugin_gobi_class_init (MMPluginGobiClass *klass) mm_plugin_gobi_class_init (MMPluginGobiClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -17,7 +17,7 @@
#ifndef MM_PLUGIN_GOBI_H #ifndef MM_PLUGIN_GOBI_H
#define MM_PLUGIN_GOBI_H #define MM_PLUGIN_GOBI_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_GOBI (mm_plugin_gobi_get_type ()) #define MM_TYPE_PLUGIN_GOBI (mm_plugin_gobi_get_type ())
#define MM_PLUGIN_GOBI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GOBI, MMPluginGobi)) #define MM_PLUGIN_GOBI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GOBI, MMPluginGobi))
@@ -27,11 +27,11 @@
#define MM_PLUGIN_GOBI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GOBI, MMPluginGobiClass)) #define MM_PLUGIN_GOBI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GOBI, MMPluginGobiClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginGobi; } MMPluginGobi;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginGobiClass; } MMPluginGobiClass;
GType mm_plugin_gobi_get_type (void); GType mm_plugin_gobi_get_type (void);
@@ -39,4 +39,3 @@ GType mm_plugin_gobi_get_type (void);
G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); G_MODULE_EXPORT MMPlugin *mm_plugin_create (void);
#endif /* MM_PLUGIN_GOBI_H */ #endif /* MM_PLUGIN_GOBI_H */

View File

@@ -30,13 +30,13 @@
#include "mm-private-boxed-types.h" #include "mm-private-boxed-types.h"
#include "mm-log.h" #include "mm-log.h"
G_DEFINE_TYPE (MMPluginIridium, mm_plugin_iridium, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginIridium, mm_plugin_iridium, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -46,13 +46,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_iridium_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_iridium_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -88,12 +88,12 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_IRIDIUM, g_object_new (MM_TYPE_PLUGIN_IRIDIUM,
MM_PLUGIN_BASE_NAME, "Iridium", MM_PLUGIN_NAME, "Iridium",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_STRINGS, vendor_strings, MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings,
MM_PLUGIN_BASE_ALLOWED_PRODUCT_STRINGS, product_strings, MM_PLUGIN_ALLOWED_PRODUCT_STRINGS, product_strings,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
NULL)); NULL));
} }
@@ -105,8 +105,8 @@ mm_plugin_iridium_init (MMPluginIridium *self)
static void static void
mm_plugin_iridium_class_init (MMPluginIridiumClass *klass) mm_plugin_iridium_class_init (MMPluginIridiumClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -23,7 +23,7 @@
#ifndef MM_PLUGIN_IRIDIUM_H #ifndef MM_PLUGIN_IRIDIUM_H
#define MM_PLUGIN_IRIDIUM_H #define MM_PLUGIN_IRIDIUM_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_IRIDIUM (mm_plugin_iridium_get_type ()) #define MM_TYPE_PLUGIN_IRIDIUM (mm_plugin_iridium_get_type ())
#define MM_PLUGIN_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridium)) #define MM_PLUGIN_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridium))
@@ -33,11 +33,11 @@
#define MM_PLUGIN_IRIDIUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridiumClass)) #define MM_PLUGIN_IRIDIUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridiumClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginIridium; } MMPluginIridium;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginIridiumClass; } MMPluginIridiumClass;
GType mm_plugin_iridium_get_type (void); GType mm_plugin_iridium_get_type (void);

View File

@@ -22,7 +22,7 @@
#include "mm-plugin-linktop.h" #include "mm-plugin-linktop.h"
#include "mm-broadband-modem-linktop.h" #include "mm-broadband-modem-linktop.h"
G_DEFINE_TYPE (MMPluginLinktop, mm_plugin_linktop, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginLinktop, mm_plugin_linktop, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -30,7 +30,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -40,13 +40,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_linktop_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_linktop_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -90,10 +90,10 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_LINKTOP, g_object_new (MM_TYPE_PLUGIN_LINKTOP,
MM_PLUGIN_BASE_NAME, "Linktop", MM_PLUGIN_NAME, "Linktop",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
NULL)); NULL));
} }
@@ -105,8 +105,8 @@ mm_plugin_linktop_init (MMPluginLinktop *self)
static void static void
mm_plugin_linktop_class_init (MMPluginLinktopClass *klass) mm_plugin_linktop_class_init (MMPluginLinktopClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -18,7 +18,7 @@
#ifndef MM_PLUGIN_LINKTOP_H #ifndef MM_PLUGIN_LINKTOP_H
#define MM_PLUGIN_LINKTOP_H #define MM_PLUGIN_LINKTOP_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_LINKTOP (mm_plugin_linktop_get_type ()) #define MM_TYPE_PLUGIN_LINKTOP (mm_plugin_linktop_get_type ())
#define MM_PLUGIN_LINKTOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktop)) #define MM_PLUGIN_LINKTOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktop))
@@ -28,11 +28,11 @@
#define MM_PLUGIN_LINKTOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktopClass)) #define MM_PLUGIN_LINKTOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktopClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginLinktop; } MMPluginLinktop;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginLinktopClass; } MMPluginLinktopClass;
GType mm_plugin_linktop_get_type (void); GType mm_plugin_linktop_get_type (void);

View File

@@ -24,7 +24,7 @@
#include "mm-plugin-motorola.h" #include "mm-plugin-motorola.h"
#include "mm-broadband-modem-motorola.h" #include "mm-broadband-modem-motorola.h"
G_DEFINE_TYPE (MMPluginMotorola, mm_plugin_motorola, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginMotorola, mm_plugin_motorola, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -32,7 +32,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -42,13 +42,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_motorola_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_motorola_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -84,10 +84,10 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_MOTOROLA, g_object_new (MM_TYPE_PLUGIN_MOTOROLA,
MM_PLUGIN_BASE_NAME, "Motorola", MM_PLUGIN_NAME, "Motorola",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS, product_ids, MM_PLUGIN_ALLOWED_PRODUCT_IDS, product_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
NULL)); NULL));
} }
@@ -99,8 +99,8 @@ mm_plugin_motorola_init (MMPluginMotorola *self)
static void static void
mm_plugin_motorola_class_init (MMPluginMotorolaClass *klass) mm_plugin_motorola_class_init (MMPluginMotorolaClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -18,7 +18,7 @@
#ifndef MM_PLUGIN_MOTOROLA_H #ifndef MM_PLUGIN_MOTOROLA_H
#define MM_PLUGIN_MOTOROLA_H #define MM_PLUGIN_MOTOROLA_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_MOTOROLA (mm_plugin_motorola_get_type ()) #define MM_TYPE_PLUGIN_MOTOROLA (mm_plugin_motorola_get_type ())
#define MM_PLUGIN_MOTOROLA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorola)) #define MM_PLUGIN_MOTOROLA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorola))
@@ -28,11 +28,11 @@
#define MM_PLUGIN_MOTOROLA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorolaClass)) #define MM_PLUGIN_MOTOROLA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorolaClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginMotorola; } MMPluginMotorola;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginMotorolaClass; } MMPluginMotorolaClass;
GType mm_plugin_motorola_get_type (void); GType mm_plugin_motorola_get_type (void);

View File

@@ -24,7 +24,7 @@
#include "mm-plugin-nokia.h" #include "mm-plugin-nokia.h"
#include "mm-broadband-modem-nokia.h" #include "mm-broadband-modem-nokia.h"
G_DEFINE_TYPE (MMPluginNokia, mm_plugin_nokia, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginNokia, mm_plugin_nokia, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -42,7 +42,7 @@ static const MMPortProbeAtCommand custom_init[] = {
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -52,13 +52,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_nokia_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_nokia_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -101,11 +101,11 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_NOKIA, g_object_new (MM_TYPE_PLUGIN_NOKIA,
MM_PLUGIN_BASE_NAME, "Nokia", MM_PLUGIN_NAME, "Nokia",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_CUSTOM_INIT, custom_init, MM_PLUGIN_CUSTOM_INIT, custom_init,
MM_PLUGIN_BASE_ALLOWED_SINGLE_AT, TRUE, /* only 1 AT port expected! */ MM_PLUGIN_ALLOWED_SINGLE_AT, TRUE, /* only 1 AT port expected! */
NULL)); NULL));
} }
@@ -117,8 +117,8 @@ mm_plugin_nokia_init (MMPluginNokia *self)
static void static void
mm_plugin_nokia_class_init (MMPluginNokiaClass *klass) mm_plugin_nokia_class_init (MMPluginNokiaClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -17,7 +17,7 @@
#ifndef MM_PLUGIN_NOKIA_H #ifndef MM_PLUGIN_NOKIA_H
#define MM_PLUGIN_NOKIA_H #define MM_PLUGIN_NOKIA_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_NOKIA (mm_plugin_nokia_get_type ()) #define MM_TYPE_PLUGIN_NOKIA (mm_plugin_nokia_get_type ())
#define MM_PLUGIN_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokia)) #define MM_PLUGIN_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokia))
@@ -27,11 +27,11 @@
#define MM_PLUGIN_NOKIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokiaClass)) #define MM_PLUGIN_NOKIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokiaClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginNokia; } MMPluginNokia;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginNokiaClass; } MMPluginNokiaClass;
GType mm_plugin_nokia_get_type (void); GType mm_plugin_nokia_get_type (void);

View File

@@ -28,13 +28,13 @@
#include "mm-broadband-modem-novatel.h" #include "mm-broadband-modem-novatel.h"
#include "mm-log.h" #include "mm-log.h"
G_DEFINE_TYPE (MMPluginNovatel, mm_plugin_novatel, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginNovatel, mm_plugin_novatel, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -44,13 +44,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_novatel_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_novatel_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -81,10 +81,10 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_NOVATEL, g_object_new (MM_TYPE_PLUGIN_NOVATEL,
MM_PLUGIN_BASE_NAME, "Novatel", MM_PLUGIN_NAME, "Novatel",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS, products, MM_PLUGIN_ALLOWED_PRODUCT_IDS, products,
MM_PLUGIN_BASE_ALLOWED_SINGLE_AT, TRUE, MM_PLUGIN_ALLOWED_SINGLE_AT, TRUE,
NULL)); NULL));
} }
@@ -96,8 +96,8 @@ mm_plugin_novatel_init (MMPluginNovatel *self)
static void static void
mm_plugin_novatel_class_init (MMPluginNovatelClass *klass) mm_plugin_novatel_class_init (MMPluginNovatelClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -23,7 +23,7 @@
#ifndef MM_PLUGIN_NOVATEL_H #ifndef MM_PLUGIN_NOVATEL_H
#define MM_PLUGIN_NOVATEL_H #define MM_PLUGIN_NOVATEL_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_NOVATEL (mm_plugin_novatel_get_type ()) #define MM_TYPE_PLUGIN_NOVATEL (mm_plugin_novatel_get_type ())
#define MM_PLUGIN_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatel)) #define MM_PLUGIN_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatel))
@@ -33,11 +33,11 @@
#define MM_PLUGIN_NOVATEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatelClass)) #define MM_PLUGIN_NOVATEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatelClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginNovatel; } MMPluginNovatel;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginNovatelClass; } MMPluginNovatelClass;
GType mm_plugin_novatel_get_type (void); GType mm_plugin_novatel_get_type (void);

View File

@@ -25,7 +25,7 @@
#include "mm-broadband-modem-hso.h" #include "mm-broadband-modem-hso.h"
#include "mm-log.h" #include "mm-log.h"
G_DEFINE_TYPE (MMPluginHso, mm_plugin_hso, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginHso, mm_plugin_hso, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -33,7 +33,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -43,13 +43,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_hso_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_hso_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -134,11 +134,11 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_HSO, g_object_new (MM_TYPE_PLUGIN_HSO,
MM_PLUGIN_BASE_NAME, "Option High-Speed", MM_PLUGIN_NAME, "Option High-Speed",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_DRIVERS, drivers, MM_PLUGIN_ALLOWED_DRIVERS, drivers,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_BASE_ALLOWED_QCDM, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE,
NULL)); NULL));
} }
@@ -150,8 +150,8 @@ mm_plugin_hso_init (MMPluginHso *self)
static void static void
mm_plugin_hso_class_init (MMPluginHsoClass *klass) mm_plugin_hso_class_init (MMPluginHsoClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -18,7 +18,7 @@
#ifndef MM_PLUGIN_HSO_H #ifndef MM_PLUGIN_HSO_H
#define MM_PLUGIN_HSO_H #define MM_PLUGIN_HSO_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_HSO (mm_plugin_hso_get_type ()) #define MM_TYPE_PLUGIN_HSO (mm_plugin_hso_get_type ())
#define MM_PLUGIN_HSO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHso)) #define MM_PLUGIN_HSO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHso))
@@ -28,11 +28,11 @@
#define MM_PLUGIN_HSO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHsoClass)) #define MM_PLUGIN_HSO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHsoClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginHso; } MMPluginHso;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginHsoClass; } MMPluginHsoClass;
GType mm_plugin_hso_get_type (void); GType mm_plugin_hso_get_type (void);

View File

@@ -24,7 +24,7 @@
#include "mm-plugin-option.h" #include "mm-plugin-option.h"
#include "mm-broadband-modem-option.h" #include "mm-broadband-modem-option.h"
G_DEFINE_TYPE (MMPluginOption, mm_plugin_option, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginOption, mm_plugin_option, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -32,7 +32,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -42,13 +42,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_option_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_option_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -98,12 +98,12 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_OPTION, g_object_new (MM_TYPE_PLUGIN_OPTION,
MM_PLUGIN_BASE_NAME, "Option", MM_PLUGIN_NAME, "Option",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_DRIVERS, drivers, MM_PLUGIN_ALLOWED_DRIVERS, drivers,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS, product_ids, MM_PLUGIN_ALLOWED_PRODUCT_IDS, product_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
NULL)); NULL));
} }
@@ -115,8 +115,8 @@ mm_plugin_option_init (MMPluginOption *self)
static void static void
mm_plugin_option_class_init (MMPluginOptionClass *klass) mm_plugin_option_class_init (MMPluginOptionClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -18,7 +18,7 @@
#ifndef MM_PLUGIN_OPTION_H #ifndef MM_PLUGIN_OPTION_H
#define MM_PLUGIN_OPTION_H #define MM_PLUGIN_OPTION_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_OPTION (mm_plugin_option_get_type ()) #define MM_TYPE_PLUGIN_OPTION (mm_plugin_option_get_type ())
#define MM_PLUGIN_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOption)) #define MM_PLUGIN_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOption))
@@ -28,11 +28,11 @@
#define MM_PLUGIN_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOptionClass)) #define MM_PLUGIN_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOptionClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginOption; } MMPluginOption;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginOptionClass; } MMPluginOptionClass;
GType mm_plugin_option_get_type (void); GType mm_plugin_option_get_type (void);

View File

@@ -22,7 +22,7 @@
#include "mm-plugin-simtech.h" #include "mm-plugin-simtech.h"
#include "mm-broadband-modem-simtech.h" #include "mm-broadband-modem-simtech.h"
G_DEFINE_TYPE (MMPluginSimtech, mm_plugin_simtech, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginSimtech, mm_plugin_simtech, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -30,7 +30,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -40,13 +40,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_simtech_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_simtech_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -105,11 +105,11 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_SIMTECH, g_object_new (MM_TYPE_PLUGIN_SIMTECH,
MM_PLUGIN_BASE_NAME, "SimTech", MM_PLUGIN_NAME, "SimTech",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
MM_PLUGIN_BASE_ALLOWED_QCDM, TRUE, MM_PLUGIN_ALLOWED_QCDM, TRUE,
NULL)); NULL));
} }
@@ -121,8 +121,8 @@ mm_plugin_simtech_init (MMPluginSimtech *self)
static void static void
mm_plugin_simtech_class_init (MMPluginSimtechClass *klass) mm_plugin_simtech_class_init (MMPluginSimtechClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -18,7 +18,7 @@
#ifndef MM_PLUGIN_SIMTECH_H #ifndef MM_PLUGIN_SIMTECH_H
#define MM_PLUGIN_SIMTECH_H #define MM_PLUGIN_SIMTECH_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_SIMTECH (mm_plugin_simtech_get_type ()) #define MM_TYPE_PLUGIN_SIMTECH (mm_plugin_simtech_get_type ())
#define MM_PLUGIN_SIMTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtech)) #define MM_PLUGIN_SIMTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtech))
@@ -28,11 +28,11 @@
#define MM_PLUGIN_SIMTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtechClass)) #define MM_PLUGIN_SIMTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtechClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginSimtech; } MMPluginSimtech;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginSimtechClass; } MMPluginSimtechClass;
GType mm_plugin_simtech_get_type (void); GType mm_plugin_simtech_get_type (void);

View File

@@ -30,7 +30,7 @@
#include "mm-plugin-wavecom.h" #include "mm-plugin-wavecom.h"
#include "mm-broadband-modem-wavecom.h" #include "mm-broadband-modem-wavecom.h"
G_DEFINE_TYPE (MMPluginWavecom, mm_plugin_wavecom, MM_TYPE_PLUGIN_BASE) G_DEFINE_TYPE (MMPluginWavecom, mm_plugin_wavecom, MM_TYPE_PLUGIN)
int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION; int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION; int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
@@ -38,7 +38,7 @@ int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
/*****************************************************************************/ /*****************************************************************************/
static MMBaseModem * static MMBaseModem *
create_modem (MMPluginBase *plugin, create_modem (MMPlugin *self,
const gchar *sysfs_path, const gchar *sysfs_path,
const gchar *driver, const gchar *driver,
guint16 vendor, guint16 vendor,
@@ -48,13 +48,13 @@ create_modem (MMPluginBase *plugin,
{ {
return MM_BASE_MODEM (mm_broadband_modem_wavecom_new (sysfs_path, return MM_BASE_MODEM (mm_broadband_modem_wavecom_new (sysfs_path,
driver, driver,
mm_plugin_get_name (MM_PLUGIN (plugin)), mm_plugin_get_name (self),
vendor, vendor,
product)); product));
} }
static gboolean static gboolean
grab_port (MMPluginBase *base, grab_port (MMPlugin *self,
MMBaseModem *modem, MMBaseModem *modem,
MMPortProbe *probe, MMPortProbe *probe,
GError **error) GError **error)
@@ -86,10 +86,10 @@ mm_plugin_create (void)
return MM_PLUGIN ( return MM_PLUGIN (
g_object_new (MM_TYPE_PLUGIN_WAVECOM, g_object_new (MM_TYPE_PLUGIN_WAVECOM,
MM_PLUGIN_BASE_NAME, "Wavecom", MM_PLUGIN_NAME, "Wavecom",
MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS, subsystems, MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS, vendor_ids, MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
MM_PLUGIN_BASE_ALLOWED_AT, TRUE, MM_PLUGIN_ALLOWED_AT, TRUE,
NULL)); NULL));
} }
@@ -101,8 +101,8 @@ mm_plugin_wavecom_init (MMPluginWavecom *self)
static void static void
mm_plugin_wavecom_class_init (MMPluginWavecomClass *klass) mm_plugin_wavecom_class_init (MMPluginWavecomClass *klass)
{ {
MMPluginBaseClass *pb_class = MM_PLUGIN_BASE_CLASS (klass); MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
pb_class->create_modem = create_modem; plugin_class->create_modem = create_modem;
pb_class->grab_port = grab_port; plugin_class->grab_port = grab_port;
} }

View File

@@ -25,7 +25,7 @@
#ifndef MM_PLUGIN_WAVECOM_H #ifndef MM_PLUGIN_WAVECOM_H
#define MM_PLUGIN_WAVECOM_H #define MM_PLUGIN_WAVECOM_H
#include "mm-plugin-base.h" #include "mm-plugin.h"
#define MM_TYPE_PLUGIN_WAVECOM (mm_plugin_wavecom_get_type ()) #define MM_TYPE_PLUGIN_WAVECOM (mm_plugin_wavecom_get_type ())
#define MM_PLUGIN_WAVECOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecom)) #define MM_PLUGIN_WAVECOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecom))
@@ -35,11 +35,11 @@
#define MM_PLUGIN_WAVECOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecomClass)) #define MM_PLUGIN_WAVECOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecomClass))
typedef struct { typedef struct {
MMPluginBase parent; MMPlugin parent;
} MMPluginWavecom; } MMPluginWavecom;
typedef struct { typedef struct {
MMPluginBaseClass parent; MMPluginClass parent;
} MMPluginWavecomClass; } MMPluginWavecomClass;
GType mm_plugin_wavecom_get_type (void); GType mm_plugin_wavecom_get_type (void);

View File

@@ -197,9 +197,7 @@ ModemManager_SOURCES = \
mm-port-probe-cache.h \ mm-port-probe-cache.h \
mm-port-probe-cache.c \ mm-port-probe-cache.c \
mm-plugin.c \ mm-plugin.c \
mm-plugin.h \ mm-plugin.h
mm-plugin-base.c \
mm-plugin-base.h
# Additional dependency rules # Additional dependency rules
mm-bearer.c: mm-daemon-enums-types.h mm-bearer.c: mm-daemon-enums-types.h

File diff suppressed because it is too large Load Diff

View File

@@ -1,79 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details:
*
* Copyright (C) 2009 Red Hat, Inc.
*/
#ifndef MM_PLUGIN_BASE_H
#define MM_PLUGIN_BASE_H
#include <glib.h>
#include <glib-object.h>
#include <gudev/gudev.h>
#include "mm-plugin.h"
#include "mm-base-modem.h"
#include "mm-port.h"
#include "mm-port-probe.h"
#define MM_TYPE_PLUGIN_BASE (mm_plugin_base_get_type ())
#define MM_PLUGIN_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_BASE, MMPluginBase))
#define MM_PLUGIN_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_BASE, MMPluginBaseClass))
#define MM_IS_PLUGIN_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_BASE))
#define MM_IS_PLUBIN_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_BASE))
#define MM_PLUGIN_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_BASE, MMPluginBaseClass))
#define MM_PLUGIN_BASE_NAME "name"
#define MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS "allowed-subsystems"
#define MM_PLUGIN_BASE_ALLOWED_DRIVERS "allowed-drivers"
#define MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS "allowed-vendor-ids"
#define MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS "allowed-product-ids"
#define MM_PLUGIN_BASE_ALLOWED_VENDOR_STRINGS "allowed-vendor-strings"
#define MM_PLUGIN_BASE_ALLOWED_PRODUCT_STRINGS "allowed-product-strings"
#define MM_PLUGIN_BASE_ALLOWED_UDEV_TAGS "allowed-udev-tags"
#define MM_PLUGIN_BASE_ALLOWED_AT "allowed-at"
#define MM_PLUGIN_BASE_ALLOWED_SINGLE_AT "allowed-single-at"
#define MM_PLUGIN_BASE_ALLOWED_QCDM "allowed-qcdm"
#define MM_PLUGIN_BASE_CUSTOM_INIT "custom-init"
#define MM_PLUGIN_BASE_SEND_DELAY "send-delay"
#define MM_PLUGIN_BASE_SORT_LAST "sort-last"
typedef struct _MMPluginBase MMPluginBase;
typedef struct _MMPluginBaseClass MMPluginBaseClass;
struct _MMPluginBase {
GObject parent;
};
struct _MMPluginBaseClass {
GObjectClass parent;
/* Mandatory subclass functions */
MMBaseModem *(*create_modem) (MMPluginBase *plugin,
const gchar *sysfs_path,
const gchar *driver,
guint16 vendor,
guint16 product,
GList *probes,
GError **error);
gboolean (*grab_port) (MMPluginBase *plugin,
MMBaseModem *modem,
MMPortProbe *probe,
GError **error);
};
GType mm_plugin_base_get_type (void);
#endif /* MM_PLUGIN_BASE_H */

File diff suppressed because it is too large Load Diff

View File

@@ -11,30 +11,46 @@
* GNU General Public License for more details: * GNU General Public License for more details:
* *
* Copyright (C) 2008 Novell, Inc. * Copyright (C) 2008 Novell, Inc.
* Copyright (C) 2009 Red Hat, Inc. * Copyright (C) 2009 - 2012 Red Hat, Inc.
* Copyright (C) 2012 Google, Inc.
*/ */
#ifndef MM_PLUGIN_H #ifndef MM_PLUGIN_H
#define MM_PLUGIN_H #define MM_PLUGIN_H
#include <glib.h>
#include <glib-object.h> #include <glib-object.h>
#include <gio/gio.h> #include <gudev/gudev.h>
#include "mm-base-modem.h" #include "mm-base-modem.h"
#include "mm-port.h"
#include "mm-port-probe.h"
#define MM_PLUGIN_GENERIC_NAME "Generic" #define MM_PLUGIN_GENERIC_NAME "Generic"
#define MM_PLUGIN_MAJOR_VERSION 4 #define MM_PLUGIN_MAJOR_VERSION 4
#define MM_PLUGIN_MINOR_VERSION 0 #define MM_PLUGIN_MINOR_VERSION 0
#define MM_TYPE_PLUGIN (mm_plugin_get_type ()) #define MM_TYPE_PLUGIN (mm_plugin_get_type ())
#define MM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN, MMPlugin)) #define MM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN, MMPlugin))
#define MM_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN)) #define MM_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN, MMPluginClass))
#define MM_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_PLUGIN, MMPlugin)) #define MM_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN))
#define MM_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN))
#define MM_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN, MMPluginClass))
typedef struct _MMPlugin MMPlugin; #define MM_PLUGIN_NAME "name"
#define MM_PLUGIN_ALLOWED_SUBSYSTEMS "allowed-subsystems"
typedef MMPlugin *(*MMPluginCreateFunc) (void); #define MM_PLUGIN_ALLOWED_DRIVERS "allowed-drivers"
#define MM_PLUGIN_ALLOWED_VENDOR_IDS "allowed-vendor-ids"
#define MM_PLUGIN_ALLOWED_PRODUCT_IDS "allowed-product-ids"
#define MM_PLUGIN_ALLOWED_VENDOR_STRINGS "allowed-vendor-strings"
#define MM_PLUGIN_ALLOWED_PRODUCT_STRINGS "allowed-product-strings"
#define MM_PLUGIN_ALLOWED_UDEV_TAGS "allowed-udev-tags"
#define MM_PLUGIN_ALLOWED_AT "allowed-at"
#define MM_PLUGIN_ALLOWED_SINGLE_AT "allowed-single-at"
#define MM_PLUGIN_ALLOWED_QCDM "allowed-qcdm"
#define MM_PLUGIN_CUSTOM_INIT "custom-init"
#define MM_PLUGIN_SEND_DELAY "send-delay"
#define MM_PLUGIN_SORT_LAST "sort-last"
typedef enum { typedef enum {
MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED = 0x0, MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED = 0x0,
@@ -43,73 +59,56 @@ typedef enum {
MM_PLUGIN_SUPPORTS_PORT_SUPPORTED MM_PLUGIN_SUPPORTS_PORT_SUPPORTED
} MMPluginSupportsResult; } MMPluginSupportsResult;
typedef struct _MMPlugin MMPlugin;
typedef struct _MMPluginClass MMPluginClass;
typedef MMPlugin *(*MMPluginCreateFunc) (void);
struct _MMPlugin { struct _MMPlugin {
GTypeInterface g_iface; GObject parent;
};
/* Get plugin name */ struct _MMPluginClass {
const char *(*get_name) (MMPlugin *self); GObjectClass parent;
/* Returns TRUE if the plugin should be sorted last in the list of plugins /* Mandatory subclass functions */
* loaded. This is useful to indicate plugins that need an additional check
* on the probed vendor ID to see if they can support it. */
gboolean (*get_sort_last) (const MMPlugin *self);
/* Check whether a plugin supports a particular modem port, and what level /* Plugins need to provide a method to create a modem object given
* of support the plugin has for the device. * a list of port probes */
* The check is done always asynchronously. When the result of the check is MMBaseModem *(*create_modem) (MMPlugin *plugin,
* ready, the passed callback will be called, and the result will be ready const gchar *sysfs_path,
* to get retrieved with supports_port_finish(). const gchar *driver,
*/ guint16 vendor,
void (* supports_port) (MMPlugin *self, guint16 product,
const gchar *subsys, GList *probes,
const gchar *name, GError **error);
const gchar *physdev_path,
MMBaseModem *existing,
GAsyncReadyCallback callback,
gpointer user_data);
/* Allows to get the result of an asynchronous port support check. */ /* Plugins need to provide a method to grab independent ports
MMPluginSupportsResult (* supports_port_finish) (MMPlugin *self, * identified by port probes */
GAsyncResult *result, gboolean (*grab_port) (MMPlugin *plugin,
GError **error); MMBaseModem *modem,
MMPortProbe *probe,
/* Called to cancel an ongoing supports_port() operation or to notify the GError **error);
* plugin to clean up that operation. For example, if two plugins support
* a particular port, but the first plugin grabs the port, this method will
* be called on the second plugin to allow that plugin to clean up resources
* used while determining it's level of support for the port.
*/
void (*supports_port_cancel) (MMPlugin *self,
const char *subsys,
const char *name);
/* 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); GType mm_plugin_get_type (void);
const char *mm_plugin_get_name (MMPlugin *plugin); const char *mm_plugin_get_name (MMPlugin *plugin);
gboolean mm_plugin_get_sort_last (const MMPlugin *plugin);
gboolean mm_plugin_get_sort_last (const MMPlugin *plugin);
void mm_plugin_supports_port (MMPlugin *plugin,
const gchar *subsys,
const gchar *name,
const gchar *physdev_path,
MMBaseModem *existing,
GAsyncReadyCallback callback,
gpointer user_data);
void mm_plugin_supports_port (MMPlugin *plugin,
const gchar *subsys,
const gchar *name,
const gchar *physdev_path,
MMBaseModem *existing,
GAsyncReadyCallback callback,
gpointer user_data);
MMPluginSupportsResult mm_plugin_supports_port_finish (MMPlugin *plugin, MMPluginSupportsResult mm_plugin_supports_port_finish (MMPlugin *plugin,
GAsyncResult *result, GAsyncResult *result,
GError **error); GError **error);
void mm_plugin_supports_port_cancel (MMPlugin *plugin,
void mm_plugin_supports_port_cancel (MMPlugin *plugin, const char *subsys,
const char *subsys, const char *name);
const char *name);
MMBaseModem *mm_plugin_create_modem (MMPlugin *plugin, MMBaseModem *mm_plugin_create_modem (MMPlugin *plugin,
GList *ports, GList *ports,