~ubuntu-branches/ubuntu/oneiric/modemmanager/oneiric

« back to all changes in this revision

Viewing changes to plugins/mm-modem-zte.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl, Thomas Bechtold, Mathieu Trudel-Lapierre
  • Date: 2011-05-04 13:17:33 UTC
  • mfrom: (1.1.10 upstream) (9.1.6 natty)
  • Revision ID: james.westby@ubuntu.com-20110504131733-4xn3f3il1cn3krc3
Tags: 0.4+git.20110429t103114.863dbca-1
[ Thomas Bechtold ]
* debian/rules, debian/control: migrate from CDBS to using dh

[ Mathieu Trudel-Lapierre ]
* upstream snapshot 2011-04-29 10:31:14 (GMT)
  + 863dbca63132b820fca6c48a9c212f852752ee16
* debian/README.source: add instructions for using this packaging branch and
  how to build from it; adapted from the NetworkManager package.
* debian/rules, debian/control: update control and rules to use dh-autoreconf
  rather than just autoreconf.
* debian/control: bump Standards-Version to 3.9.2.
* debian/rules: re-add DEB_* variables which got dropped from the dh
  migration, since we no longer include buildvars.mk.
* debian/patches/git-backport-e208c52-to-0c4b944.patch,
  debian/patches/git-backport-verbose-cmee-errors-7d20acc.patch: dropped,
  applied upstream.
* debian/control: bump debhelper Build-Depends to 8.
* debian/compat: bump to compat level 8, according to the debhelper update.
* debian/rules: cleanup extra files left behind by intltoolize.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#define MM_MODEM_ZTE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MM_TYPE_MODEM_ZTE, MMModemZtePrivate))
40
40
 
41
41
typedef struct {
 
42
    gboolean disposed;
42
43
    gboolean init_retried;
43
44
    guint32 cpms_tries;
44
45
    guint cpms_timeout;
45
46
    gboolean is_icera;
 
47
    MMModemIceraPrivate *icera;
46
48
} MMModemZtePrivate;
47
49
 
48
50
MMModem *
52
54
                  guint32 vendor,
53
55
                  guint32 product)
54
56
{
 
57
    MMModem *modem;
 
58
 
55
59
    g_return_val_if_fail (device != NULL, NULL);
56
60
    g_return_val_if_fail (driver != NULL, NULL);
57
61
    g_return_val_if_fail (plugin != NULL, NULL);
58
62
 
59
 
    return MM_MODEM (g_object_new (MM_TYPE_MODEM_ZTE,
60
 
                                   MM_MODEM_MASTER_DEVICE, device,
61
 
                                   MM_MODEM_DRIVER, driver,
62
 
                                   MM_MODEM_PLUGIN, plugin,
63
 
                                   MM_MODEM_HW_VID, vendor,
64
 
                                   MM_MODEM_HW_PID, product,
65
 
                                   NULL));
 
63
    modem = MM_MODEM (g_object_new (MM_TYPE_MODEM_ZTE,
 
64
                                    MM_MODEM_MASTER_DEVICE, device,
 
65
                                    MM_MODEM_DRIVER, driver,
 
66
                                    MM_MODEM_PLUGIN, plugin,
 
67
                                    MM_MODEM_HW_VID, vendor,
 
68
                                    MM_MODEM_HW_PID, product,
 
69
                                    NULL));
 
70
    if (modem)
 
71
        MM_MODEM_ZTE_GET_PRIVATE (modem)->icera = mm_modem_icera_init_private ();
 
72
 
 
73
    return modem;
66
74
}
67
75
 
68
76
/*****************************************************************************/
547
555
                MMModemFn callback,
548
556
                gpointer user_data)
549
557
{
550
 
    MMModemZtePrivate *priv = MM_MODEM_ZTE_GET_PRIVATE (simple);
 
558
    MMModemZte *self = MM_MODEM_ZTE (simple);
 
559
    MMModemZtePrivate *priv = MM_MODEM_ZTE_GET_PRIVATE (self);
551
560
    MMCallbackInfo *info = (MMCallbackInfo *) user_data;
552
561
    MMModemSimple *parent_iface;
553
562
 
554
563
    if (priv->is_icera)
555
 
        mm_modem_icera_simple_connect (MM_MODEM_ICERA (simple), properties);
 
564
        mm_modem_icera_simple_connect (MM_MODEM_ICERA (self), properties);
556
565
 
557
566
    parent_iface = g_type_interface_peek_parent (MM_MODEM_SIMPLE_GET_INTERFACE (simple));
558
567
    parent_iface->connect (MM_MODEM_SIMPLE (simple), properties, callback, info);
619
628
 
620
629
/*****************************************************************************/
621
630
 
 
631
static MMModemIceraPrivate *
 
632
get_icera_private (MMModemIcera *icera)
 
633
{
 
634
    return MM_MODEM_ZTE_GET_PRIVATE (icera)->icera;
 
635
}
 
636
 
 
637
/*****************************************************************************/
 
638
 
622
639
static void
623
640
modem_init (MMModem *modem_class)
624
641
{
629
646
}
630
647
 
631
648
static void
632
 
modem_icera_init (MMModemIcera *icera_class)
 
649
modem_icera_init (MMModemIcera *icera)
633
650
{
634
 
    mm_modem_icera_prepare (icera_class);
 
651
    icera->get_private = get_icera_private;
635
652
}
636
653
 
637
654
static void
651
668
    MMModemZte *self = MM_MODEM_ZTE (object);
652
669
    MMModemZtePrivate *priv = MM_MODEM_ZTE_GET_PRIVATE (self);
653
670
 
654
 
    if (priv->cpms_timeout)
655
 
        g_source_remove (priv->cpms_timeout);
656
 
 
657
 
    mm_modem_icera_cleanup (MM_MODEM_ICERA (self));
 
671
    if (priv->disposed == FALSE) {
 
672
        priv->disposed = TRUE;
 
673
 
 
674
        if (priv->cpms_timeout)
 
675
            g_source_remove (priv->cpms_timeout);
 
676
 
 
677
        mm_modem_icera_dispose_private (MM_MODEM_ICERA (self));
 
678
    }
658
679
 
659
680
    G_OBJECT_CLASS (mm_modem_zte_parent_class)->dispose (object);
660
681
}