mobile: rename old MM bits to clarify that they're for old ModemManager
This commit is contained in:
@@ -124,13 +124,13 @@ nm_sources = \
|
|||||||
\
|
\
|
||||||
modem-manager/nm-modem-cdma.c \
|
modem-manager/nm-modem-cdma.c \
|
||||||
modem-manager/nm-modem-cdma.h \
|
modem-manager/nm-modem-cdma.h \
|
||||||
modem-manager/nm-modem-generic.c \
|
modem-manager/nm-modem-old.c \
|
||||||
modem-manager/nm-modem-generic.h \
|
modem-manager/nm-modem-old.h \
|
||||||
|
modem-manager/nm-modem-old-types.h \
|
||||||
modem-manager/nm-modem-gsm.c \
|
modem-manager/nm-modem-gsm.c \
|
||||||
modem-manager/nm-modem-gsm.h \
|
modem-manager/nm-modem-gsm.h \
|
||||||
modem-manager/nm-modem-manager.c \
|
modem-manager/nm-modem-manager.c \
|
||||||
modem-manager/nm-modem-manager.h \
|
modem-manager/nm-modem-manager.h \
|
||||||
modem-manager/nm-modem-types.h \
|
|
||||||
modem-manager/nm-modem.c \
|
modem-manager/nm-modem.c \
|
||||||
modem-manager/nm-modem.h \
|
modem-manager/nm-modem.h \
|
||||||
\
|
\
|
||||||
|
@@ -29,10 +29,10 @@ ModemManager 0.7 integration
|
|||||||
ModemManager 0.4/0.5/0.6 integration
|
ModemManager 0.4/0.5/0.6 integration
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
|
|
||||||
* nm-modem-types.h:
|
* nm-modem-old-types.h:
|
||||||
Defines helper types to use with the (old) ModemManager DBus API.
|
Defines helper types to use with the (old) ModemManager DBus API.
|
||||||
|
|
||||||
* nm-modem-generic.[h|c]:
|
* nm-modem-old.[h|c]:
|
||||||
Defines the `NMModemGeneric' object. All modem objects based on the old
|
Defines the `NMModemGeneric' object. All modem objects based on the old
|
||||||
ModemManager interface are subclasses of this one.
|
ModemManager interface are subclasses of this one.
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "nm-dbus-glib-types.h"
|
#include "nm-dbus-glib-types.h"
|
||||||
#include "nm-modem-cdma.h"
|
#include "nm-modem-cdma.h"
|
||||||
#include "nm-modem-types.h"
|
#include "nm-modem-old-types.h"
|
||||||
#include "nm-enum-types.h"
|
#include "nm-enum-types.h"
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
#include "nm-device-private.h"
|
#include "nm-device-private.h"
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
#include "nm-logging.h"
|
#include "nm-logging.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM_GENERIC)
|
G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM_OLD)
|
||||||
|
|
||||||
#define NM_MODEM_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_CDMA, NMModemCdmaPrivate))
|
#define NM_MODEM_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_CDMA, NMModemCdmaPrivate))
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ do_connect (NMModemCdma *self)
|
|||||||
NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self);
|
NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self);
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
|
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (self), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
||||||
priv->call = dbus_g_proxy_begin_call_with_timeout (proxy,
|
priv->call = dbus_g_proxy_begin_call_with_timeout (proxy,
|
||||||
"Connect", stage1_prepare_done,
|
"Connect", stage1_prepare_done,
|
||||||
self, NULL, 120000,
|
self, NULL, 120000,
|
||||||
@@ -178,7 +178,7 @@ act_stage1_prepare (NMModem *modem,
|
|||||||
if (enabled)
|
if (enabled)
|
||||||
do_connect (self);
|
do_connect (self);
|
||||||
else {
|
else {
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_OLD_DBUS_INTERFACE_MODEM);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (modem), MM_OLD_DBUS_INTERFACE_MODEM);
|
||||||
dbus_g_proxy_begin_call_with_timeout (proxy,
|
dbus_g_proxy_begin_call_with_timeout (proxy,
|
||||||
"Enable", stage1_enable_done,
|
"Enable", stage1_enable_done,
|
||||||
modem, NULL, 20000,
|
modem, NULL, 20000,
|
||||||
@@ -293,7 +293,7 @@ deactivate (NMModem *modem, NMDevice *device)
|
|||||||
if (priv->call) {
|
if (priv->call) {
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
|
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (modem), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
||||||
dbus_g_proxy_cancel_call (proxy, priv->call);
|
dbus_g_proxy_cancel_call (proxy, priv->call);
|
||||||
priv->call = NULL;
|
priv->call = NULL;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#ifndef NM_MODEM_CDMA_H
|
#ifndef NM_MODEM_CDMA_H
|
||||||
#define NM_MODEM_CDMA_H
|
#define NM_MODEM_CDMA_H
|
||||||
|
|
||||||
#include <nm-modem-generic.h>
|
#include "nm-modem-old.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@@ -40,11 +40,11 @@ typedef enum {
|
|||||||
} NMCdmaError;
|
} NMCdmaError;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMModemGeneric parent;
|
NMModemOld parent;
|
||||||
} NMModemCdma;
|
} NMModemCdma;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMModemGenericClass parent;
|
NMModemOldClass parent;
|
||||||
} NMModemCdmaClass;
|
} NMModemCdmaClass;
|
||||||
|
|
||||||
GType nm_modem_cdma_get_type (void);
|
GType nm_modem_cdma_get_type (void);
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
#include "nm-setting-connection.h"
|
#include "nm-setting-connection.h"
|
||||||
#include "nm-setting-gsm.h"
|
#include "nm-setting-gsm.h"
|
||||||
#include "nm-setting-ppp.h"
|
#include "nm-setting-ppp.h"
|
||||||
#include "nm-modem-types.h"
|
#include "nm-modem-old-types.h"
|
||||||
#include "nm-enum-types.h"
|
#include "nm-enum-types.h"
|
||||||
#include "nm-logging.h"
|
#include "nm-logging.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
@@ -77,7 +77,7 @@ typedef enum {
|
|||||||
MM_MODEM_GSM_ALLOWED_AUTH_LAST = MM_MODEM_GSM_ALLOWED_AUTH_EAP
|
MM_MODEM_GSM_ALLOWED_AUTH_LAST = MM_MODEM_GSM_ALLOWED_AUTH_EAP
|
||||||
} MMModemGsmAllowedAuth;
|
} MMModemGsmAllowedAuth;
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM_GENERIC)
|
G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM_OLD)
|
||||||
|
|
||||||
#define NM_MODEM_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_GSM, NMModemGsmPrivate))
|
#define NM_MODEM_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_GSM, NMModemGsmPrivate))
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ do_connect (NMModemGsm *self)
|
|||||||
NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self);
|
NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self);
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
|
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (self), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
||||||
priv->call = dbus_g_proxy_begin_call_with_timeout (proxy,
|
priv->call = dbus_g_proxy_begin_call_with_timeout (proxy,
|
||||||
"Connect", stage1_prepare_done,
|
"Connect", stage1_prepare_done,
|
||||||
self, NULL, 120000,
|
self, NULL, 120000,
|
||||||
@@ -243,7 +243,7 @@ do_enable (NMModemGsm *self)
|
|||||||
g_return_val_if_fail (NM_IS_MODEM_GSM (self), FALSE);
|
g_return_val_if_fail (NM_IS_MODEM_GSM (self), FALSE);
|
||||||
|
|
||||||
NM_MODEM_GSM_GET_PRIVATE (self)->enable_delay_id = 0;
|
NM_MODEM_GSM_GET_PRIVATE (self)->enable_delay_id = 0;
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (self), MM_OLD_DBUS_INTERFACE_MODEM);
|
||||||
dbus_g_proxy_begin_call_with_timeout (proxy,
|
dbus_g_proxy_begin_call_with_timeout (proxy,
|
||||||
"Enable", stage1_enable_done,
|
"Enable", stage1_enable_done,
|
||||||
self, NULL, 20000,
|
self, NULL, 20000,
|
||||||
@@ -296,7 +296,7 @@ handle_enable_pin_required (NMModemGsm *self)
|
|||||||
|
|
||||||
/* If we do, send it */
|
/* If we do, send it */
|
||||||
if (pin) {
|
if (pin) {
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM_GSM_CARD);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (self), MM_OLD_DBUS_INTERFACE_MODEM_GSM_CARD);
|
||||||
dbus_g_proxy_begin_call_with_timeout (proxy,
|
dbus_g_proxy_begin_call_with_timeout (proxy,
|
||||||
"SendPin", stage1_pin_done,
|
"SendPin", stage1_pin_done,
|
||||||
self, NULL, 10000,
|
self, NULL, 10000,
|
||||||
@@ -569,7 +569,7 @@ deactivate (NMModem *modem, NMDevice *device)
|
|||||||
if (priv->call) {
|
if (priv->call) {
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
|
|
||||||
proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
proxy = nm_modem_old_get_proxy (NM_MODEM_OLD (modem), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
|
||||||
dbus_g_proxy_cancel_call (proxy, priv->call);
|
dbus_g_proxy_cancel_call (proxy, priv->call);
|
||||||
priv->call = NULL;
|
priv->call = NULL;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#ifndef NM_MODEM_GSM_H
|
#ifndef NM_MODEM_GSM_H
|
||||||
#define NM_MODEM_GSM_H
|
#define NM_MODEM_GSM_H
|
||||||
|
|
||||||
#include <nm-modem-generic.h>
|
#include "nm-modem-old.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@@ -40,11 +40,11 @@ typedef enum {
|
|||||||
} NMGsmError;
|
} NMGsmError;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMModemGeneric parent;
|
NMModemOld parent;
|
||||||
} NMModemGsm;
|
} NMModemGsm;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMModemGenericClass parent;
|
NMModemOldClass parent;
|
||||||
} NMModemGsmClass;
|
} NMModemGsmClass;
|
||||||
|
|
||||||
GType nm_modem_gsm_get_type (void);
|
GType nm_modem_gsm_get_type (void);
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include "nm-modem-gsm.h"
|
#include "nm-modem-gsm.h"
|
||||||
#include "nm-modem-cdma.h"
|
#include "nm-modem-cdma.h"
|
||||||
#include "nm-dbus-manager.h"
|
#include "nm-dbus-manager.h"
|
||||||
#include "nm-modem-types.h"
|
#include "nm-modem-old-types.h"
|
||||||
#include "nm-dbus-glib-types.h"
|
#include "nm-dbus-glib-types.h"
|
||||||
|
|
||||||
#if WITH_MODEM_MANAGER_1
|
#if WITH_MODEM_MANAGER_1
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
* Copyright (C) 2009 Novell, Inc.
|
* Copyright (C) 2009 Novell, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NM_MODEM_TYPES_H
|
#ifndef NM_MODEM_OLD_TYPES_H
|
||||||
#define NM_MODEM_TYPES_H
|
#define NM_MODEM_OLD_TYPES_H
|
||||||
|
|
||||||
#define MM_OLD_DBUS_SERVICE "org.freedesktop.ModemManager"
|
#define MM_OLD_DBUS_SERVICE "org.freedesktop.ModemManager"
|
||||||
#define MM_OLD_DBUS_PATH "/org/freedesktop/ModemManager"
|
#define MM_OLD_DBUS_PATH "/org/freedesktop/ModemManager"
|
||||||
@@ -51,4 +51,4 @@
|
|||||||
#define MM_OLD_MODEM_ERROR_SIM_PUK MM_OLD_MODEM_ERROR ".SimPukRequired"
|
#define MM_OLD_MODEM_ERROR_SIM_PUK MM_OLD_MODEM_ERROR ".SimPukRequired"
|
||||||
#define MM_OLD_MODEM_ERROR_SIM_WRONG MM_OLD_MODEM_ERROR ".SimWrong"
|
#define MM_OLD_MODEM_ERROR_SIM_WRONG MM_OLD_MODEM_ERROR ".SimWrong"
|
||||||
|
|
||||||
#endif /* NM_MODEM_TYPES_H */
|
#endif /* NM_MODEM_OLD_TYPES_H */
|
@@ -20,21 +20,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "nm-modem-generic.h"
|
#include "nm-modem-old.h"
|
||||||
#include "nm-system.h"
|
#include "nm-system.h"
|
||||||
#include "nm-dbus-manager.h"
|
#include "nm-dbus-manager.h"
|
||||||
#include "nm-setting-connection.h"
|
#include "nm-setting-connection.h"
|
||||||
#include "nm-properties-changed-signal.h"
|
#include "nm-properties-changed-signal.h"
|
||||||
#include "nm-modem-types.h"
|
#include "nm-modem-old-types.h"
|
||||||
#include "nm-logging.h"
|
#include "nm-logging.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
#include "nm-device-private.h"
|
#include "nm-device-private.h"
|
||||||
#include "nm-dbus-glib-types.h"
|
#include "nm-dbus-glib-types.h"
|
||||||
#include "nm-glib-compat.h"
|
#include "nm-glib-compat.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMModemGeneric, nm_modem_generic, NM_TYPE_MODEM)
|
G_DEFINE_TYPE (NMModemOld, nm_modem_old, NM_TYPE_MODEM)
|
||||||
|
|
||||||
#define NM_MODEM_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_GENERIC, NMModemGenericPrivate))
|
#define NM_MODEM_OLD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_OLD, NMModemOldPrivate))
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
@@ -43,19 +43,18 @@ typedef struct {
|
|||||||
DBusGProxyCall *call;
|
DBusGProxyCall *call;
|
||||||
|
|
||||||
NMModemState state;
|
NMModemState state;
|
||||||
} NMModemGenericPrivate;
|
} NMModemOldPrivate;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
DBusGProxy *
|
DBusGProxy *
|
||||||
nm_modem_generic_get_proxy (NMModemGeneric *self,
|
nm_modem_old_get_proxy (NMModemOld *self, const char *interface)
|
||||||
const char *interface)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
NMModemGenericPrivate *priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
|
NMModemOldPrivate *priv = NM_MODEM_OLD_GET_PRIVATE (self);
|
||||||
const char *current_iface;
|
const char *current_iface;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_MODEM_GENERIC (self), NULL);
|
g_return_val_if_fail (NM_IS_MODEM_OLD (self), NULL);
|
||||||
|
|
||||||
/* Default to the default interface. */
|
/* Default to the default interface. */
|
||||||
if (interface == NULL)
|
if (interface == NULL)
|
||||||
@@ -110,9 +109,9 @@ get_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
query_mm_enabled (NMModemGeneric *self)
|
query_mm_enabled (NMModemOld *self)
|
||||||
{
|
{
|
||||||
dbus_g_proxy_begin_call (NM_MODEM_GENERIC_GET_PRIVATE (self)->props_proxy,
|
dbus_g_proxy_begin_call (NM_MODEM_OLD_GET_PRIVATE (self)->props_proxy,
|
||||||
"Get", get_mm_enabled_done,
|
"Get", get_mm_enabled_done,
|
||||||
self, NULL,
|
self, NULL,
|
||||||
G_TYPE_STRING, MM_OLD_DBUS_INTERFACE_MODEM,
|
G_TYPE_STRING, MM_OLD_DBUS_INTERFACE_MODEM,
|
||||||
@@ -132,7 +131,7 @@ set_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update enabled/disabled state again */
|
/* Update enabled/disabled state again */
|
||||||
query_mm_enabled (NM_MODEM_GENERIC (user_data));
|
query_mm_enabled (NM_MODEM_OLD (user_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -142,7 +141,7 @@ set_mm_enabled (NMModem *self, gboolean enabled)
|
|||||||
* future we want to tie this into rfkill state instead so that the user can
|
* future we want to tie this into rfkill state instead so that the user can
|
||||||
* toggle rfkill status of the WWAN modem.
|
* toggle rfkill status of the WWAN modem.
|
||||||
*/
|
*/
|
||||||
dbus_g_proxy_begin_call (nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self),
|
dbus_g_proxy_begin_call (nm_modem_old_get_proxy (NM_MODEM_OLD (self),
|
||||||
MM_OLD_DBUS_INTERFACE_MODEM),
|
MM_OLD_DBUS_INTERFACE_MODEM),
|
||||||
"Enable", set_mm_enabled_done,
|
"Enable", set_mm_enabled_done,
|
||||||
self, NULL,
|
self, NULL,
|
||||||
@@ -178,8 +177,8 @@ ip_address_to_string (guint32 numeric)
|
|||||||
static void
|
static void
|
||||||
static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
|
static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
|
||||||
{
|
{
|
||||||
NMModemGeneric *self = NM_MODEM_GENERIC (user_data);
|
NMModemOld *self = NM_MODEM_OLD (user_data);
|
||||||
NMModemGenericPrivate *priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
|
NMModemOldPrivate *priv = NM_MODEM_OLD_GET_PRIVATE (self);
|
||||||
GValueArray *ret_array = NULL;
|
GValueArray *ret_array = NULL;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
NMIP4Config *config = NULL;
|
NMIP4Config *config = NULL;
|
||||||
@@ -233,15 +232,15 @@ static_stage3_ip4_config_start (NMModem *self,
|
|||||||
NMActRequest *req,
|
NMActRequest *req,
|
||||||
NMDeviceStateReason *reason)
|
NMDeviceStateReason *reason)
|
||||||
{
|
{
|
||||||
NMModemGenericPrivate *priv;
|
NMModemOldPrivate *priv;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE);
|
g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE);
|
||||||
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE);
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE);
|
||||||
g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);
|
g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);
|
||||||
|
|
||||||
priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
|
priv = NM_MODEM_OLD_GET_PRIVATE (self);
|
||||||
|
|
||||||
priv->call = dbus_g_proxy_begin_call (nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self),
|
priv->call = dbus_g_proxy_begin_call (nm_modem_old_get_proxy (NM_MODEM_OLD (self),
|
||||||
MM_OLD_DBUS_INTERFACE_MODEM),
|
MM_OLD_DBUS_INTERFACE_MODEM),
|
||||||
"GetIP4Config", static_stage3_done,
|
"GetIP4Config", static_stage3_done,
|
||||||
self, NULL,
|
self, NULL,
|
||||||
@@ -271,7 +270,7 @@ static void
|
|||||||
disconnect (NMModem *self,
|
disconnect (NMModem *self,
|
||||||
gboolean warn)
|
gboolean warn)
|
||||||
{
|
{
|
||||||
dbus_g_proxy_begin_call (nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self),
|
dbus_g_proxy_begin_call (nm_modem_old_get_proxy (NM_MODEM_OLD (self),
|
||||||
MM_OLD_DBUS_INTERFACE_MODEM),
|
MM_OLD_DBUS_INTERFACE_MODEM),
|
||||||
"Disconnect",
|
"Disconnect",
|
||||||
disconnect_done,
|
disconnect_done,
|
||||||
@@ -285,12 +284,12 @@ disconnect (NMModem *self,
|
|||||||
static void
|
static void
|
||||||
deactivate (NMModem *self, NMDevice *device)
|
deactivate (NMModem *self, NMDevice *device)
|
||||||
{
|
{
|
||||||
NMModemGenericPrivate *priv;
|
NMModemOldPrivate *priv;
|
||||||
|
|
||||||
g_assert (NM_IS_MODEM_GENERIC (self));
|
g_assert (NM_IS_MODEM_OLD (self));
|
||||||
g_assert (NM_IS_DEVICE (device));
|
g_assert (NM_IS_DEVICE (device));
|
||||||
|
|
||||||
priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
|
priv = NM_MODEM_OLD_GET_PRIVATE (self);
|
||||||
|
|
||||||
if (priv->call) {
|
if (priv->call) {
|
||||||
dbus_g_proxy_cancel_call (priv->proxy, priv->call);
|
dbus_g_proxy_cancel_call (priv->proxy, priv->call);
|
||||||
@@ -298,7 +297,7 @@ deactivate (NMModem *self, NMDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Chain up parent's */
|
/* Chain up parent's */
|
||||||
NM_MODEM_CLASS (nm_modem_generic_parent_class)->deactivate (self, device);
|
NM_MODEM_CLASS (nm_modem_old_parent_class)->deactivate (self, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -309,8 +308,8 @@ modem_properties_changed (DBusGProxy *proxy,
|
|||||||
GHashTable *props,
|
GHashTable *props,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
NMModemGeneric *self = NM_MODEM_GENERIC (user_data);
|
NMModemOld *self = NM_MODEM_OLD (user_data);
|
||||||
NMModemGenericPrivate *priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
|
NMModemOldPrivate *priv = NM_MODEM_OLD_GET_PRIVATE (self);
|
||||||
GValue *value;
|
GValue *value;
|
||||||
NMModemState new_state;
|
NMModemState new_state;
|
||||||
|
|
||||||
@@ -351,7 +350,7 @@ modem_properties_changed (DBusGProxy *proxy,
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_modem_generic_init (NMModemGeneric *self)
|
nm_modem_old_init (NMModemOld *self)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,14 +360,14 @@ constructor (GType type,
|
|||||||
GObjectConstructParam *construct_params)
|
GObjectConstructParam *construct_params)
|
||||||
{
|
{
|
||||||
GObject *object;
|
GObject *object;
|
||||||
NMModemGenericPrivate *priv;
|
NMModemOldPrivate *priv;
|
||||||
DBusGConnection *bus;
|
DBusGConnection *bus;
|
||||||
|
|
||||||
object = G_OBJECT_CLASS (nm_modem_generic_parent_class)->constructor (type, n_construct_params, construct_params);
|
object = G_OBJECT_CLASS (nm_modem_old_parent_class)->constructor (type, n_construct_params, construct_params);
|
||||||
if (!object)
|
if (!object)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
priv = NM_MODEM_GENERIC_GET_PRIVATE (object);
|
priv = NM_MODEM_OLD_GET_PRIVATE (object);
|
||||||
|
|
||||||
bus = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
bus = nm_dbus_manager_get_connection (nm_dbus_manager_get ());
|
||||||
priv->proxy = dbus_g_proxy_new_for_name (bus,
|
priv->proxy = dbus_g_proxy_new_for_name (bus,
|
||||||
@@ -392,7 +391,7 @@ constructor (GType type,
|
|||||||
object,
|
object,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
query_mm_enabled (NM_MODEM_GENERIC (object));
|
query_mm_enabled (NM_MODEM_OLD (object));
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
@@ -400,7 +399,7 @@ constructor (GType type,
|
|||||||
static void
|
static void
|
||||||
dispose (GObject *object)
|
dispose (GObject *object)
|
||||||
{
|
{
|
||||||
NMModemGenericPrivate *priv = NM_MODEM_GENERIC_GET_PRIVATE (object);
|
NMModemOldPrivate *priv = NM_MODEM_OLD_GET_PRIVATE (object);
|
||||||
|
|
||||||
if (priv->proxy) {
|
if (priv->proxy) {
|
||||||
g_object_unref (priv->proxy);
|
g_object_unref (priv->proxy);
|
||||||
@@ -412,16 +411,16 @@ dispose (GObject *object)
|
|||||||
priv->props_proxy = NULL;
|
priv->props_proxy = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_modem_generic_parent_class)->dispose (object);
|
G_OBJECT_CLASS (nm_modem_old_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_modem_generic_class_init (NMModemGenericClass *klass)
|
nm_modem_old_class_init (NMModemOldClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMModemClass *modem_class = NM_MODEM_CLASS (klass);
|
NMModemClass *modem_class = NM_MODEM_CLASS (klass);
|
||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (NMModemGenericPrivate));
|
g_type_class_add_private (object_class, sizeof (NMModemOldPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
/* Virtual methods */
|
||||||
object_class->constructor = constructor;
|
object_class->constructor = constructor;
|
@@ -19,8 +19,8 @@
|
|||||||
* Copyright (C) 2009 Novell, Inc.
|
* Copyright (C) 2009 Novell, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NM_MODEM_GENERIC_H
|
#ifndef NM_MODEM_OLD_H
|
||||||
#define NM_MODEM_GENERIC_H
|
#define NM_MODEM_OLD_H
|
||||||
|
|
||||||
#include <dbus/dbus-glib.h>
|
#include <dbus/dbus-glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
@@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define NM_TYPE_MODEM_GENERIC (nm_modem_generic_get_type ())
|
#define NM_TYPE_MODEM_OLD (nm_modem_old_get_type ())
|
||||||
#define NM_MODEM_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_GENERIC, NMModemGeneric))
|
#define NM_MODEM_OLD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_OLD, NMModemOld))
|
||||||
#define NM_MODEM_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_GENERIC, NMModemGenericClass))
|
#define NM_MODEM_OLD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_OLD, NMModemOldClass))
|
||||||
#define NM_IS_MODEM_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_GENERIC))
|
#define NM_IS_MODEM_OLD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_OLD))
|
||||||
#define NM_IS_MODEM_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_GENERIC))
|
#define NM_IS_MODEM_OLD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_OLD))
|
||||||
#define NM_MODEM_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_GENERIC, NMModemGenericClass))
|
#define NM_MODEM_OLD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_OLD, NMModemOldClass))
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NM_MODEM_STATE_UNKNOWN = 0,
|
NM_MODEM_STATE_UNKNOWN = 0,
|
||||||
@@ -52,18 +52,17 @@ typedef enum {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMModem parent;
|
NMModem parent;
|
||||||
} NMModemGeneric;
|
} NMModemOld;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMModemClass parent;
|
NMModemClass parent;
|
||||||
} NMModemGenericClass;
|
} NMModemOldClass;
|
||||||
|
|
||||||
GType nm_modem_generic_get_type (void);
|
GType nm_modem_old_get_type (void);
|
||||||
|
|
||||||
/* Protected */
|
/* Protected */
|
||||||
DBusGProxy *nm_modem_generic_get_proxy (NMModemGeneric *modem,
|
DBusGProxy *nm_modem_old_get_proxy (NMModemOld *modem, const gchar *interface);
|
||||||
const gchar *interface);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* NM_MODEM_GENERIC_H */
|
#endif /* NM_MODEM_OLD_H */
|
@@ -26,7 +26,6 @@
|
|||||||
#include "nm-dbus-manager.h"
|
#include "nm-dbus-manager.h"
|
||||||
#include "nm-setting-connection.h"
|
#include "nm-setting-connection.h"
|
||||||
#include "nm-properties-changed-signal.h"
|
#include "nm-properties-changed-signal.h"
|
||||||
#include "nm-modem-types.h"
|
|
||||||
#include "nm-logging.h"
|
#include "nm-logging.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
#include "nm-device-private.h"
|
#include "nm-device-private.h"
|
||||||
|
Reference in New Issue
Block a user