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'
This commit is contained in:
Aleksander Morgado
2012-08-10 10:21:36 +02:00
parent 1f82cd1a32
commit 7369f16759

View File

@@ -4031,8 +4031,6 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
QmiNasNetworkType selected_network; QmiNasNetworkType selected_network;
GArray *radio_interfaces; GArray *radio_interfaces;
GArray *data_service_capabilities; GArray *data_service_capabilities;
QmiNasServiceStatus hdr_status;
gboolean hdr_hybrid;
MMModemAccessTechnology mm_access_technologies; MMModemAccessTechnology mm_access_technologies;
MMModemCdmaRegistrationState mm_cdma1x_registration_state; MMModemCdmaRegistrationState mm_cdma1x_registration_state;
MMModemCdmaRegistrationState mm_evdo_registration_state; MMModemCdmaRegistrationState mm_evdo_registration_state;
@@ -4101,38 +4099,19 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
/* TODO: Roaming flags */ /* TODO: Roaming flags */
/* Build registration states */ /* Build registration states */
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); 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);
else else
qmi_indication_nas_serving_system_output_get_detailed_service_status ( mm_cdma1x_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
indication_output,
NULL, /* status */
NULL, /* capability */
&hdr_status,
&hdr_hybrid,
NULL, /* forbidden */
NULL);
if (hdr_hybrid && if (mm_access_technologies & MM_IFACE_MODEM_CDMA_ALL_EVDO_ACCESS_TECHNOLOGIES_MASK)
(hdr_status == QMI_NAS_SERVICE_STATUS_LIMITED || mm_evdo_registration_state = qmi_registration_state_to_cdma_registration_state (registration_state);
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;
else else
mm_evdo_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; 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 */ /* Report new registration states */
mm_iface_modem_cdma_update_cdma1x_registration_state (MM_IFACE_MODEM_CDMA (self), mm_iface_modem_cdma_update_cdma1x_registration_state (MM_IFACE_MODEM_CDMA (self),
mm_cdma1x_registration_state, mm_cdma1x_registration_state,