All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/1] ublox: create only 1 gprs context
@ 2019-03-14 22:37 Jonas Bonn
  2019-03-15  1:27 ` Denis Kenzior
  0 siblings, 1 reply; 6+ messages in thread
From: Jonas Bonn @ 2019-03-14 22:37 UTC (permalink / raw)
  To: ofono

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

---

Here's something that I'm having trouble understanding.  The ublox
plugin creates 8 gprs_context atoms.  As far as I can tell, this means
that ofono will allow it to activate 8 contexts simultaneously... right?

Why is the ublox plugin the only one that does this?  Do other modems
not support multiple active contexts?  Or is this plugin wrong?

If I were to follow the model of other plugins, the below patch would
seem appropriate...

A bit of insight here would be appreciated.

Thanks,
Jonas

 plugins/ublox.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/plugins/ublox.c b/plugins/ublox.c
index dc001765..3ce60236 100644
--- a/plugins/ublox.c
+++ b/plugins/ublox.c
@@ -384,8 +384,6 @@ static void ublox_post_sim(struct ofono_modem *modem)
 	struct ofono_gprs_context *gc;
 	GAtChat *chat = data->modem ? data->modem : data->aux;
 	const char *driver;
-	/* Toby L2: Create same number of contexts as supported PDP contexts. */
-	int ncontexts = data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE ? 8 : 1;
 	int variant;
 
 	DBG("%p", modem);
@@ -409,14 +407,9 @@ static void ublox_post_sim(struct ofono_modem *modem)
 		variant = OFONO_VENDOR_UBLOX;
 	}
 
-	while (ncontexts) {
-		gc = ofono_gprs_context_create(modem, variant, driver, chat);
-
-		if (gprs && gc)
-			ofono_gprs_add_context(gprs, gc);
-
-		--ncontexts;
-	}
+	gc = ofono_gprs_context_create(modem, variant, driver, chat);
+	if (gprs && gc)
+		ofono_gprs_add_context(gprs, gc);
 
 	ofono_lte_create(modem,
 		ublox_model_to_id(data->model), "ubloxmodem", data->aux);
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-19 15:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-14 22:37 [RFC PATCH 1/1] ublox: create only 1 gprs context Jonas Bonn
2019-03-15  1:27 ` Denis Kenzior
2019-03-15  7:42   ` Jonas Bonn
2019-03-15 16:28     ` Denis Kenzior
2019-03-16  6:41       ` Jonas Bonn
2019-03-19 15:26         ` Denis Kenzior

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.