2007-11-28 Tambet Ingo <tambet@gmail.com>
Merge the beginnings of the new GSM card support. * src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_stop): Remove * the ppp watch source before killing pppd - If this happens from g_object_unref() then the ppp manager is already destroyed by the time the watch callback runs. * src/nm-hal-manager.c: Add a device_type_name string to the * device creators, so that we can print a nice human readable string when a device is added. * src/nm-umts-device.c (automatic_registration_get_network): * Query for the activated network, not much is done with the result thought. * src/nm-serial-device.c (nm_serial_device_get_reply): * Implement. (ppp_ip4_config): Change the device state to activated here for now. (real_check_connection): Make sure the connection includes ppp setting. * libnm-glib/nm-client.c (get_device): Handle umts devices. * libnm-glib/Makefile.am: Add the new files to build. * libnm-glib/nm-umts-device.c: * libnm-glib/nm-umts-device.h: Implement. 2007-11-26 Tambet Ingo <tambet@gmail.com> * src/nm-umts-device.c (automatic_registration_get_network): For * now, dial immediately, nm_serial_device_get_reply() isn't implemented correctly yet. * src/nm-serial-device.c (wait_for_reply_info_destroy): Don't * try to remove the timeout source - this function is only called when the timeout source has been removed. (nm_serial_device_wait_for_reply): Allocate the duplicate responses array to be big enough to contain the terminating zero element as well. The timeout argument is meant to be in seconds now. (real_deactivate_quickly): Implement. * src/NetworkManager.conf: Allow root to own "org.freedesktop.NetworkManager.PPP", deny it for everybody else. * libnm-util/nm-setting-umts.c: Network type and band properties * are ints, (not unsigned ints). * libnm-util/nm-setting-serial.c (nm_setting_serial_class_init): * Fix a small issue with parity bounds - capital letters have lower ascii codes than lower case letters. * libnm-util/nm-connection.c (register_default_settings): * Register serial and umts settings. 2007-11-22 Tambet Ingo <tambet@gmail.com> Remove the "index" property from devices as not all device types have this. * include/NetworkManager.h (NM_DBUS_PATH_DEVICE): Remove. * src/nm-hal-manager.c (nm_get_device_index_from_hal): Remove. (wired_device_creator): Get the device interface from hal to create the device. (wireless_device_creator): Ditto. * src/nm-device.c (nm_device_init): Remove the index member. (constructor): Remove the checks for index property, make interface property a require constructor property. Use the HAL udi for DBus path for devices. (nm_device_get_index): Remove. (set_property): Remove index handling. (get_property): Ditto. (nm_device_get_dbus_path): Remove. * src/nm-device-interface.c (nm_device_interface_init): Remove * the index property. * src/nm-device-802-3-ethernet.c * (nm_device_802_3_ethernet_link_activated): Access the device index through it's interface. (nm_device_802_3_ethernet_link_deactivated): Ditto. (nm_device_802_3_ethernet_new): Remove the useless argument test_dev. Remove index argument. Add interface argument. * src/nm-device-802-11-wireless.c * (nm_device_802_11_wireless_new): Remove the useless test_dev argument. Remove index argument. Add interface arugment. * src/NetworkManagerSystem.c * (nm_system_device_set_from_ip4_config): Get the device index through interface. (nm_system_set_mtu): Ditto. * introspection/nm-device.xml: Remove the "Index" property. 2007-11-21 Tambet Ingo <tambet@gmail.com> * src/nm-serial-device.c: * src/nm-serial-device.c: * src/nm-umts-device.c: * src/nm-umts-device.h: Implement. * src/nm-hal-manager.c (nm_get_device_driver_name): * libhal_free_string the string allocated by libhal. (modem_device_creator): Implement. (register_built_in_creators): Register the modem creator. * src/nm-device-802-11-wireless.c * (nm_device_802_11_wireless_new): Remove the unused test_dev argument. * src/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_new): * Ditto. * src/Makefile.am: Add new files to build. Link in ppp-manager. * libnm-util/nm-setting-umts.c: * libnm-util/nm-setting-umts.h: * libnm-util/nm-setting-serial.c: * libnm-util/nm-setting-serial.h: Implement. * libnm-util/Makefile.am: Add new files to build. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3116 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -58,9 +58,7 @@ struct _NMDevicePrivate
|
||||
|
||||
NMDeviceState state;
|
||||
|
||||
char * dbus_path;
|
||||
char * udi;
|
||||
int index; /* Should always stay the same over lifetime of device */
|
||||
char * iface; /* may change, could be renamed by user */
|
||||
NMDeviceType type;
|
||||
guint32 capabilities;
|
||||
@@ -113,7 +111,6 @@ nm_device_init (NMDevice * self)
|
||||
self->priv->initialized = FALSE;
|
||||
self->priv->udi = NULL;
|
||||
self->priv->iface = NULL;
|
||||
self->priv->index = G_MAXUINT32;
|
||||
self->priv->type = DEVICE_TYPE_UNKNOWN;
|
||||
self->priv->capabilities = NM_DEVICE_CAP_NONE;
|
||||
self->priv->driver = NULL;
|
||||
@@ -142,30 +139,27 @@ constructor (GType type,
|
||||
NMDBusManager *manager;
|
||||
|
||||
object = G_OBJECT_CLASS (nm_device_parent_class)->constructor (type,
|
||||
n_construct_params,
|
||||
construct_params);
|
||||
n_construct_params,
|
||||
construct_params);
|
||||
if (!object)
|
||||
return NULL;
|
||||
|
||||
dev = NM_DEVICE (object);
|
||||
priv = NM_DEVICE_GET_PRIVATE (dev);
|
||||
|
||||
if (priv->index == G_MAXUINT32) {
|
||||
nm_warning ("Interface index is a required constructor property.");
|
||||
if (!priv->udi) {
|
||||
nm_warning ("No device udi provided, ignoring");
|
||||
goto error;
|
||||
}
|
||||
|
||||
priv->iface = nm_netlink_index_to_iface (priv->index);
|
||||
if (priv->iface == NULL) {
|
||||
nm_warning ("(%u): Couldn't get interface name for device, ignoring.",
|
||||
priv->index);
|
||||
if (!priv->iface) {
|
||||
nm_warning ("No device interface provided, ignoring");
|
||||
goto error;
|
||||
}
|
||||
|
||||
priv->capabilities |= NM_DEVICE_GET_CLASS (dev)->get_generic_capabilities (dev);
|
||||
if (!(priv->capabilities & NM_DEVICE_CAP_NM_SUPPORTED)) {
|
||||
nm_warning ("(%s): Device unsupported, ignoring.",
|
||||
nm_device_get_iface (dev));
|
||||
nm_warning ("(%s): Device unsupported, ignoring.", priv->iface);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -174,27 +168,17 @@ constructor (GType type,
|
||||
|
||||
/* Allow distributions to flag devices as disabled */
|
||||
if (nm_system_device_get_disabled (dev)) {
|
||||
nm_warning ("(%s): Device otherwise managed, ignoring.",
|
||||
nm_device_get_iface (dev));
|
||||
nm_warning ("(%s): Device otherwise managed, ignoring.", priv->iface);
|
||||
goto error;
|
||||
}
|
||||
|
||||
nm_print_device_capabilities (dev);
|
||||
|
||||
manager = nm_dbus_manager_get ();
|
||||
priv->dbus_path = g_strdup_printf ("%s/%d",
|
||||
NM_DBUS_PATH_DEVICE,
|
||||
nm_device_get_index (dev));
|
||||
if (priv->dbus_path == NULL) {
|
||||
nm_warning ("(%s): Not enough memory to initialize device.",
|
||||
nm_device_get_iface (dev));
|
||||
goto error;
|
||||
}
|
||||
|
||||
nm_info ("(%s): exporting device as %s", nm_device_get_iface (dev), nm_device_get_dbus_path (dev));
|
||||
nm_info ("(%s): exporting device as %s", priv->iface, priv->udi);
|
||||
dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (manager),
|
||||
nm_device_get_dbus_path (dev),
|
||||
object);
|
||||
priv->udi, object);
|
||||
|
||||
g_object_unref (manager);
|
||||
|
||||
@@ -245,14 +229,6 @@ real_get_generic_capabilities (NMDevice *dev)
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
nm_device_get_dbus_path (NMDevice *self)
|
||||
{
|
||||
g_return_val_if_fail (self != NULL, NULL);
|
||||
|
||||
return self->priv->dbus_path;
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_device_get_udi (NMDevice *self)
|
||||
{
|
||||
@@ -261,14 +237,6 @@ nm_device_get_udi (NMDevice *self)
|
||||
return self->priv->udi;
|
||||
}
|
||||
|
||||
guint32
|
||||
nm_device_get_index (NMDevice *self)
|
||||
{
|
||||
g_return_val_if_fail (self != NULL, G_MAXUINT32);
|
||||
|
||||
return self->priv->index;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get/set functions for iface
|
||||
*/
|
||||
@@ -1595,8 +1563,9 @@ set_property (GObject *object, guint prop_id,
|
||||
/* construct-only */
|
||||
priv->udi = g_strdup (g_value_get_string (value));
|
||||
break;
|
||||
case NM_DEVICE_INTERFACE_PROP_INDEX:
|
||||
priv->index = g_value_get_uint (value);
|
||||
case NM_DEVICE_INTERFACE_PROP_IFACE:
|
||||
g_free (priv->iface);
|
||||
priv->iface = g_value_dup_string (value);
|
||||
break;
|
||||
case NM_DEVICE_INTERFACE_PROP_DRIVER:
|
||||
priv->driver = g_strdup (g_value_get_string (value));
|
||||
@@ -1623,9 +1592,6 @@ get_property (GObject *object, guint prop_id,
|
||||
case NM_DEVICE_INTERFACE_PROP_UDI:
|
||||
g_value_set_string (value, priv->udi);
|
||||
break;
|
||||
case NM_DEVICE_INTERFACE_PROP_INDEX:
|
||||
g_value_set_uint (value, priv->index);
|
||||
break;
|
||||
case NM_DEVICE_INTERFACE_PROP_IFACE:
|
||||
g_value_set_string (value, priv->iface);
|
||||
break;
|
||||
@@ -1687,10 +1653,6 @@ nm_device_class_init (NMDeviceClass *klass)
|
||||
NM_DEVICE_INTERFACE_PROP_UDI,
|
||||
NM_DEVICE_INTERFACE_UDI);
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
NM_DEVICE_INTERFACE_PROP_INDEX,
|
||||
NM_DEVICE_INTERFACE_INDEX);
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
NM_DEVICE_INTERFACE_PROP_IFACE,
|
||||
NM_DEVICE_INTERFACE_IFACE);
|
||||
|
Reference in New Issue
Block a user