aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-08-10 10:21:36 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-23 19:10:58 +0200
commit32ece9fa0baeb1a95873858dff947da99dffd07f (patch)
treee793773bfabfc81e17eb4cd8a82345f96d3cd878
parent88f08390df07b9bff9262647de628948014f668a (diff)
broadband-modem-qmi: don't rely on the detailed service status to get HDR reg
The 'detailed service status' TLV is either pretty new and not always available, or given only under some specific circumstances. So, try to gather CDMA1x and EV-DO registration status with the default info we usually do get. The logic is the following: * If registered and the access technologies contain CDMA1x, then CDMA1x is registered, otherwise it's not. * If registered and the access technologies contain any of the EV-DO revisions, then EV-DO is registered, otherwise it's not. An example output in a CDMA network: [/dev/cdc-wdm0] Successfully got serving system: Registration state: 'registered' CS: 'attached' PS: 'attached' Selected network: '3gpp2' Radio interfaces: '2' [0]: 'cdma-1xevdo' [1]: 'cdma-1x' Roaming status: 'off' Data service capabilities: '2' [0]: 'cdma' [1]: 'evdo-rev-a' Current PLMN: MCC: '311' MNC: '480' Description: 'Verizon Wireless' CDMA System ID: SID: '26' ESN: '1' CDMA Base station info: Base station ID: '3633' Latitude: '44.913333'º Longitude: '-93.279722'º Roaming indicators: '2' [0]: '(null)' (cdma-1x) [1]: '(null)' (none) Default roaming status: '(null)' 3GPP2 time zone: Leap seconds: '16' seconds Local time offset: '-300' minutes Daylight saving time: 'no' CDMA P_Rev: '6'
-rw-r--r--src/mm-broadband-modem-qmi.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 080c5cfd..4ad4f0e5 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -4031,8 +4031,6 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
QmiNasNetworkType selected_network;
GArray *radio_interfaces;
GArray *data_service_capabilities;
- QmiNasServiceStatus hdr_status;
- gboolean hdr_hybrid;
MMModemAccessTechnology mm_access_technologies;
MMModemCdmaRegistrationState mm_cdma1x_registration_state;
MMModemCdmaRegistrationState mm_evdo_registration_state;
@@ -4101,38 +4099,19 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
/* TODO: Roaming flags */
/* Build registration states */
- mm_cdma1x_registration_state = qmi_registration_state_to_cdma_registration_state (registration_state);
- hdr_status = QMI_NAS_SERVICE_STATUS_NONE;
- hdr_hybrid = FALSE;
- if (response_output)
- qmi_message_nas_get_serving_system_output_get_detailed_service_status (
- response_output,
- NULL, /* status */
- NULL, /* capability */
- &hdr_status,
- &hdr_hybrid,
- NULL, /* forbidden */
- NULL);
+ if (mm_access_technologies & MM_IFACE_MODEM_CDMA_ALL_CDMA1X_ACCESS_TECHNOLOGIES_MASK)
+ mm_cdma1x_registration_state = qmi_registration_state_to_cdma_registration_state (registration_state);
else
- qmi_indication_nas_serving_system_output_get_detailed_service_status (
- indication_output,
- NULL, /* status */
- NULL, /* capability */
- &hdr_status,
- &hdr_hybrid,
- NULL, /* forbidden */
- NULL);
+ mm_cdma1x_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
- if (hdr_hybrid &&
- (hdr_status == QMI_NAS_SERVICE_STATUS_LIMITED ||
- hdr_status == QMI_NAS_SERVICE_STATUS_AVAILABLE ||
- hdr_status == QMI_NAS_SERVICE_STATUS_LIMITED_REGIONAL ||
- hdr_status == QMI_NAS_SERVICE_STATUS_POWER_SAVE))
- mm_evdo_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_REGISTERED;
+ if (mm_access_technologies & MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK)
+ mm_evdo_registration_state = qmi_registration_state_to_cdma_registration_state (registration_state);
else
mm_evdo_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
+ /* Note: don't rely on the 'Detailed Service Status', it's not always given. */
+
/* Report new registration states */
mm_iface_modem_cdma_update_cdma1x_registration_state (MM_IFACE_MODEM_CDMA (self),
mm_cdma1x_registration_state,