summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-11-02 09:52:31 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-11-02 09:52:31 +0100
commit9ec90d9a11f53c91274a1341217e7da5f8621674 (patch)
tree2dc913f810b07b1d31cd78272932011e3df0d961
parent96305bb5c1d32e5a0e517750501b705502e74111 (diff)
core,plugins: don't assume 'CS' supported when '2G' supported
We will not report 'CS' as a supported mode every time '2G' is supported. This actually was forcing all plugins to handle a 'CS' fallback when they didn't have CS-specific mode setup. So, to simplify things, we will only report 'CS' as supported for those plugins which actually allow to select 'CS' mode (e.g. the 'wavecom' plugin).
-rw-r--r--plugins/huawei/mm-broadband-modem-huawei.c7
-rw-r--r--plugins/icera/mm-broadband-modem-icera.c9
-rw-r--r--plugins/linktop/mm-broadband-modem-linktop.c7
-rw-r--r--plugins/longcheer/mm-broadband-modem-longcheer.c7
-rw-r--r--plugins/option/mm-broadband-modem-option.c9
-rw-r--r--plugins/x22x/mm-broadband-modem-x22x.c7
-rw-r--r--plugins/zte/mm-broadband-modem-zte.c7
-rw-r--r--src/mm-broadband-modem.c7
-rw-r--r--src/mm-modem-helpers-qmi.c9
9 files changed, 4 insertions, 65 deletions
diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
index 77441f43..5cac1fdc 100644
--- a/plugins/huawei/mm-broadband-modem-huawei.c
+++ b/plugins/huawei/mm-broadband-modem-huawei.c
@@ -643,19 +643,12 @@ set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
if (!allowed_mode_to_huawei (allowed,
preferred,
&mode,
&acquisition_order,
&error)) {
g_simple_async_result_take_error (result, error);
diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c
index 697e8cc6..e613f84c 100644
--- a/plugins/icera/mm-broadband-modem-icera.c
+++ b/plugins/icera/mm-broadband-modem-icera.c
@@ -110,13 +110,13 @@ modem_load_allowed_modes_finish (MMIfaceModem *self,
return TRUE;
case 3:
*allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
*preferred = MM_MODEM_MODE_3G;
return TRUE;
case 5: /* any */
- *allowed = (MM_MODEM_MODE_CS | MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
+ *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
*preferred = MM_MODEM_MODE_NONE;
return TRUE;
default:
break;
}
@@ -182,19 +182,12 @@ modem_set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
modem_set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
/*
* The core has checked the following:
* - that 'allowed' are a subset of the 'supported' modes
* - that 'preferred' is one mode, and a subset of 'allowed'
*/
if (allowed == MM_MODEM_MODE_2G)
diff --git a/plugins/linktop/mm-broadband-modem-linktop.c b/plugins/linktop/mm-broadband-modem-linktop.c
index c34cf09a..49722819 100644
--- a/plugins/linktop/mm-broadband-modem-linktop.c
+++ b/plugins/linktop/mm-broadband-modem-linktop.c
@@ -150,19 +150,12 @@ set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
if (allowed == MM_MODEM_MODE_2G)
linktop_mode = LINKTOP_MODE_2G;
else if (allowed == MM_MODEM_MODE_3G)
linktop_mode = LINKTOP_MODE_3G;
else if ((allowed == (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G)) &&
(preferred == MM_MODEM_MODE_NONE)) {
diff --git a/plugins/longcheer/mm-broadband-modem-longcheer.c b/plugins/longcheer/mm-broadband-modem-longcheer.c
index 1e52c2ea..9734eb8f 100644
--- a/plugins/longcheer/mm-broadband-modem-longcheer.c
+++ b/plugins/longcheer/mm-broadband-modem-longcheer.c
@@ -145,19 +145,12 @@ set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
if (allowed == MM_MODEM_MODE_2G)
mododr = 3;
else if (allowed == MM_MODEM_MODE_3G)
mododr = 1;
else if (allowed == MM_MODEM_MODE_ANY &&
preferred == MM_MODEM_MODE_NONE)
diff --git a/plugins/option/mm-broadband-modem-option.c b/plugins/option/mm-broadband-modem-option.c
index 4acd16ac..274b2875 100644
--- a/plugins/option/mm-broadband-modem-option.c
+++ b/plugins/option/mm-broadband-modem-option.c
@@ -100,13 +100,13 @@ load_allowed_modes_finish (MMIfaceModem *self,
return TRUE;
case 3:
*allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
*preferred = MM_MODEM_MODE_3G;
return TRUE;
case 5: /* any */
- *allowed = (MM_MODEM_MODE_CS | MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
+ *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
*preferred = MM_MODEM_MODE_NONE;
return TRUE;
default:
break;
}
@@ -172,19 +172,12 @@ set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
if (allowed == MM_MODEM_MODE_2G)
option_mode = 0;
else if (allowed == MM_MODEM_MODE_3G)
option_mode = 1;
else if (allowed == (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G)) {
if (preferred == MM_MODEM_MODE_2G)
diff --git a/plugins/x22x/mm-broadband-modem-x22x.c b/plugins/x22x/mm-broadband-modem-x22x.c
index b7b16891..f61845a7 100644
--- a/plugins/x22x/mm-broadband-modem-x22x.c
+++ b/plugins/x22x/mm-broadband-modem-x22x.c
@@ -150,19 +150,12 @@ set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
if (allowed == MM_MODEM_MODE_2G)
syssel = 1;
else if (allowed == MM_MODEM_MODE_3G)
syssel = 2;
else if (allowed == MM_MODEM_MODE_ANY &&
preferred == MM_MODEM_MODE_NONE)
diff --git a/plugins/zte/mm-broadband-modem-zte.c b/plugins/zte/mm-broadband-modem-zte.c
index dc0898e9..e9bc99f0 100644
--- a/plugins/zte/mm-broadband-modem-zte.c
+++ b/plugins/zte/mm-broadband-modem-zte.c
@@ -315,19 +315,12 @@ set_allowed_modes (MMIfaceModem *self,
result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
set_allowed_modes);
- /* There is no explicit config for CS connections, we just assume we may
- * have them as part of 2G when no GPRS is available */
- if (allowed & MM_MODEM_MODE_CS) {
- allowed |= MM_MODEM_MODE_2G;
- allowed &= ~MM_MODEM_MODE_CS;
- }
-
if (allowed == MM_MODEM_MODE_2G) {
cm_mode = 1;
pref_acq = 0;
} else if (allowed == MM_MODEM_MODE_3G) {
cm_mode = 2;
pref_acq = 0;
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 95a61cdb..9161c82c 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -1202,19 +1202,12 @@ supported_modes_ws46_test_ready (MMBroadbandModem *self,
if (ctx->self->priv->modem_3gpp_ps_network_supported) {
mm_dbg ("Assuming device allows (3GPP) 2G/3G network modes");
ctx->mode |= (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G);
}
}
- /* We'll assume CS supported if we have 2G */
- if (!(ctx->mode & MM_MODEM_MODE_CS) &&
- ctx->mode & MM_MODEM_MODE_2G) {
- mm_dbg ("Assuming device allows (3GPP) 2G/3G network modes");
- ctx->mode |= MM_MODEM_MODE_CS;
- }
-
/* Now keep on with the loading, we may need CDMA-specific checks */
ctx->run_ws46 = FALSE;
load_supported_modes_step (ctx);
}
static void
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c
index 0b727791..f121fc9d 100644
--- a/src/mm-modem-helpers-qmi.c
+++ b/src/mm-modem-helpers-qmi.c
@@ -748,23 +748,22 @@ mm_modem_access_technologies_from_qmi_data_capability_array (GArray *data_capabi
MMModemMode
mm_modem_mode_from_qmi_radio_technology_preference (QmiNasRadioTechnologyPreference qmi)
{
MMModemMode mode = MM_MODEM_MODE_NONE;
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_3GPP2) {
- if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AMPS_OR_GSM)
- mode |= MM_MODEM_MODE_CS; /* AMPS */
+ /* Ignore AMPS, we really don't report CS mode in QMI modems */
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_CDMA_OR_WCDMA)
mode |= MM_MODEM_MODE_2G; /* CDMA */
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_HDR)
mode |= MM_MODEM_MODE_3G; /* EV-DO */
}
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_3GPP) {
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_AMPS_OR_GSM)
- mode |= (MM_MODEM_MODE_CS | MM_MODEM_MODE_2G); /* GSM */
+ mode |= MM_MODEM_MODE_2G; /* GSM */
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_CDMA_OR_WCDMA)
mode |= MM_MODEM_MODE_3G; /* WCDMA */
}
if (qmi & QMI_NAS_RADIO_TECHNOLOGY_PREFERENCE_LTE)
mode |= MM_MODEM_MODE_4G;
@@ -817,16 +816,12 @@ mm_modem_mode_from_qmi_rat_mode_preference (QmiNasRatModePreference qmi)
if (qmi & QMI_NAS_RAT_MODE_PREFERENCE_UMTS)
mode |= MM_MODEM_MODE_3G;
if (qmi & QMI_NAS_RAT_MODE_PREFERENCE_LTE)
mode |= MM_MODEM_MODE_4G;
- /* Assume CS if 2G supported */
- if (mode & MM_MODEM_MODE_2G)
- mode |= MM_MODEM_MODE_CS;
-
return mode;
}
QmiNasRatModePreference
mm_modem_mode_to_qmi_rat_mode_preference (MMModemMode mode,
gboolean is_cdma,