All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] xmm7modem: change to assign datapath for activated PDP context
@ 2019-02-06  8:38 Antara Borwankar
  0 siblings, 0 replies; only message in thread
From: Antara Borwankar @ 2019-02-06  8:38 UTC (permalink / raw)
  To: ofono

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

Changed the handling of CGCONTRDP AT command reply in ifxmodem
modem driver for XMM7MODEM vendor for assigning network interface
to context settings and routing data over the selected path.
---
 drivers/ifxmodem/gprs-context.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/ifxmodem/gprs-context.c b/drivers/ifxmodem/gprs-context.c
index 7f3628b..676bbfa 100644
--- a/drivers/ifxmodem/gprs-context.c
+++ b/drivers/ifxmodem/gprs-context.c
@@ -49,6 +49,8 @@ static const char *none_prefix[] = { NULL };
 static const char *xdns_prefix[] = { "+XDNS:", NULL };
 static const char *cgpaddr_prefix[] = { "+CGPADDR:", NULL };
 static const char *cgcontrdp_prefix[] = { "+CGCONTRDP:", NULL };
+static const char *net_interface[] = { "NetworkInterface", "NetworkInterface2",
+					"NetworkInterface3", NULL };
 
 enum state {
 	STATE_IDLE,
@@ -271,6 +273,9 @@ static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *gw = NULL;
 	const char *interface;
 	const char *dns[3];
+	const char *ctrlpath;
+	const char *datapath;
+	char buf[64];
 
 	DBG("ok %d", ok);
 
@@ -327,7 +332,9 @@ static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	DBG("DNS2: %s\n", gcd->dns2);
 	DBG("Gateway: %s\n", gcd->gateway);
 
-	interface = ofono_modem_get_string(modem, "NetworkInterface");
+	interface = ofono_modem_get_string(modem, net_interface[gcd->active_context]);
+	ctrlpath = ofono_modem_get_string(modem, "CtrlPath");
+	datapath = ofono_modem_get_string(modem, "DataPath");
 
 	ofono_gprs_context_set_interface(gc, interface);
 	ofono_gprs_context_set_ipv4_address(gc, gcd->address, TRUE);
@@ -340,6 +347,12 @@ static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
 
 	ofono_gprs_context_set_ipv4_dns_servers(gc, dns);
 
+	sprintf(buf, "AT+XDATACHANNEL=1,1,\"%s\",\"%s%u\",2,%u", ctrlpath,
+				datapath, gcd->active_context, gcd->active_context);
+	g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL);
+	sprintf(buf, "AT+CGDATA=\"M-RAW_IP\",%u", gcd->active_context);
+	g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL);
+
 	CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-06  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06  8:38 [PATCH 2/2] xmm7modem: change to assign datapath for activated PDP context Antara Borwankar

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.