aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-plugin-gobi.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-13 22:19:28 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:05 +0100
commit8b7b614105c784b391f818a2eb6462accd844a4e (patch)
tree7d517f9a322d7f9306a26dd7689f2734e208af3d /plugins/mm-plugin-gobi.c
parent0b39bf91ecde4d19d231e495bc9573a67869c3f2 (diff)
core: rework port grabbing and organization
Make port roles more flexible. We have modems that do PPP on interfaces other than the primary interface, and that wasn't possible with the old code. So clean up all that logic and move the port organization code into the core so we can reduce code in the plugins. In the new world order, the plugins say whether the port is a QCDM port, an AT port, or ignored. If it's an AT port the plugins get to tag it as primary, secondary, or PPP, or any combination of the 3. This allows for modems where PPP should really be done on the secondary port (Huawei E220, Sierra devices) so that the primary port stays open for command and status. After all ports are grabbed by the generic classes, they get "organized", which assigns various ports to the roles of PRIMARY, SECONDARY, DATA, and QCDM based on specific rules and hints that the plugin provided (which are expressed as MMAtPortFlags). The plugin code is responsible for determining the port hints (ie MMAtPortFlags) at probe time, instead of having a combination of the plugin and the modem class do the job. This simplifies things greatly for the plugins at the expense of more complicated logic in the core. This is the port of commit 96505d42ed62327101dcee7c2bf31177b0bb1c9f to the 06-api branch.
Diffstat (limited to 'plugins/mm-plugin-gobi.c')
-rw-r--r--plugins/mm-plugin-gobi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mm-plugin-gobi.c b/plugins/mm-plugin-gobi.c
index 89bc9243..eef27e9c 100644
--- a/plugins/mm-plugin-gobi.c
+++ b/plugins/mm-plugin-gobi.c
@@ -71,9 +71,9 @@ grab_port (MMPluginBase *base,
if (!mm_base_modem_grab_port (existing ? existing : modem,
subsys,
name,
- (mm_port_probe_is_qcdm (probe) ?
- MM_PORT_TYPE_QCDM :
- MM_PORT_TYPE_UNKNOWN))) {
+ mm_port_probe_get_port_type (probe),
+ MM_AT_PORT_FLAG_NONE,
+ error)) {
if (modem)
g_object_unref (modem);
return NULL;