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 /src/mm-generic-cdma.h | |
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 'src/mm-generic-cdma.h')
-rw-r--r-- | src/mm-generic-cdma.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mm-generic-cdma.h b/src/mm-generic-cdma.h index 4fbb416a..e4f9e57e 100644 --- a/src/mm-generic-cdma.h +++ b/src/mm-generic-cdma.h @@ -42,7 +42,27 @@ typedef struct { typedef struct { MMModemBaseClass parent; + /* Subclasses should implement this function if they can more accurately + * determine the registration state and/or roaming status than the base + * class can (by using manufacturer custom AT commands or whatever). + * The base class passes its detected registration state in the + * cur_cdma_state and cur_evdo_state arguments, which the subclass should + * override if necessary before passing to the callback. + * + * Subclasses can use the helper functions + * mm_generic_cdma_query_reg_state_callback_info_new(), + * mm_generic_cdma_query_reg_state_set_callback_1x_state(), and + * mm_generic_cdma_query_reg_state_set_callback_evdo_state() to create the + * MMCallbackInfo object and to set the registration state which is passed + * to the callback when the subclass' registration query completes. + * + * Subclasses should generally not return parsing or other non-critical + * errors to the callback since that fails the entire registration check, + * rendering the superclass' checks useless. + */ void (*query_registration_state) (MMGenericCdma *self, + MMModemCdmaRegistrationState cur_cdma_state, + MMModemCdmaRegistrationState cur_evdo_state, MMModemCdmaRegistrationStateFn callback, gpointer user_data); @@ -100,12 +120,18 @@ MMModemCdmaRegistrationState mm_generic_cdma_evdo_get_registration_state_sync (M /* query_registration_state class function helpers */ MMCallbackInfo *mm_generic_cdma_query_reg_state_callback_info_new (MMGenericCdma *self, + MMModemCdmaRegistrationState cur_cdma_state, + MMModemCdmaRegistrationState cur_evdo_state, MMModemCdmaRegistrationStateFn callback, gpointer user_data); +MMModemCdmaRegistrationState mm_generic_cdma_query_reg_state_get_callback_1x_state (MMCallbackInfo *info); + void mm_generic_cdma_query_reg_state_set_callback_1x_state (MMCallbackInfo *info, MMModemCdmaRegistrationState new_state); +MMModemCdmaRegistrationState mm_generic_cdma_query_reg_state_get_callback_evdo_state (MMCallbackInfo *info); + void mm_generic_cdma_query_reg_state_set_callback_evdo_state (MMCallbackInfo *info, MMModemCdmaRegistrationState new_state); |