From e5c5411d0514f121e9c98c2b49b6d9a11a60cc1a Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 13 Jan 2012 11:41:47 +0100 Subject: broadband-modem: redefine generic supported mode loading implementation * assume CDMA1x is 2G * consider CS/PS/CDMA1x/EVDO network support flags specified by the plugins --- src/mm-broadband-modem.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 1d4d1a4d..01d0aa48 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -906,7 +906,7 @@ modem_load_supported_modes (MMIfaceModem *self, GSimpleAsyncResult *result; MMModemMode mode; - mm_dbg ("loading supported modes..."); + mm_dbg ("loading initial supported modes..."); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, @@ -914,13 +914,24 @@ modem_load_supported_modes (MMIfaceModem *self, mode = MM_MODEM_MODE_NONE; - /* If the modem has +GSM caps, assume it does CS, 2G and 3G */ + /* If the modem has +GSM caps... */ if (broadband->priv->modem_current_capabilities & MM_MODEM_CAPABILITY_GSM_UMTS) { - mode |= (MM_MODEM_MODE_CS | MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); + /* There are modems which only support CS connections (e.g. Iridium) */ + if (broadband->priv->modem_3gpp_cs_network_supported) + mode |= MM_MODEM_MODE_CS; + /* If PS supported, assume we can do both 2G and 3G, even if it may not really + * be true. This is the generic implementation anyway, plugins can use modem + * specific commands to check which technologies are supported. */ + if (broadband->priv->modem_3gpp_ps_network_supported) + mode |= (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); } - /* If the modem has CDMA caps, assume it does 3G */ - else if (broadband->priv->modem_current_capabilities & MM_MODEM_CAPABILITY_CDMA_EVDO) { - mode |= MM_MODEM_MODE_3G; + + /* If the modem has CDMA caps... */ + if (broadband->priv->modem_current_capabilities & MM_MODEM_CAPABILITY_CDMA_EVDO) { + if (broadband->priv->modem_cdma_cdma1x_network_supported) + mode |= MM_MODEM_MODE_2G; + if (broadband->priv->modem_cdma_evdo_network_supported) + mode |= MM_MODEM_MODE_3G; } /* If the modem has LTE caps, it does 4G */ -- cgit v1.2.3-70-g09d2