All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antara Borwankar <antara.borwankar@intel.com>
To: ofono@ofono.org
Subject: [PATCH 3/3] xmm7modem: handling of dual mode technology preference
Date: Mon, 13 May 2019 14:20:43 +0530	[thread overview]
Message-ID: <1557737443-25498-1-git-send-email-antara.borwankar@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

Handled dual mode technology preference "umts,gsm" and
"lte,umts" for xmm7modem.
---
 drivers/xmm7modem/radio-settings.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/xmm7modem/radio-settings.c b/drivers/xmm7modem/radio-settings.c
index f1eb1aa..c7c2ce0 100644
--- a/drivers/xmm7modem/radio-settings.c
+++ b/drivers/xmm7modem/radio-settings.c
@@ -84,10 +84,10 @@ static void xact_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
 		mode = OFONO_RADIO_ACCESS_MODE_LTE;
 		break;
 	case 3:
-		mode = OFONO_RADIO_ACCESS_MODE_UMTS;
+		mode = OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM;
 		break;
 	case 4:
-		mode = OFONO_RADIO_ACCESS_MODE_LTE;
+		mode = OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS;
 		break;
 	case 5:
 		mode = OFONO_RADIO_ACCESS_MODE_LTE;
@@ -158,7 +158,16 @@ static void xmm_set_rat_mode(struct ofono_radio_settings *rs,
 		break;
 	}
 
-	if (value == 6)
+	if (mode ==
+		(OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM)) {
+		value = 3;
+		preferred = 1;
+	}
+
+	if (mode == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS))
+		value = 4;
+
+	if (value == 6 || value == 3 || value == 4)
 		snprintf(buf, sizeof(buf), "AT+XACT=%u,%u", value, preferred);
 	else
 		snprintf(buf, sizeof(buf), "AT+XACT=%u", value);
-- 
1.9.1


             reply	other threads:[~2019-05-13  8:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13  8:50 Antara Borwankar [this message]
2019-05-16 15:43 ` [PATCH 3/3] xmm7modem: handling of dual mode technology preference Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557737443-25498-1-git-send-email-antara.borwankar@intel.com \
    --to=antara.borwankar@intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.