diff options
author | Dan Williams <dcbw@redhat.com> | 2010-03-10 16:30:58 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-03-10 16:30:58 -0800 |
commit | 13bc593a291a5bb5ff004b553268443b5d2c83aa (patch) | |
tree | bc97368a3d22c3f98f11c07b3292e07ec186bcbf | |
parent | 8f50dd319189c0a9aef4d41957450096029f4b60 (diff) |
gsm: ensure PDP context deactivation happens on disconnect
The port is still connected until disconnect_done() runs, but by
this point we already know it's been disconnected so it's safe to
run the CGACT commands.
-rw-r--r-- | src/mm-generic-gsm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index e9100b34..cab564ae 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -1966,13 +1966,19 @@ disconnect_flash_done (MMSerialPort *port, char *command; info->error = mm_modem_check_removed (info->modem, error); - if (info->error) { + /* Ignore NO_CARRIER errors and proceed with the PDP context deactivation */ + if ( info->error + && !g_error_matches (info->error, + MM_MODEM_CONNECT_ERROR, + MM_MODEM_CONNECT_ERROR_NO_CARRIER)) { mm_callback_info_schedule (info); return; } - /* Disconnect the PDP context */ priv = MM_GENERIC_GSM_GET_PRIVATE (info->modem); + mm_port_set_connected (priv->data, FALSE); + + /* Disconnect the PDP context */ if (priv->cid >= 0) command = g_strdup_printf ("+CGACT=0,%d", priv->cid); else { @@ -1980,7 +1986,7 @@ disconnect_flash_done (MMSerialPort *port, command = g_strdup_printf ("+CGACT=0"); } - mm_serial_port_queue_command (port, command, 60, disconnect_cgact_done, info); + mm_serial_port_queue_command (port, command, 3, disconnect_cgact_done, info); g_free (command); } |