aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-24 19:15:50 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-24 19:17:25 +0100
commitbd90ee80943af30ac31ec24e0887c9f8bb84d170 (patch)
tree2d5125c877e000ebef58585fd8928682a183944d
parent43cdb25eb176a18d04de68d1104a630555d7e60d (diff)
option: handle special 'auto' mode when setting allowed/preferred modes
-rw-r--r--plugins/option/mm-broadband-modem-option.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/option/mm-broadband-modem-option.c b/plugins/option/mm-broadband-modem-option.c
index 3622dd62..24fc88cf 100644
--- a/plugins/option/mm-broadband-modem-option.c
+++ b/plugins/option/mm-broadband-modem-option.c
@@ -175,6 +175,13 @@ set_allowed_modes (MMIfaceModem *self,
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)
@@ -182,10 +189,11 @@ set_allowed_modes (MMIfaceModem *self,
else if (allowed == (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G)) {
if (preferred == MM_MODEM_MODE_2G)
option_mode = 2;
- else /* 3G preferred also default when NONE given here */
+ else if (preferred == MM_MODEM_MODE_3G)
option_mode = 3;
- } else if (allowed == MM_MODEM_MODE_ANY)
- option_mode = 5;
+ else /* none preferred, so AUTO */
+ option_mode = 5;
+ }
if (option_mode < 0) {
gchar *allowed_str;