2008-08-14 Dan Williams <dcbw@redhat.com>

* src/nm-device.c
		- (nm_device_deactivate_quickly): tear down activation request after
			calling device-specific deactivation

	* src/nm-hso-gsm-device.c
		- (real_deactivate_quickly): terminate connection when deactivating



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3963 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2008-08-14 17:45:47 +00:00
parent dbb7455778
commit 7069202c90
3 changed files with 33 additions and 3 deletions

View File

@@ -1,3 +1,12 @@
2008-08-14 Dan Williams <dcbw@redhat.com>
* src/nm-device.c
- (nm_device_deactivate_quickly): tear down activation request after
calling device-specific deactivation
* src/nm-hso-gsm-device.c
- (real_deactivate_quickly): terminate connection when deactivating
2008-08-14 Dan Williams <dcbw@redhat.com> 2008-08-14 Dan Williams <dcbw@redhat.com>
* src/nm-activation-request.h * src/nm-activation-request.h

View File

@@ -1361,13 +1361,13 @@ nm_device_deactivate_quickly (NMDevice *self)
aipd_cleanup (self); aipd_cleanup (self);
/* Tear down an existing activation request */
clear_act_request (self);
/* Call device type-specific deactivation */ /* Call device type-specific deactivation */
if (NM_DEVICE_GET_CLASS (self)->deactivate_quickly) if (NM_DEVICE_GET_CLASS (self)->deactivate_quickly)
NM_DEVICE_GET_CLASS (self)->deactivate_quickly (self); NM_DEVICE_GET_CLASS (self)->deactivate_quickly (self);
/* Tear down an existing activation request */
clear_act_request (self);
return TRUE; return TRUE;
} }

View File

@@ -390,12 +390,32 @@ static void
real_deactivate_quickly (NMDevice *device) real_deactivate_quickly (NMDevice *device)
{ {
NMHsoGsmDevicePrivate *priv = NM_HSO_GSM_DEVICE_GET_PRIVATE (device); NMHsoGsmDevicePrivate *priv = NM_HSO_GSM_DEVICE_GET_PRIVATE (device);
NMActRequest *req;
guint cid;
char *command;
if (priv->pending_ip4_config) { if (priv->pending_ip4_config) {
g_object_unref (priv->pending_ip4_config); g_object_unref (priv->pending_ip4_config);
priv->pending_ip4_config = NULL; priv->pending_ip4_config = NULL;
} }
/* Don't leave the modem connected */
req = nm_device_get_act_request (device);
if (req) {
cid = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (req), GSM_CID));
if (cid) {
command = g_strdup_printf ("AT_OWANCALL=%d,0,1", cid);
nm_serial_device_send_command_string (NM_SERIAL_DEVICE (device), command);
g_free (command);
/* FIXME: doesn't seem to take the command otherwise, perhaps since
* the serial port gets closed right away
*/
g_usleep (G_USEC_PER_SEC / 3);
}
}
if (NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate_quickly) if (NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate_quickly)
NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate_quickly (device); NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate_quickly (device);
} }
@@ -410,6 +430,7 @@ real_deactivate (NMDevice *device)
nm_system_device_flush_ip4_addresses_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); nm_system_device_set_up_down_with_iface (priv->netdev_iface, FALSE);
} }
nm_device_set_ip_iface (device, NULL);
if (NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate) if (NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate)
NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate (device); NM_DEVICE_CLASS (nm_hso_gsm_device_parent_class)->deactivate (device);