diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-03-27 15:14:34 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-03-28 20:06:53 +0100 |
commit | d9cf4fe91c21eb045cc4718d73cf2210b945d273 (patch) | |
tree | 0974564a466ae7fcf233e5c6670895da91bff5b6 | |
parent | fea5b7a670ac64775771ccd3d3b635d4878d6ba9 (diff) |
iface-modem-3gpp: let plugins ignore facility locks
Plugins may decide which facility locks can be completely skipped from the list
being checked.
-rw-r--r-- | src/mm-broadband-modem.c | 24 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 9 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.h | 11 |
3 files changed, 39 insertions, 5 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 978e6e14..7493ccde 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -87,6 +87,7 @@ enum { PROP_MODEM_3GPP_CS_NETWORK_SUPPORTED, PROP_MODEM_3GPP_PS_NETWORK_SUPPORTED, PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED, + PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS, PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE, PROP_MODEM_CDMA_EVDO_REGISTRATION_STATE, PROP_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED, @@ -134,6 +135,7 @@ struct _MMBroadbandModemPrivate { gboolean modem_3gpp_eps_network_supported; /* Implementation helpers */ GPtrArray *modem_3gpp_registration_regex; + MMModem3gppFacility modem_3gpp_ignored_facility_locks; /*<--- Modem 3GPP USSD interface --->*/ /* Properties */ @@ -3054,6 +3056,17 @@ clck_test_ready (MMBaseModem *self, return; } + /* Ignore facility locks specified by the plugins */ + if (MM_BROADBAND_MODEM (self)->priv->modem_3gpp_ignored_facility_locks) { + gchar *str; + + str = mm_modem_3gpp_facility_build_string_from_mask (MM_BROADBAND_MODEM (self)->priv->modem_3gpp_ignored_facility_locks); + mm_dbg ("Ignoring facility locks: '%s'", str); + g_free (str); + + ctx->facilities &= ~MM_BROADBAND_MODEM (self)->priv->modem_3gpp_ignored_facility_locks; + } + /* Go on... */ get_next_facility_lock_status (ctx); } @@ -8960,6 +8973,9 @@ set_property (GObject *object, case PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED: self->priv->modem_3gpp_eps_network_supported = g_value_get_boolean (value); break; + case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS: + self->priv->modem_3gpp_ignored_facility_locks = g_value_get_flags (value); + break; case PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE: self->priv->modem_cdma_cdma1x_registration_state = g_value_get_enum (value); break; @@ -9049,6 +9065,9 @@ get_property (GObject *object, case PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED: g_value_set_boolean (value, self->priv->modem_3gpp_eps_network_supported); break; + case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS: + g_value_set_flags (value, self->priv->modem_3gpp_ignored_facility_locks); + break; case PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE: g_value_set_enum (value, self->priv->modem_cdma_cdma1x_registration_state); break; @@ -9093,6 +9112,7 @@ mm_broadband_modem_init (MMBroadbandModem *self) self->priv->modem_3gpp_cs_network_supported = TRUE; self->priv->modem_3gpp_ps_network_supported = TRUE; self->priv->modem_3gpp_eps_network_supported = FALSE; + self->priv->modem_3gpp_ignored_facility_locks = MM_MODEM_3GPP_FACILITY_NONE; self->priv->modem_cdma_cdma1x_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; self->priv->modem_cdma_evdo_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN; self->priv->modem_cdma_cdma1x_network_supported = TRUE; @@ -9458,6 +9478,10 @@ mm_broadband_modem_class_init (MMBroadbandModemClass *klass) MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED); g_object_class_override_property (object_class, + PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS, + MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS); + + g_object_class_override_property (object_class, PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE, MM_IFACE_MODEM_CDMA_CDMA1X_REGISTRATION_STATE); diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index 329ac1f7..6ec07a68 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -2148,6 +2148,15 @@ iface_modem_3gpp_init (gpointer g_iface) FALSE, G_PARAM_READWRITE)); + g_object_interface_install_property + (g_iface, + g_param_spec_flags (MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS, + "Ignored locks", + "Ignored facility locks", + MM_TYPE_MODEM_3GPP_FACILITY, + MM_MODEM_3GPP_FACILITY_NONE, + G_PARAM_READWRITE)); + initialized = TRUE; } diff --git a/src/mm-iface-modem-3gpp.h b/src/mm-iface-modem-3gpp.h index caf2575d..f4014c40 100644 --- a/src/mm-iface-modem-3gpp.h +++ b/src/mm-iface-modem-3gpp.h @@ -28,11 +28,12 @@ #define MM_IS_IFACE_MODEM_3GPP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_3GPP)) #define MM_IFACE_MODEM_3GPP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_3GPP, MMIfaceModem3gpp)) -#define MM_IFACE_MODEM_3GPP_DBUS_SKELETON "iface-modem-3gpp-dbus-skeleton" -#define MM_IFACE_MODEM_3GPP_REGISTRATION_STATE "iface-modem-3gpp-registration-state" -#define MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED "iface-modem-3gpp-cs-network-supported" -#define MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED "iface-modem-3gpp-ps-network-supported" -#define MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED "iface-modem-3gpp-eps-network-supported" +#define MM_IFACE_MODEM_3GPP_DBUS_SKELETON "iface-modem-3gpp-dbus-skeleton" +#define MM_IFACE_MODEM_3GPP_REGISTRATION_STATE "iface-modem-3gpp-registration-state" +#define MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED "iface-modem-3gpp-cs-network-supported" +#define MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED "iface-modem-3gpp-ps-network-supported" +#define MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED "iface-modem-3gpp-eps-network-supported" +#define MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS "iface-modem-3gpp-ignored-facility-locks" #define MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK \ (MM_MODEM_ACCESS_TECHNOLOGY_GSM | \ |