diff options
author | Dan Williams <dcbw@redhat.com> | 2010-04-05 18:46:53 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-04-05 18:46:53 -0700 |
commit | f3dd034aadd16d42f93a682b15a7801537e89d7d (patch) | |
tree | d11b5cd62d2b20ccfd7e332463d860cd7429e171 /plugins/mm-modem-sierra-cdma.c | |
parent | 49c363d83af84021f74f04c8141313d21e75821b (diff) |
cdma: fix subclass registration state checking in error paths (rh #569067)
The generic CDMA superclass already checks minimal registration state,
and when some of the additional query_registration_state() subclass checks
were being performed, if the device returned an error (if it didn't support
the subclass' specific registration command like *STATE or ^SYSINFO) the
superclass' registration state checks would be thrown away.
Fix that by specifying the behavior of the subclass'
query_registration_state() methods to ignore most errors and leave the
superclass' registration state intact if a non-critical error occurs.
Diffstat (limited to 'plugins/mm-modem-sierra-cdma.c')
-rw-r--r-- | plugins/mm-modem-sierra-cdma.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/mm-modem-sierra-cdma.c b/plugins/mm-modem-sierra-cdma.c index 2c3ed7f0..e17851b1 100644 --- a/plugins/mm-modem-sierra-cdma.c +++ b/plugins/mm-modem-sierra-cdma.c @@ -125,13 +125,13 @@ status_done (MMAtSerialPort *port, gboolean cdma_1x_set = FALSE, evdo_set = FALSE; if (error) { - info->error = g_error_copy (error); + /* Leave superclass' reg state alone if AT!STATUS isn't supported */ goto done; } lines = g_strsplit_set (response->str, "\n\r", 0); if (!lines) { - /* Whatever, just use default registration state */ + /* Whatever, just use superclass' registration state */ goto done; } @@ -289,13 +289,15 @@ done: static void query_registration_state (MMGenericCdma *cdma, + MMModemCdmaRegistrationState cur_cdma_state, + MMModemCdmaRegistrationState cur_evdo_state, MMModemCdmaRegistrationStateFn callback, gpointer user_data) { MMCallbackInfo *info; MMAtSerialPort *port; - info = mm_generic_cdma_query_reg_state_callback_info_new (cdma, callback, user_data); + info = mm_generic_cdma_query_reg_state_callback_info_new (cdma, cur_cdma_state, cur_evdo_state, callback, user_data); port = mm_generic_cdma_get_best_at_port (cdma, &info->error); if (!port) { |