Re: [PATCH] adding support for mbm module



On Wed, Oct 15, 2008 at 7:17 PM, Per Hallsmark <per hallsmark t2data se> wrote:
> This is mostly a modemmanager patch, I guess the same maillist will be used
> for that one too?
> Made as a plugin.
>
> It adds support for mbm modules, like F3507g and others.

Thanks! All patches committed. I modified the formatting a bit and
removed some unused functions (mbm_enabled mbm_disabled
free_dns_array) to make everything complie without warnings. I also
added serial send delay argument to the modem class which we
determined was needed.

The 'SetApn' DBus method name typo is fixed now too (for the second
time, joys of maintaining stuff out of main tree). Sorry.

Tambet

>
> Patched against
>  svn://svn.gnome.org/svn/NetworkManager/trunk#4180 (after the modemmanager
> patch is applied)
>  svn://svn.gnome.org/svn/network-manager-applet/trunk#943 (after the
> modemmanager patch is applied)
>  modemmanager git commit ba166485e3eabe90807ea3c466a8df341e01744e
>
> It's been a bit of adventure to get the combination running... attached is a
> Makefile where I automate most of the things todo.
> Could perhaps be useful for others too.
>
> Best regards,
> Per
>
>
> diff --exclude-from=excludes -rupN
> orig/modemmanager/introspection/Makefile.am
> src/modemmanager/introspection/Makefile.am
> --- orig/modemmanager/introspection/Makefile.am 2008-10-15
> 17:56:04.000000000 +0200
> +++ src/modemmanager/introspection/Makefile.am  2008-10-15
> 10:32:07.000000000 +0200
> @@ -8,6 +8,7 @@ EXTRA_DIST = \
>        mm-modem-gsm-card.xml \
>        mm-modem-gsm-contacts.xml \
>        mm-modem-gsm-hso.xml \
> +       mm-modem-gsm-mbm.xml \
>        mm-modem-gsm-network.xml \
>        mm-modem-gsm-sms.xml \
>        mm-serial-error.xml
> diff --exclude-from=excludes -rupN
> orig/modemmanager/introspection/mm-modem-gsm-mbm.xml
> src/modemmanager/introspection/mm-modem-gsm-mbm.xml
> --- orig/modemmanager/introspection/mm-modem-gsm-mbm.xml        1970-01-01
> 01:00:00.000000000 +0100
> +++ src/modemmanager/introspection/mm-modem-gsm-mbm.xml 2008-10-15
> 13:49:55.000000000 +0200
> @@ -0,0 +1,12 @@
> +<?xml version="1.0" encoding="UTF-8" ?>
> +
> +<node name="/"
> xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0";>
> +  <interface name="org.freedesktop.ModemManager.Modem.Gsm.Mbm">
> +    <property name="NetworkDevice" type="s" access="read">
> +      <tp:docstring>
> +       The network device.
> +      </tp:docstring>
> +    </property>
> +
> +  </interface>
> +</node>
> diff --exclude-from=excludes -rupN orig/modemmanager/plugins/Makefile.am
> src/modemmanager/plugins/Makefile.am
> --- orig/modemmanager/plugins/Makefile.am       2008-10-15
> 17:56:04.000000000 +0200
> +++ src/modemmanager/plugins/Makefile.am        2008-10-15
> 10:45:38.000000000 +0200
> @@ -1,6 +1,7 @@
>  pkglib_LTLIBRARIES = \
>        libmm-plugin-huawei.la \
> -       libmm-plugin-hso.la
> +       libmm-plugin-hso.la \
> +       libmm-plugin-mbm.la
>
>  # Huawei
>
> @@ -34,7 +35,26 @@ libmm_plugin_hso_la_CPPFLAGS = \
>
>  libmm_plugin_hso_la_LDFLAGS = -module -avoid-version
>
> +# MBM
> +
> +libmm_plugin_mbm_la_SOURCES = \
> +       mm-modem-gsm-mbm-glue.h \
> +       mm-modem-mbm.c \
> +       mm-modem-mbm.h \
> +       mm-plugin-mbm.c \
> +       mm-plugin-mbm.h
> +
> +mm-modem-gsm-mbm-glue.h: $(top_srcdir)/introspection/mm-modem-gsm-mbm.xml
> +       dbus-binding-tool --prefix=mm_modem_gsm_mbm --mode=glib-server
> --output=$@ $<
> +
> +libmm_plugin_mbm_la_CPPFLAGS = \
> +       $(MM_CFLAGS) \
> +       -I$(top_srcdir)/src
> +
> +libmm_plugin_mbm_la_LDFLAGS = -module -avoid-version
> +
>  BUILT_SOURCES = \
> -       mm-modem-gsm-hso-glue.h
> +       mm-modem-gsm-hso-glue.h \
> +       mm-modem-gsm-mbm-glue.h
>
>  CLEANFILES = $(BUILT_SOURCES)
> diff --exclude-from=excludes -rupN orig/modemmanager/plugins/mm-modem-mbm.c
> src/modemmanager/plugins/mm-modem-mbm.c
> --- orig/modemmanager/plugins/mm-modem-mbm.c    1970-01-01
> 01:00:00.000000000 +0100
> +++ src/modemmanager/plugins/mm-modem-mbm.c     2008-10-15
> 13:13:55.000000000 +0200
> @@ -0,0 +1,298 @@
> +/*
> +    Additions to NetworkManager, network-manager-applet and modemmanager
> +    for supporting Ericsson modules like F3507g.
> +
> +    Author: Per Hallsmark <per hallsmark se>
> +
> +    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.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +*/
> +
> +#include <stdlib.h>
> +#include <string.h>
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <arpa/inet.h>
> +#include <dbus/dbus-glib.h>
> +#include "mm-modem-mbm.h"
> +#include "mm-serial.h"
> +#include "mm-errors.h"
> +#include "mm-callback-info.h"
> +
> +#include "mm-modem-gsm-mbm-glue.h"
> +
> +static gpointer mm_modem_mbm_parent_class = NULL;
> +
> +#define MM_MODEM_MBM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
> MM_TYPE_MODEM_MBM, MMModemMbmPrivate))
> +
> +typedef struct {
> +    char *network_device;
> +} MMModemMbmPrivate;
> +
> +enum {
> +    PROP_0,
> +    PROP_NETWORK_DEVICE,
> +
> +    LAST_PROP
> +};
> +
> +MMModem *
> +mm_modem_mbm_new (const char *serial_device,
> +                  const char *network_device,
> +                  const char *driver)
> +{
> +    g_return_val_if_fail (serial_device != NULL, NULL);
> +    g_return_val_if_fail (network_device != NULL, NULL);
> +    g_return_val_if_fail (driver != NULL, NULL);
> +
> +    return MM_MODEM (g_object_new (MM_TYPE_MODEM_MBM,
> +                                   MM_SERIAL_DEVICE, serial_device,
> +                                   MM_MODEM_DRIVER, driver,
> +                                   MM_MODEM_MBM_NETWORK_DEVICE,
> network_device,
> +                                   NULL));
> +}
> +
> +static void
> +mbm_enable_done (MMSerial *serial,
> +                 GString *response,
> +                 GError *error,
> +                 gpointer user_data)
> +{
> +    MMCallbackInfo *info = (MMCallbackInfo *) user_data;
> +
> +    if (error)
> +        info->error = g_error_copy (error);
> +
> +    mm_callback_info_schedule (info);
> +}
> +
> +static void
> +mbm_enable (MMModemMbm *self,
> +            gboolean enabled,
> +            MMModemFn callback,
> +            gpointer user_data)
> +{
> +    MMCallbackInfo *info;
> +    char *command;
> +
> +    info = mm_callback_info_new (MM_MODEM (self), callback, user_data);
> +
> +    command = g_strdup_printf ("AT*ENAP=%d,%d", enabled ? 1 : 0,
> +                               mm_generic_gsm_get_cid (MM_GENERIC_GSM
> (self)));
> +
> +    mm_serial_queue_command (MM_SERIAL (self), command, 3, mbm_enable_done,
> info);
> +    g_free (command);
> +}
> +
> +static void
> +mbm_enabled (MMModem *modem,
> +             GError *error,
> +             gpointer user_data)
> +{
> +    MMCallbackInfo *info = (MMCallbackInfo *) user_data;
> +
> +    if (error)
> +        info->error = g_error_copy (error);
> +
> +    mm_callback_info_schedule (info);
> +}
> +
> +static void
> +mbm_disabled (MMModem *modem,
> +              GError *error,
> +              gpointer user_data)
> +{
> +    MMCallbackInfo *info = (MMCallbackInfo *) user_data;
> +
> +    if (error) {
> +        info->error = g_error_copy (error);
> +        mm_callback_info_schedule (info);
> +    } else
> +        mbm_enable (MM_MODEM_MBM (modem), TRUE, mbm_enabled, info);
> +}
> +
> +static void
> +free_dns_array (gpointer data)
> +{
> +    g_array_free ((GArray *) data, TRUE);
> +}
> +
> +/*****************************************************************************/
> +
> +static void
> +modem_enable_done (MMModem *modem, GError *error, gpointer user_data)
> +{
> +    MMCallbackInfo *info = (MMCallbackInfo *) user_data;
> +    MMModem *parent_modem_iface;
> +
> +    parent_modem_iface = g_type_interface_peek_parent
> (MM_MODEM_GET_INTERFACE (modem));
> +    parent_modem_iface->enable (modem,
> +                                GPOINTER_TO_INT (mm_callback_info_get_data
> (info, "enable")),
> +                                (MMModemFn) mm_callback_info_get_data
> (info, "callback"),
> +                                mm_callback_info_get_data (info,
> "user-data"));
> +}
> +
> +static void
> +enable (MMModem *modem,
> +        gboolean enable,
> +        MMModemFn callback,
> +        gpointer user_data)
> +{
> +    MMCallbackInfo *info;
> +
> +    info = mm_callback_info_new (modem, modem_enable_done, NULL);
> +    info->user_data = info;
> +    mm_callback_info_set_data (info, "enable", GINT_TO_POINTER (enable),
> NULL);
> +    mm_callback_info_set_data (info, "callback", callback, NULL);
> +    mm_callback_info_set_data (info, "user-data", user_data, NULL);
> +
> +    if (enable)
> +        mm_callback_info_schedule (info);
> +    else
> +        mbm_enable (MM_MODEM_MBM (modem), FALSE, modem_enable_done, info);
> +}
> +
> +/*****************************************************************************/
> +
> +static void
> +mm_modem_mbm_init (MMModemMbm *self)
> +{
> +}
> +
> +static void
> +modem_init (MMModem *modem_class)
> +{
> +    modem_class->enable = enable;
> +}
> +
> +static GObject*
> +constructor (GType type,
> +             guint n_construct_params,
> +             GObjectConstructParam *construct_params)
> +{
> +    GObject *object;
> +    MMModemMbmPrivate *priv;
> +
> +    object = G_OBJECT_CLASS (mm_modem_mbm_parent_class)->constructor (type,
> +
>  n_construct_params,
> +
>  construct_params);
> +    if (!object)
> +        return NULL;
> +
> +    priv = MM_MODEM_MBM_GET_PRIVATE (object);
> +
> +    if (!priv->network_device) {
> +        g_warning ("No network device provided");
> +        g_object_unref (object);
> +        return NULL;
> +    }
> +
> +    return object;
> +}
> +
> +static void
> +set_property (GObject *object, guint prop_id,
> +              const GValue *value, GParamSpec *pspec)
> +{
> +    MMModemMbmPrivate *priv = MM_MODEM_MBM_GET_PRIVATE (object);
> +
> +    switch (prop_id) {
> +    case PROP_NETWORK_DEVICE:
> +        /* Construct only */
> +        priv->network_device = g_value_dup_string (value);
> +        break;
> +    default:
> +        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
> +        break;
> +    }
> +}
> +
> +static void
> +get_property (GObject *object, guint prop_id,
> +              GValue *value, GParamSpec *pspec)
> +{
> +    MMModemMbmPrivate *priv = MM_MODEM_MBM_GET_PRIVATE (object);
> +
> +    switch (prop_id) {
> +    case PROP_NETWORK_DEVICE:
> +        g_value_set_string (value, priv->network_device);
> +        break;
> +    default:
> +        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
> +        break;
> +    }
> +}
> +static void
> +finalize (GObject *object)
> +{
> +    MMModemMbmPrivate *priv = MM_MODEM_MBM_GET_PRIVATE (object);
> +
> +    g_free (priv->network_device);
> +
> +    G_OBJECT_CLASS (mm_modem_mbm_parent_class)->finalize (object);
> +}
> +
> +static void
> +mm_modem_mbm_class_init (MMModemMbmClass *klass)
> +{
> +    GObjectClass *object_class = G_OBJECT_CLASS (klass);
> +
> +    mm_modem_mbm_parent_class = g_type_class_peek_parent (klass);
> +    g_type_class_add_private (object_class, sizeof (MMModemMbmPrivate));
> +
> +    /* Virtual methods */
> +    object_class->constructor = constructor;
> +    object_class->set_property = set_property;
> +    object_class->get_property = get_property;
> +    object_class->finalize = finalize;
> +    /* Properties */
> +    g_object_class_install_property
> +        (object_class, PROP_NETWORK_DEVICE,
> +         g_param_spec_string (MM_MODEM_MBM_NETWORK_DEVICE,
> +                              "NetworkDevice",
> +                              "Network device",
> +                              NULL,
> +                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
> +}
> +
> +GType
> +mm_modem_mbm_get_type (void)
> +{
> +    static GType modem_mbm_type = 0;
> +
> +    if (G_UNLIKELY (modem_mbm_type == 0)) {
> +        static const GTypeInfo modem_mbm_type_info = {
> +            sizeof (MMModemMbmClass),
> +            (GBaseInitFunc) NULL,
> +            (GBaseFinalizeFunc) NULL,
> +            (GClassInitFunc) mm_modem_mbm_class_init,
> +            (GClassFinalizeFunc) NULL,
> +            NULL,   /* class_data */
> +            sizeof (MMModemMbm),
> +            0,      /* n_preallocs */
> +            (GInstanceInitFunc) mm_modem_mbm_init,
> +        };
> +
> +        static const GInterfaceInfo modem_iface_info = {
> +            (GInterfaceInitFunc) modem_init
> +        };
> +
> +        modem_mbm_type = g_type_register_static (MM_TYPE_GENERIC_GSM,
> "MMModemMbm", &modem_mbm_type_info, 0);
> +        g_type_add_interface_static (modem_mbm_type, MM_TYPE_MODEM,
> &modem_iface_info);
> +    }
> +
> +    return modem_mbm_type;
> +}
> diff --exclude-from=excludes -rupN orig/modemmanager/plugins/mm-modem-mbm.h
> src/modemmanager/plugins/mm-modem-mbm.h
> --- orig/modemmanager/plugins/mm-modem-mbm.h    1970-01-01
> 01:00:00.000000000 +0100
> +++ src/modemmanager/plugins/mm-modem-mbm.h     2008-10-15
> 13:14:08.000000000 +0200
> @@ -0,0 +1,70 @@
> +/*
> +    Additions to NetworkManager, network-manager-applet and modemmanager
> +    for supporting Ericsson modules like F3507g.
> +
> +    Author: Per Hallsmark <per hallsmark se>
> +
> +    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.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +*/
> +
> +#ifndef MM_MODEM_MBM_H
> +#define MM_MODEM_MBM_H
> +
> +#include "mm-generic-gsm.h"
> +
> +#define MM_TYPE_MODEM_MBM                      (mm_modem_mbm_get_type ())
> +#define MM_MODEM_MBM(obj)                      (G_TYPE_CHECK_INSTANCE_CAST
> ((obj), MM_TYPE_MODEM_MBM, MMModemMbm))
> +#define MM_MODEM_MBM_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass),
>  MM_TYPE_MODEM_MBM, MMModemMbmClass))
> +#define MM_IS_MODEM_MBM(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
> MM_TYPE_MODEM_MBM))
> +#define MM_IS_MODEM_MBM_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass),
>  MM_TYPE_MODEM_MBM))
> +#define MM_MODEM_MBM_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj),
>  MM_TYPE_MODEM_MBM, MMModemMbmClass))
> +
> +#define MM_MODEM_MBM_NETWORK_DEVICE "network-device"
> +
> +typedef struct {
> +    MMGenericGsm parent;
> +} MMModemMbm;
> +
> +typedef struct {
> +    MMGenericGsmClass parent;
> +} MMModemMbmClass;
> +
> +typedef void (*MMModemMbmIp4Fn) (MMModemMbm *modem,
> +                                 guint32 address,
> +                                 GArray *dns,
> +                                 GError *error,
> +                                 gpointer user_data);
> +
> +
> +GType mm_modem_mbm_get_type (void);
> +
> +MMModem *mm_modem_mbm_new (const char *serial_device,
> +                           const char *network_device,
> +                           const char *driver);
> +
> +void mm_mbm_modem_authenticate (MMModemMbm *self,
> +                                const char *username,
> +                                const char *password,
> +                                MMModemFn callback,
> +                                gpointer user_data);
> +
> +void mm_mbm_modem_get_ip4_config (MMModemMbm *self,
> +                                  MMModemMbmIp4Fn callback,
> +                                  gpointer user_data);
> +
> +
> +#endif /* MM_MODEM_MBM_H */
> diff --exclude-from=excludes -rupN orig/modemmanager/plugins/mm-plugin-mbm.c
> src/modemmanager/plugins/mm-plugin-mbm.c
> --- orig/modemmanager/plugins/mm-plugin-mbm.c   1970-01-01
> 01:00:00.000000000 +0100
> +++ src/modemmanager/plugins/mm-plugin-mbm.c    2008-10-15
> 16:11:12.000000000 +0200
> @@ -0,0 +1,244 @@
> +/*
> +    Additions to NetworkManager, network-manager-applet and modemmanager
> +    for supporting Ericsson modules like F3507g.
> +
> +    Author: Per Hallsmark <per hallsmark se>
> +
> +    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.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +*/
> +
> +#include <string.h>
> +#include <gmodule.h>
> +#include "mm-plugin-mbm.h"
> +#include "mm-modem-mbm.h"
> +
> +static void plugin_init (MMPlugin *plugin_class);
> +
> +G_DEFINE_TYPE_EXTENDED (MMPluginMbm, mm_plugin_mbm, G_TYPE_OBJECT,
> +                        0, G_IMPLEMENT_INTERFACE (MM_TYPE_PLUGIN,
> plugin_init))
> +
> +int mm_plugin_major_version = MM_PLUGIN_MAJOR_VERSION;
> +int mm_plugin_minor_version = MM_PLUGIN_MINOR_VERSION;
> +
> +G_MODULE_EXPORT MMPlugin *
> +mm_plugin_create (void)
> +{
> +    return MM_PLUGIN (g_object_new (MM_TYPE_PLUGIN_MBM, NULL));
> +}
> +
> +/*****************************************************************************/
> +
> +static const char *
> +get_name (MMPlugin *plugin)
> +{
> +    return "MBM";
> +}
> +
> +static char **
> +list_supported_udis (MMPlugin *plugin, LibHalContext *hal_ctx)
> +{
> +    char **supported = NULL;
> +    char **devices;
> +    int num_devices;
> +    int i;
> +
> +    devices = libhal_find_device_by_capability (hal_ctx, "modem",
> &num_devices, NULL);
> +    if (devices) {
> +        GPtrArray *array;
> +
> +        array = g_ptr_array_new ();
> +
> +        for (i = 0; i < num_devices; i++) {
> +            char *udi = devices[i];
> +
> +            if (mm_plugin_supports_udi (plugin, hal_ctx, udi))
> +                g_ptr_array_add (array, g_strdup (udi));
> +        }
> +
> +        if (array->len > 0) {
> +            g_ptr_array_add (array, NULL);
> +            supported = (char **) g_ptr_array_free (array, FALSE);
> +        } else
> +            g_ptr_array_free (array, TRUE);
> +    }
> +
> +    g_strfreev (devices);
> +
> +    return supported;
> +}
> +
> +static char *
> +get_netdev (LibHalContext *ctx, const char *udi)
> +{
> +       char *serial_parent, *serial_parent_parent, *netdev = NULL;
> +       char **netdevs;
> +       int num, i;
> +
> +       /* Get the origin udi, which is parent of our parent */
> +       serial_parent = libhal_device_get_property_string (ctx, udi,
> "info.parent", NULL);
> +       if (!serial_parent)
> +               return NULL;
> +       /* Just attach to first cdc-acm interface */
> +       if (strncmp(serial_parent+strlen(serial_parent)-4, "_if1", 4))
> +               return NULL;
> +       serial_parent_parent = libhal_device_get_property_string (ctx,
> serial_parent, "info.parent", NULL);
> +       if (!serial_parent_parent)
> +               return NULL;
> +
> +       /* Look for the originating device's netdev */
> +       netdevs = libhal_find_device_by_capability (ctx, "net", &num, NULL);
> +       for (i = 0; netdevs && !netdev && (i < num); i++) {
> +               char *netdev_parent, *netdev_parent_parent, *tmp;
> +
> +               /* Get the origin udi, which also is parent of our parent */
> +               netdev_parent = libhal_device_get_property_string (ctx,
> netdevs[i], "info.parent", NULL);
> +               if (!netdev_parent)
> +                       continue;
> +               netdev_parent_parent = libhal_device_get_property_string
> (ctx, netdev_parent, "info.parent", NULL);
> +               if (!netdev_parent_parent)
> +                       continue;
> +
> +               if (!strcmp (netdev_parent_parent, serial_parent_parent)) {
> +                       /* We found it */
> +                       tmp = libhal_device_get_property_string (ctx,
> netdevs[i], "net.interface", NULL);
> +                       if (tmp) {
> +                               netdev = g_strdup (tmp);
> +                               libhal_free_string (tmp);
> +                       }
> +               }
> +
> +               libhal_free_string (netdev_parent);
> +               libhal_free_string (netdev_parent_parent);
> +       }
> +       libhal_free_string_array (netdevs);
> +       libhal_free_string (serial_parent);
> +       libhal_free_string (serial_parent_parent);
> +
> +       return netdev;
> +}
> +
> +static char *
> +get_driver (LibHalContext *ctx, const char *udi)
> +{
> +       char *serial_parent, *serial_parent_parent, *driver = NULL;
> +       char **netdevs;
> +       int num, i;
> +
> +
> +       /* Get the origin udi, which is parent of our parent */
> +       serial_parent = libhal_device_get_property_string (ctx, udi,
> "info.parent", NULL);
> +       if (!serial_parent)
> +               return NULL;
> +       serial_parent_parent = libhal_device_get_property_string (ctx,
> serial_parent, "info.parent", NULL);
> +       if (!serial_parent_parent)
> +               return NULL;
> +
> +       /* Look for the originating device's netdev */
> +       netdevs = libhal_find_device_by_capability (ctx, "net", &num, NULL);
> +       for (i = 0; netdevs && !driver && (i < num); i++) {
> +               char *netdev_parent, *netdev_parent_parent, *tmp;
> +
> +               /* Get the origin udi, which also is parent of our parent */
> +               netdev_parent = libhal_device_get_property_string (ctx,
> netdevs[i], "info.parent", NULL);
> +               if (!netdev_parent)
> +                       continue;
> +               netdev_parent_parent = libhal_device_get_property_string
> (ctx, netdev_parent, "info.parent", NULL);
> +               if (!netdev_parent_parent)
> +                       continue;
> +
> +               if (!strcmp (netdev_parent_parent, serial_parent_parent)) {
> +                       /* We found it */
> +                       tmp = libhal_device_get_property_string (ctx,
> +                               netdev_parent, "info.linux.driver", NULL);
> +                       if (tmp) {
> +                               driver = g_strdup (tmp);
> +                               libhal_free_string (tmp);
> +                       }
> +               }
> +
> +               libhal_free_string (netdev_parent);
> +               libhal_free_string (netdev_parent_parent);
> +       }
> +       libhal_free_string_array (netdevs);
> +       libhal_free_string (serial_parent);
> +       libhal_free_string (serial_parent_parent);
> +
> +       return driver;
> +}
> +
> +static gboolean
> +supports_udi (MMPlugin *plugin, LibHalContext *hal_ctx, const char *udi)
> +{
> +       gboolean supported = FALSE;
> +       char *netdev = NULL;
> +
> +       netdev = get_netdev(hal_ctx, udi);
> +
> +       if (netdev) {
> +               supported = TRUE;
> +               libhal_free_string (netdev);
> +       }
> +
> +       return supported;
> +}
> +
> +static MMModem *
> +create_modem (MMPlugin *plugin, LibHalContext *hal_ctx, const char *udi)
> +{
> +    char *serial_device;
> +    char *net_device;
> +    char *driver;
> +    MMModem *modem;
> +
> +    serial_device = libhal_device_get_property_string (hal_ctx, udi,
> "serial.device", NULL);
> +    g_return_val_if_fail (serial_device != NULL, NULL);
> +
> +    net_device = get_netdev (hal_ctx, udi);
> +    g_return_val_if_fail (net_device != NULL, NULL);
> +
> +    driver = get_driver(hal_ctx, udi);
> +    g_return_val_if_fail (driver != NULL, NULL);
> +
> +    modem = MM_MODEM (mm_modem_mbm_new (serial_device, net_device,
> driver));
> +
> +    g_free (serial_device);
> +    g_free (net_device);
> +
> +    return modem;
> +}
> +
> +/*****************************************************************************/
> +
> +static void
> +plugin_init (MMPlugin *plugin_class)
> +{
> +    /* interface implementation */
> +    plugin_class->get_name = get_name;
> +    plugin_class->list_supported_udis = list_supported_udis;
> +    plugin_class->supports_udi = supports_udi;
> +    plugin_class->create_modem = create_modem;
> +}
> +
> +static void
> +mm_plugin_mbm_init (MMPluginMbm *self)
> +{
> +}
> +
> +static void
> +mm_plugin_mbm_class_init (MMPluginMbmClass *klass)
> +{
> +}
> diff --exclude-from=excludes -rupN orig/modemmanager/plugins/mm-plugin-mbm.h
> src/modemmanager/plugins/mm-plugin-mbm.h
> --- orig/modemmanager/plugins/mm-plugin-mbm.h   1970-01-01
> 01:00:00.000000000 +0100
> +++ src/modemmanager/plugins/mm-plugin-mbm.h    2008-10-15
> 13:14:00.000000000 +0200
> @@ -0,0 +1,47 @@
> +/*
> +    Additions to NetworkManager, network-manager-applet and modemmanager
> +    for supporting Ericsson modules like F3507g.
> +
> +    Author: Per Hallsmark <per hallsmark se>
> +
> +    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.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +*/
> +
> +#ifndef MM_PLUGIN_MBM_H
> +#define MM_PLUGIN_MBM_H
> +
> +#include "mm-plugin.h"
> +#include "mm-generic-gsm.h"
> +
> +#define MM_TYPE_PLUGIN_MBM                     (mm_plugin_mbm_get_type ())
> +#define MM_PLUGIN_MBM(obj)                     (G_TYPE_CHECK_INSTANCE_CAST
> ((obj), MM_TYPE_PLUGIN_MBM, MMPluginMbm))
> +#define MM_PLUGIN_MBM_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass),
>  MM_TYPE_PLUGIN_MBM, MMPluginMbmClass))
> +#define MM_IS_PLUGIN_MBM(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
> MM_TYPE_PLUGIN_MBM))
> +#define MM_IS_PLUGIN_MBM_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass),
>  MM_TYPE_PLUGIN_MBM))
> +#define MM_PLUGIN_MBM_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),
>  MM_TYPE_PLUGIN_MBM, MMPluginMbmClass))
> +
> +typedef struct {
> +    GObject parent;
> +} MMPluginMbm;
> +
> +typedef struct {
> +    GObjectClass parent;
> +} MMPluginMbmClass;
> +
> +GType mm_plugin_mbm_get_type (void);
> +
> +#endif /* MM_PLUGIN_MBM_H */
> diff --exclude-from=excludes -rupN orig/modemmanager/stamp-h1
> src/modemmanager/stamp-h1
> --- orig/modemmanager/stamp-h1  2008-10-15 17:58:48.000000000 +0200
> +++ src/modemmanager/stamp-h1   1970-01-01 01:00:00.000000000 +0100
> @@ -1 +0,0 @@
> -timestamp for config.h
> diff --exclude-from=excludes -rupN orig/modemmanager/test/mm-test.py
> src/modemmanager/test/mm-test.py
> --- orig/modemmanager/test/mm-test.py   2008-10-15 17:56:04.000000000 +0200
> +++ src/modemmanager/test/mm-test.py    2008-10-14 14:37:23.000000000 +0200
> @@ -51,9 +51,6 @@ def get_modem(manager):
>     except dbus.exceptions.DBusException, e:
>         need_pin = True
>
> -    if need_pin:
> -        modem.SetPin("1234")
> -
>     return modem
>
>
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/modem-manager/Makefile.am
> src/NetworkManager/src/modem-manager/Makefile.am
> --- orig/NetworkManager/src/modem-manager/Makefile.am   2008-10-15
> 17:56:22.000000000 +0200
> +++ src/NetworkManager/src/modem-manager/Makefile.am    2008-10-14
> 16:29:40.000000000 +0200
> @@ -13,6 +13,8 @@ libmodem_manager_la_SOURCES = \
>        nm-gsm-modem.h \
>        nm-gsm-modem-hso.c \
>        nm-gsm-modem-hso.h \
> +       nm-gsm-modem-mbm.c \
> +       nm-gsm-modem-mbm.h \
>        nm-modem-device.c \
>        nm-modem-device.h \
>        nm-modem-manager.h \
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.c
> src/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.c
> --- orig/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.c    1970-01-01
> 01:00:00.000000000 +0100
> +++ src/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.c     2008-10-15
> 13:13:44.000000000 +0200
> @@ -0,0 +1,259 @@
> +/*
> +    Additions to NetworkManager, network-manager-applet and modemmanager
> +    for supporting Ericsson modules like F3507g.
> +
> +    Author: Per Hallsmark <per hallsmark se>
> +
> +    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.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +*/
> +
> +#include "nm-gsm-modem-mbm.h"
> +#include "nm-device-private.h"
> +#include "nm-device-interface.h"
> +#include "NetworkManagerSystem.h"
> +#include "nm-setting-connection.h"
> +#include "nm-setting-gsm.h"
> +#include "nm-modem-types.h"
> +#include "nm-utils.h"
> +
> +G_DEFINE_TYPE (NMGsmModemMbm, nm_gsm_modem_mbm, NM_TYPE_GSM_MODEM)
> +
> +#define NM_GSM_MODEM_MBM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
> NM_TYPE_GSM_MODEM_MBM, NMGsmModemMbmPrivate))
> +
> +typedef struct {
> +       char *netdev_iface;
> +       NMIP4Config *pending_ip4_config;
> +} NMGsmModemMbmPrivate;
> +
> +#define MBM_SECRETS_TRIES "gsm-secrets-tries"
> +
> +static char *
> +get_network_device (NMDevice *device)
> +{
> +       char *result = NULL;
> +       GError *error = NULL;
> +       GValue value = { 0, };
> +
> +       if (!dbus_g_proxy_call (nm_modem_device_get_proxy (NM_MODEM_DEVICE
> (device), "org.freedesktop.DBus.Properties"),
> +                                           "Get", &error,
> +                                           G_TYPE_STRING,
> MM_DBUS_INTERFACE_MODEM_GSM_MBM,
> +                                           G_TYPE_STRING, "NetworkDevice",
> +                                           G_TYPE_INVALID,
> +                                           G_TYPE_VALUE, &value,
> +                                           G_TYPE_INVALID)) {
> +               nm_warning ("Could not get MBM device's network interface:
> %s", error->message);
> +               g_error_free (error);
> +       } else {
> +               if (G_VALUE_HOLDS_STRING (&value))
> +                       result = g_value_dup_string (&value);
> +               else
> +                       nm_warning ("Could not get MBM device's network
> interface: wrong type '%s'",
> +                                         G_VALUE_TYPE_NAME (&value));
> +
> +               g_value_unset (&value);
> +       }
> +
> +       return result;
> +}
> +
> +NMDevice *
> +nm_gsm_modem_mbm_new (const char *path,
> +                                 const char *data_device,
> +                                 const char *driver)
> +{
> +       NMDevice *device;
> +
> +       g_return_val_if_fail (path != NULL, NULL);
> +       g_return_val_if_fail (data_device != NULL, NULL);
> +       g_return_val_if_fail (driver != NULL, NULL);
> +
> +       device = (NMDevice *) g_object_new (NM_TYPE_GSM_MODEM_MBM,
> +
>  NM_DEVICE_INTERFACE_UDI, path,
> +
>  NM_DEVICE_INTERFACE_IFACE, data_device,
> +
>  NM_DEVICE_INTERFACE_DRIVER, driver,
> +
>  NM_DEVICE_INTERFACE_MANAGED, TRUE,
> +                                                                NULL);
> +
> +       if (device) {
> +               NMGsmModemMbmPrivate *priv;
> +
> +               priv = NM_GSM_MODEM_MBM_GET_PRIVATE (device);
> +               priv->netdev_iface = get_network_device (device);
> +               if (!priv->netdev_iface) {
> +                       g_object_unref (device);
> +                       device = NULL;
> +               }
> +       }
> +
> +       return device;
> +}
> +
> +/*****************************************************************************/
> +
> +#if 0
> +static NMSetting *
> +get_setting (NMGsmModemMbm *modem, GType setting_type)
> +{
> +       NMActRequest *req;
> +       NMSetting *setting = NULL;
> +
> +       req = nm_device_get_act_request (NM_DEVICE (modem));
> +       if (req) {
> +               NMConnection *connection;
> +
> +               connection = nm_act_request_get_connection (req);
> +               if (connection)
> +                       setting = nm_connection_get_setting (connection,
> setting_type);
> +       }
> +
> +       return setting;
> +}
> +#endif
> +
> +#if 0
> +static NMActStageReturn
> +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason)
> +{
> +       NMActRequest *req;
> +       NMConnection *connection;
> +       const char *setting_name;
> +       GPtrArray *hints = NULL;
> +       const char *hint1 = NULL, *hint2 = NULL;
> +       guint32 tries;
> +
> +       req = nm_device_get_act_request (device);
> +       g_assert (req);
> +       connection = nm_act_request_get_connection (req);
> +       g_assert (connection);
> +
> +       setting_name = nm_connection_need_secrets (connection, &hints);
> +       if (!setting_name) {
> +//             do_mbm_auth (NM_GSM_MODEM_MBM (device));
> +               return NM_ACT_STAGE_RETURN_POSTPONE;
> +       }
> +
> +       if (hints) {
> +               if (hints->len > 0)
> +                       hint1 = g_ptr_array_index (hints, 0);
> +               if (hints->len > 1)
> +                       hint2 = g_ptr_array_index (hints, 1);
> +       }
> +
> +       nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH,
> NM_DEVICE_STATE_REASON_NONE);
> +
> +       tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection),
> MBM_SECRETS_TRIES));
> +       nm_act_request_request_connection_secrets (req,
> +                                                  setting_name,
> +                                                  tries ? TRUE : FALSE,
> +                                                  SECRETS_CALLER_MBM_GSM,
> +                                                  hint1,
> +                                                  hint2);
> +       g_object_set_data (G_OBJECT (connection), MBM_SECRETS_TRIES,
> GUINT_TO_POINTER (++tries));
> +
> +       if (hints)
> +               g_ptr_array_free (hints, TRUE);
> +
> +       return NM_ACT_STAGE_RETURN_POSTPONE;
> +}
> +#endif
> +
> +static void
> +real_deactivate (NMDevice *device)
> +{
> +       NMGsmModemMbmPrivate *priv = NM_GSM_MODEM_MBM_GET_PRIVATE (device);
> +
> +       if (priv->pending_ip4_config) {
> +               g_object_unref (priv->pending_ip4_config);
> +               priv->pending_ip4_config = NULL;
> +       }
> +
> +       if (priv->netdev_iface) {
> +               nm_system_device_flush_ip4_routes_with_iface
> (priv->netdev_iface);
> +               nm_system_device_flush_ip4_addresses_with_iface
> (priv->netdev_iface);
> +               nm_system_device_set_up_down_with_iface (priv->netdev_iface,
> FALSE, NULL);
> +       }
> +       nm_device_set_ip_iface (device, NULL);
> +
> +       if (NM_DEVICE_CLASS (nm_gsm_modem_mbm_parent_class)->deactivate)
> +               NM_DEVICE_CLASS (nm_gsm_modem_mbm_parent_class)->deactivate
> (device);
> +}
> +
> +static gboolean
> +real_hw_is_up (NMDevice *device)
> +{
> +       NMGsmModemMbmPrivate *priv = NM_GSM_MODEM_MBM_GET_PRIVATE (device);
> +
> +       if (priv->netdev_iface)
> +               return nm_system_device_is_up_with_iface
> (priv->netdev_iface);
> +
> +       return TRUE;
> +}
> +
> +static gboolean
> +real_hw_bring_up (NMDevice *device, gboolean *no_firmware)
> +{
> +       NMGsmModemMbmPrivate *priv = NM_GSM_MODEM_MBM_GET_PRIVATE (device);
> +
> +       if (priv->netdev_iface)
> +               return nm_system_device_set_up_down_with_iface
> (priv->netdev_iface, TRUE, no_firmware);
> +
> +       return TRUE;
> +}
> +
> +static void
> +real_connect (NMModemDevice *modem, const char *number)
> +{
> +       nm_device_activate_schedule_stage2_device_config (NM_DEVICE
> (modem));
> +}
> +
> +/*****************************************************************************/
> +
> +static void
> +nm_gsm_modem_mbm_init (NMGsmModemMbm *self)
> +{
> +}
> +
> +static void
> +finalize (GObject *object)
> +{
> +       NMGsmModemMbmPrivate *priv = NM_GSM_MODEM_MBM_GET_PRIVATE (object);
> +
> +       g_free (priv->netdev_iface);
> +
> +       G_OBJECT_CLASS (nm_gsm_modem_mbm_parent_class)->finalize (object);
> +}
> +
> +static void
> +nm_gsm_modem_mbm_class_init (NMGsmModemMbmClass *klass)
> +{
> +       GObjectClass *object_class = G_OBJECT_CLASS (klass);
> +       NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
> +       NMModemDeviceClass *modem_class = NM_MODEM_DEVICE_CLASS (klass);
> +
> +       g_type_class_add_private (object_class, sizeof
> (NMGsmModemMbmPrivate));
> +
> +       object_class->finalize = finalize;
> +
> +#if 0
> +       device_class->act_stage2_config = real_act_stage2_config;
> +#endif
> +       device_class->deactivate = real_deactivate;
> +       device_class->hw_is_up = real_hw_is_up;
> +       device_class->hw_bring_up = real_hw_bring_up;
> +
> +       modem_class->connect = real_connect;
> +}
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.h
> src/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.h
> --- orig/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.h    1970-01-01
> 01:00:00.000000000 +0100
> +++ src/NetworkManager/src/modem-manager/nm-gsm-modem-mbm.h     2008-10-15
> 13:13:38.000000000 +0200
> @@ -0,0 +1,53 @@
> +/*
> +    Additions to NetworkManager, network-manager-applet and modemmanager
> +    for supporting Ericsson modules like F3507g.
> +
> +    Author: Per Hallsmark <per hallsmark se>
> +
> +    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.
> +
> +    You should have received a copy of the GNU General Public License
> +    along with this program; if not, write to the Free Software
> +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +*/
> +
> +#ifndef NM_GSM_MODEM_MBM_H
> +#define NM_GSM_MODEM_MBM_H
> +
> +#include <nm-gsm-modem.h>
> +
> +G_BEGIN_DECLS
> +
> +#define NM_TYPE_GSM_MODEM_MBM            (nm_gsm_modem_mbm_get_type ())
> +#define NM_GSM_MODEM_MBM(obj)            (G_TYPE_CHECK_INSTANCE_CAST
> ((obj), NM_TYPE_GSM_MODEM_MBM, NMGsmModemMbm))
> +#define NM_GSM_MODEM_MBM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),
>  NM_TYPE_GSM_MODEM_MBM, NMGsmModemMbmClass))
> +#define NM_IS_GSM_MODEM_MBM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE
> ((obj), NM_TYPE_GSM_MODEM_MBM))
> +#define NM_IS_GSM_MODEM_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
>  NM_TYPE_GSM_MODEM_MBM))
> +#define NM_GSM_MODEM_MBM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),
>  NM_TYPE_GSM_MODEM_MBM, NMGsmModemMbmClass))
> +
> +typedef struct {
> +       NMGsmModem parent;
> +} NMGsmModemMbm;
> +
> +typedef struct {
> +       NMGsmModemClass parent;
> +} NMGsmModemMbmClass;
> +
> +GType nm_gsm_modem_mbm_get_type (void);
> +
> +NMDevice *nm_gsm_modem_mbm_new (const char *path, const char *data_device,
> +                                                 const char *driver);
> +
> +G_END_DECLS
> +
> +#endif /* NM_GSM_MODEM_MBM_H */
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/modem-manager/nm-modem-manager.c
> src/NetworkManager/src/modem-manager/nm-modem-manager.c
> --- orig/NetworkManager/src/modem-manager/nm-modem-manager.c    2008-10-15
> 17:56:22.000000000 +0200
> +++ src/NetworkManager/src/modem-manager/nm-modem-manager.c     2008-10-14
> 16:26:14.000000000 +0200
> @@ -5,6 +5,7 @@
>  #include "nm-modem-device.h"
>  #include "nm-gsm-modem.h"
>  #include "nm-gsm-modem-hso.h"
> +#include "nm-gsm-modem-mbm.h"
>  #include "nm-cdma-modem.h"
>  #include "nm-dbus-manager.h"
>  #include "nm-utils.h"
> @@ -148,6 +149,8 @@ create_modem (NMModemManager *manager, c
>        if (modem_type == MM_MODEM_TYPE_GSM) {
>                if (!strcmp (driver, "hso"))
>                        device = nm_gsm_modem_hso_new (path, data_device,
> driver);
> +               else if (!strcmp (driver, "mbm"))
> +                       device = nm_gsm_modem_mbm_new (path, data_device,
> driver);
>                else
>                        device = nm_gsm_modem_new (path, data_device,
> driver);
>        } else if (modem_type == MM_MODEM_TYPE_CDMA)
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/modem-manager/nm-modem-types.h
> src/NetworkManager/src/modem-manager/nm-modem-types.h
> --- orig/NetworkManager/src/modem-manager/nm-modem-types.h      2008-10-15
> 17:56:22.000000000 +0200
> +++ src/NetworkManager/src/modem-manager/nm-modem-types.h       2008-10-15
> 10:27:25.000000000 +0200
> @@ -12,6 +12,7 @@
>  #define MM_DBUS_INTERFACE_MODEM_GSM_CARD
>  "org.freedesktop.ModemManager.Modem.Gsm.Card"
>  #define MM_DBUS_INTERFACE_MODEM_GSM_NETWORK
> "org.freedesktop.ModemManager.Modem.Gsm.Network"
>  #define MM_DBUS_INTERFACE_MODEM_GSM_HSO
> "org.freedesktop.ModemManager.Modem.Gsm.Hso"
> +#define MM_DBUS_INTERFACE_MODEM_GSM_MBM
> "org.freedesktop.ModemManager.Modem.Gsm.Mbm"
>
>  #define MM_MODEM_TYPE_UNKNOWN  0
>  #define MM_MODEM_TYPE_GSM      1
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/nm-cdma-device-glue.h
> src/NetworkManager/src/nm-cdma-device-glue.h
> --- orig/NetworkManager/src/nm-cdma-device-glue.h       1970-01-01
> 01:00:00.000000000 +0100
> +++ src/NetworkManager/src/nm-cdma-device-glue.h        2008-10-14
> 09:34:48.000000000 +0200
> @@ -0,0 +1,72 @@
> +/* Generated by dbus-binding-tool; do not edit! */
> +
> +
> +#ifndef __dbus_glib_marshal_nm_cdma_device_MARSHAL_H__
> +#define __dbus_glib_marshal_nm_cdma_device_MARSHAL_H__
> +
> +#include       <glib-object.h>
> +
> +G_BEGIN_DECLS
> +
> +#ifdef G_ENABLE_DEBUG
> +#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
> +#define g_marshal_value_peek_char(v)     g_value_get_char (v)
> +#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
> +#define g_marshal_value_peek_int(v)      g_value_get_int (v)
> +#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
> +#define g_marshal_value_peek_long(v)     g_value_get_long (v)
> +#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
> +#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
> +#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
> +#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
> +#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
> +#define g_marshal_value_peek_float(v)    g_value_get_float (v)
> +#define g_marshal_value_peek_double(v)   g_value_get_double (v)
> +#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
> +#define g_marshal_value_peek_param(v)    g_value_get_param (v)
> +#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
> +#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
> +#define g_marshal_value_peek_object(v)   g_value_get_object (v)
> +#else /* !G_ENABLE_DEBUG */
> +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
> + *          Do not access GValues directly in your code. Instead, use the
> + *          g_value_get_*() functions
> + */
> +#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
> +#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
> +#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
> +#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
> +#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
> +#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
> +#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
> +#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
> +#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
> +#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
> +#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
> +#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
> +#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
> +#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
> +#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
> +#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
> +#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
> +#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
> +#endif /* !G_ENABLE_DEBUG */
> +
> +
> +G_END_DECLS
> +
> +#endif /* __dbus_glib_marshal_nm_cdma_device_MARSHAL_H__ */
> +
> +#include <dbus/dbus-glib.h>
> +static const DBusGMethodInfo dbus_glib_nm_cdma_device_methods[] = {
> +};
> +
> +const DBusGObjectInfo dbus_glib_nm_cdma_device_object_info = {
> +  0,
> +  dbus_glib_nm_cdma_device_methods,
> +  0,
> +"\0",
> +"org.freedesktop.NetworkManager.Device.Cdma\0PropertiesChanged\0\0",
> +"\0"
> +};
> +
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/nm-gsm-device-glue.h
> src/NetworkManager/src/nm-gsm-device-glue.h
> --- orig/NetworkManager/src/nm-gsm-device-glue.h        1970-01-01
> 01:00:00.000000000 +0100
> +++ src/NetworkManager/src/nm-gsm-device-glue.h 2008-10-14
> 09:34:48.000000000 +0200
> @@ -0,0 +1,72 @@
> +/* Generated by dbus-binding-tool; do not edit! */
> +
> +
> +#ifndef __dbus_glib_marshal_nm_gsm_device_MARSHAL_H__
> +#define __dbus_glib_marshal_nm_gsm_device_MARSHAL_H__
> +
> +#include       <glib-object.h>
> +
> +G_BEGIN_DECLS
> +
> +#ifdef G_ENABLE_DEBUG
> +#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
> +#define g_marshal_value_peek_char(v)     g_value_get_char (v)
> +#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
> +#define g_marshal_value_peek_int(v)      g_value_get_int (v)
> +#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
> +#define g_marshal_value_peek_long(v)     g_value_get_long (v)
> +#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
> +#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
> +#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
> +#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
> +#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
> +#define g_marshal_value_peek_float(v)    g_value_get_float (v)
> +#define g_marshal_value_peek_double(v)   g_value_get_double (v)
> +#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
> +#define g_marshal_value_peek_param(v)    g_value_get_param (v)
> +#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
> +#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
> +#define g_marshal_value_peek_object(v)   g_value_get_object (v)
> +#else /* !G_ENABLE_DEBUG */
> +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
> + *          Do not access GValues directly in your code. Instead, use the
> + *          g_value_get_*() functions
> + */
> +#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
> +#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
> +#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
> +#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
> +#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
> +#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
> +#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
> +#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
> +#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
> +#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
> +#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
> +#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
> +#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
> +#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
> +#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
> +#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
> +#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
> +#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
> +#endif /* !G_ENABLE_DEBUG */
> +
> +
> +G_END_DECLS
> +
> +#endif /* __dbus_glib_marshal_nm_gsm_device_MARSHAL_H__ */
> +
> +#include <dbus/dbus-glib.h>
> +static const DBusGMethodInfo dbus_glib_nm_gsm_device_methods[] = {
> +};
> +
> +const DBusGObjectInfo dbus_glib_nm_gsm_device_object_info = {
> +  0,
> +  dbus_glib_nm_gsm_device_methods,
> +  0,
> +"\0",
> +"org.freedesktop.NetworkManager.Device.Gsm\0PropertiesChanged\0\0",
> +"\0"
> +};
> +
> diff --exclude-from=excludes -rupN
> orig/NetworkManager/src/nm-serial-device-glue.h
> src/NetworkManager/src/nm-serial-device-glue.h
> --- orig/NetworkManager/src/nm-serial-device-glue.h     1970-01-01
> 01:00:00.000000000 +0100
> +++ src/NetworkManager/src/nm-serial-device-glue.h      2008-10-14
> 09:34:48.000000000 +0200
> @@ -0,0 +1,72 @@
> +/* Generated by dbus-binding-tool; do not edit! */
> +
> +
> +#ifndef __dbus_glib_marshal_nm_serial_device_MARSHAL_H__
> +#define __dbus_glib_marshal_nm_serial_device_MARSHAL_H__
> +
> +#include       <glib-object.h>
> +
> +G_BEGIN_DECLS
> +
> +#ifdef G_ENABLE_DEBUG
> +#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
> +#define g_marshal_value_peek_char(v)     g_value_get_char (v)
> +#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
> +#define g_marshal_value_peek_int(v)      g_value_get_int (v)
> +#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
> +#define g_marshal_value_peek_long(v)     g_value_get_long (v)
> +#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
> +#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
> +#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
> +#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
> +#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
> +#define g_marshal_value_peek_float(v)    g_value_get_float (v)
> +#define g_marshal_value_peek_double(v)   g_value_get_double (v)
> +#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
> +#define g_marshal_value_peek_param(v)    g_value_get_param (v)
> +#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
> +#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
> +#define g_marshal_value_peek_object(v)   g_value_get_object (v)
> +#else /* !G_ENABLE_DEBUG */
> +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
> + *          Do not access GValues directly in your code. Instead, use the
> + *          g_value_get_*() functions
> + */
> +#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
> +#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
> +#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
> +#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
> +#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
> +#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
> +#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
> +#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
> +#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
> +#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
> +#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
> +#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
> +#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
> +#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
> +#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
> +#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
> +#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
> +#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
> +#endif /* !G_ENABLE_DEBUG */
> +
> +
> +G_END_DECLS
> +
> +#endif /* __dbus_glib_marshal_nm_serial_device_MARSHAL_H__ */
> +
> +#include <dbus/dbus-glib.h>
> +static const DBusGMethodInfo dbus_glib_nm_serial_device_methods[] = {
> +};
> +
> +const DBusGObjectInfo dbus_glib_nm_serial_device_object_info = {
> +  0,
> +  dbus_glib_nm_serial_device_methods,
> +  0,
> +"\0",
> +"org.freedesktop.NetworkManager.Device.Serial\0PppStats\0\0",
> +"\0"
> +};
> +
>
> # Glue makefile building ModemManager, NetworkManager and NetworkManager
> applet.
> #
> # Author: Per Hallsmark <per hallsmark se>
> #
> # == start of a FOSS package ==
> # These steps are normally not needed to be carried out for a FOSS package
> # already in our repository.
> # 1. Setup a workspace of community repositories
> #    make foss
> #
> # 2. Export source to src, which will be the baseline for further
> development.
> #    make src
> #
> # 3. Update source to community head
> #    make update
> #    Hereafter step 2 is needed to be carried out again and a patching
> procedure
> #    take place.
> #
> # == Day to day usage ==
> # 1. make configure
> #    Creates makefile and such. Needed to be done at least once per svn co
> #    and further
> #    on if any changes to Makefile.am or similar is done.
> #
> # 2. Edit or add sources
> #
> # 3. make build
> #    MM, NM and network-manager-applet will also be installed natively
> during
> #    this stage. NM needs at least to be installed otherwise applet won't be
> #    built so descision was taken then to install all three.
> #    (could be removed when we figure out howto make the applet build look
> #    at our build of NetworkManager instead of the native one...)
> #
> # 4. make patch
> #
>
> MM=modemmanager
> NM=NetworkManager
> NM_APPLET=network-manager-applet
>
> MM_NM_PATCH=NetworkManager-r4160-use-modem-manager.patch
> MM_NM_APPLET_PATCH=nm-applet-r938-use-modem-manager.patch
>
> TOP=$(PWD)
>
> CONFIGS  = --with-docs
> CONFIGS  = --prefix=/usr
> CONFIGS += --sysconfdir=/etc
> CONFIGS += --localstatedir=/var
> CONFIGS += --with-resolveconf=/sbin/resolvconf
> CONFIGS += --with-dbus-sys=/etc/dbus-1/system.d
>
> all:
>
> # one time step - for package import from community
> $(TOP)/foss/$(MM):
>        mkdir -p $@
>        cd $@ && git clone git://gitorious.org/modemmanager/mainline.git
>
> $(TOP)/foss/$(NM)/svn:
>        mkdir -p $@
>        cd $@ && svn co svn://svn.gnome.org/svn/NetworkManager/trunk .
>
> $(TOP)/foss/$(NM_APPLET)/svn:
>        mkdir -p $@
>        cd $@ && svn co svn://svn.gnome.org/svn/network-manager-applet/trunk
> .
>
> foss $(TOP)/foss: $(TOP)/foss/$(MM) $(TOP)/foss/$(NM)/svn
> $(TOP)/foss/$(NM_APPLET)/svn
>
> update:
>        cd $(TOP)/foss/$(NM)/svn && svn up
>        cd $(TOP)/foss/$(NM_APPLET)/svn && svn up
>        cd $(TOP)/foss/$(MM)/mainline && git pull
>
> # one time step - for creating baseline for subversion
> $(TOP)/src/$(MM):
>        mkdir -p $@
>        cd $(TOP)/foss/$(MM)/mainline && cp -r . $@
>
> $(TOP)/src/$(NM):
>        cd $(TOP)/foss/$(NM)/svn && svn export . $@
>
> $(TOP)/src/$(NM_APPLET):
>        cd $(TOP)/foss/$(NM_APPLET)/svn && svn export . $@
>
> src $(TOP)/src: $(TOP)/src/$(MM) $(TOP)/src/$(NM) $(TOP)/src/$(NM_APPLET)
>
>
> integrate_mm:
>        cd $(TOP)/src/$(NM) && patch -p1 <
> $(TOP)/src/modemmanager/$(MM_NM_PATCH)
>        cd $(TOP)/src/$(NM_APPLET) && patch -p1 <
> $(TOP)/src/modemmanager/$(MM_NM_APPLET_PATCH)
>
> #
> configure:
>        cd $(TOP)/src/$(NM) && sh autogen.sh $(CONFIGS)
>        cd $(TOP)/src/$(NM_APPLET) && sh autogen.sh $(CONFIGS)
>        cd $(TOP)/src/$(MM) && sh autogen.sh $(CONFIGS)
>
> build:
>        $(MAKE) -C $(TOP)/src/$(NM)
>        sudo $(MAKE) -C $(TOP)/src/$(NM) install
>        $(MAKE) -C $(TOP)/src/$(NM_APPLET)
>        sudo $(MAKE) -C $(TOP)/src/$(NM_APPLET) install
>        $(MAKE) -C $(TOP)/src/$(MM)
>        sudo $(MAKE) -C $(TOP)/src/$(MM) install
>
> clean:
>
> distclean:
>        cd $(TOP)/src/$(NM) && $(MAKE) distclean
>        cd $(TOP)/src/$(NM_APPLET) && $(MAKE) distclean
>        cd $(TOP)/src/$(MM) && $(MAKE) distclean
>
> patch_$(NM):
>        diff --exclude-from=excludes -rupN $(TOP)/foss/$(NM)/svn
> $(TOP)/src/$(NM) > $(TOP)/patches/$(NM).patch || true
>
> patch_$(NM_APPLET):
>        diff --exclude-from=excludes -rupN $(TOP)/foss/$(NM_APPLET)/svn
> $(TOP)/src/$(NM_APPLET) > $(TOP)/patches/$(NM_APPLET).patch || true
>
> patch_$(MM):
>        diff --exclude-from=excludes -rupN $(TOP)/foss/$(MM)/mainline
> $(TOP)/src/$(MM) > $(TOP)/patches/$(MM).patch || true
>
> patch: patch_$(NM) patch_$(NM_APPLET) patch_$(MM)
>
> mrproper:
>        $(RM) -r foss src
>
> _______________________________________________
> NetworkManager-list mailing list
> NetworkManager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
>
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]