All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: ofono@ofono.org
Subject: [PATCH 4/8] qmi: implement read_settings for automatic contexts
Date: Tue, 11 Apr 2017 10:18:14 +0200	[thread overview]
Message-ID: <20170411081818.19544-5-jonas@southpole.se> (raw)
In-Reply-To: <20170411081818.19544-1-jonas@southpole.se>

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

For LTE, a context is created automatically when the modem registers
to the network.  The read_settings function is called for these
automatic contexts to get their configuration.
---
 drivers/qmimodem/gprs-context.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/qmimodem/gprs-context.c b/drivers/qmimodem/gprs-context.c
index 1ae2a5a..3841c7e 100644
--- a/drivers/qmimodem/gprs-context.c
+++ b/drivers/qmimodem/gprs-context.c
@@ -153,6 +153,31 @@ done:
 	g_free(cbd);
 }
 
+static void qmi_gprs_read_settings(struct ofono_gprs_context* gc,
+					unsigned int cid,
+					ofono_gprs_context_cb_t cb,
+					void *user_data)
+{
+	struct cb_data *cbd = cb_data_new(cb, user_data);
+	struct gprs_context_data *data = ofono_gprs_context_get_data(gc);
+
+	DBG("cid %u", cid);
+
+	data->active_context = cid;
+
+	cbd->user = gc;
+
+	if (qmi_service_send(data->wds, QMI_WDS_GET_SETTINGS, NULL,
+					get_settings_cb, cbd, NULL) > 0)
+		return;
+
+	data->active_context = 0;
+
+	CALLBACK_WITH_FAILURE(cb, cbd->data);
+
+	g_free(cbd);
+}
+
 static void start_net_cb(struct qmi_result *result, void *user_data)
 {
 	struct cb_data *cbd = user_data;
@@ -450,6 +475,7 @@ static struct ofono_gprs_context_driver driver = {
 	.remove			= qmi_gprs_context_remove,
 	.activate_primary	= qmi_activate_primary,
 	.deactivate_primary	= qmi_deactivate_primary,
+	.read_settings		= qmi_gprs_read_settings,
 };
 
 void qmi_gprs_context_init(void)
-- 
2.9.3


  parent reply	other threads:[~2017-04-11  8:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  8:18 [PATCH lte 0/8] QMI LTE series Jonas Bonn
2017-04-11  8:18 ` [PATCH 1/8] qmi: NAS definitions adjustment Jonas Bonn
2017-04-11 15:23   ` Denis Kenzior
2017-04-11  8:18 ` [PATCH 2/8] qmi: add WDS parameter definition Jonas Bonn
2017-04-11 16:23   ` Denis Kenzior
2017-04-11  8:18 ` [PATCH 3/8] qmi: retrieve GPRS context parameters Jonas Bonn
2017-04-11 16:44   ` Denis Kenzior
2017-04-11  8:18 ` Jonas Bonn [this message]
2017-04-11 17:02   ` [PATCH 4/8] qmi: implement read_settings for automatic contexts Denis Kenzior
2017-04-11  8:18 ` [PATCH 5/8] lte: activate default bearer on network registration Jonas Bonn
2017-04-11 17:07   ` Denis Kenzior
2017-04-11 20:48     ` Jonas Bonn
2017-04-11 21:21       ` Denis Kenzior
2017-04-12 14:28         ` Jonas Bonn
2017-04-12 21:10           ` Jonas Bonn
2017-04-13 15:14             ` Denis Kenzior
2017-04-14 21:53               ` Jonas Bonn
2017-04-14 23:18                 ` Denis Kenzior
2017-04-11  8:18 ` [PATCH 6/8] qmi: add LTE atom driver Jonas Bonn
2017-04-11 17:09   ` Denis Kenzior
2017-04-11  8:18 ` [PATCH 7/8] qmi: watch for automatic context activation Jonas Bonn
2017-04-11  8:18 ` [PATCH 8/8] gobi: add LTE atom Jonas Bonn

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=20170411081818.19544-5-jonas@southpole.se \
    --to=jonas@southpole.se \
    --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.