diff options
Diffstat (limited to 'src/mm-generic-cdma.c')
-rw-r--r-- | src/mm-generic-cdma.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/mm-generic-cdma.c b/src/mm-generic-cdma.c index b708882b..d2c030f4 100644 --- a/src/mm-generic-cdma.c +++ b/src/mm-generic-cdma.c @@ -24,6 +24,7 @@ #include "mm-modem-cdma.h" #include "mm-modem-simple.h" #include "mm-at-serial-port.h" +#include "mm-qcdm-serial-port.h" #include "mm-errors.h" #include "mm-callback-info.h" #include "mm-serial-parsers.h" @@ -74,6 +75,7 @@ typedef struct { MMAtSerialPort *primary; MMAtSerialPort *secondary; + MMQcdmSerialPort *qcdm; MMPort *data; } MMGenericCdmaPrivate; @@ -169,9 +171,11 @@ mm_generic_cdma_grab_port (MMGenericCdma *self, check_valid (self); } else if (ptype == MM_PORT_TYPE_SECONDARY) priv->secondary = MM_AT_SERIAL_PORT (port); + } else if (MM_IS_QCDM_SERIAL_PORT (port) && !priv->qcdm) { + priv->qcdm = MM_QCDM_SERIAL_PORT (port); } else { /* Net device (if any) is the preferred data port */ - if (!priv->data || MM_IS_SERIAL_PORT (priv->data)) { + if (!priv->data || MM_IS_AT_SERIAL_PORT (priv->data)) { priv->data = port; g_object_notify (G_OBJECT (self), MM_MODEM_DATA_DEVICE); check_valid (self); @@ -202,7 +206,7 @@ release_port (MMModem *modem, const char *subsys, const char *name) if (!port) return; - if (port == MM_PORT (priv->primary)) { + if (port == (MMPort *) priv->primary) { mm_modem_base_remove_port (MM_MODEM_BASE (modem), port); priv->primary = NULL; } @@ -212,11 +216,16 @@ release_port (MMModem *modem, const char *subsys, const char *name) g_object_notify (G_OBJECT (modem), MM_MODEM_DATA_DEVICE); } - if (port == MM_PORT (priv->secondary)) { + if (port == (MMPort *) priv->secondary) { mm_modem_base_remove_port (MM_MODEM_BASE (modem), port); priv->secondary = NULL; } + if (port == (MMPort *) priv->qcdm) { + mm_modem_base_remove_port (MM_MODEM_BASE (modem), port); + priv->qcdm = NULL; + } + check_valid (MM_GENERIC_CDMA (modem)); } @@ -432,6 +441,14 @@ enable_all_done (MMModem *modem, GError *error, gpointer user_data) } } + /* Open up the second port, if one exists */ + if (priv->qcdm) { + if (!mm_serial_port_open (MM_SERIAL_PORT (priv->qcdm), &info->error)) { + g_assert (info->error); + goto out; + } + } + update_enabled_state (self, FALSE, MM_MODEM_STATE_REASON_NONE); /* Grab device info right away */ @@ -618,8 +635,11 @@ disable (MMModem *modem, GUINT_TO_POINTER (state), NULL); + /* Close auxiliary serial ports */ if (priv->secondary) mm_serial_port_close (MM_SERIAL_PORT (priv->secondary)); + if (priv->qcdm) + mm_serial_port_close (MM_SERIAL_PORT (priv->qcdm)); mm_modem_set_state (MM_MODEM (info->modem), MM_MODEM_STATE_DISABLING, |