All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 02/11] gobi: Request dedicated WDS services for contexts
Date: Tue,  9 Jul 2024 17:50:21 -0500	[thread overview]
Message-ID: <20240709225047.1427626-2-denkenz@gmail.com> (raw)
In-Reply-To: <20240709225047.1427626-1-denkenz@gmail.com>

Each context the modem supports (up to MAX_CONTEXTS) will require two
dedicated WDS services.  One will manage the IPv4 configuration, the
other will manage IPv6 configuration.
---
 plugins/gobi.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/plugins/gobi.c b/plugins/gobi.c
index b6df849de47e..76e1e133860d 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -72,7 +72,11 @@ struct gobi_data {
 	struct qmi_service *voice;
 	struct qmi_service *pds;
 	struct qmi_service *uim;
-	struct service_request service_requests[16];
+	struct {
+		struct qmi_service *wds_ipv4;
+		struct qmi_service *wds_ipv6;
+	} context_services[MAX_CONTEXTS];
+	struct service_request service_requests[8 + MAX_CONTEXTS * 2];
 	int cur_service_request;
 	int num_service_requests;
 	unsigned long features;
@@ -170,6 +174,8 @@ static int gobi_probe(struct ofono_modem *modem)
 
 static void cleanup_services(struct gobi_data *data)
 {
+	int i;
+
 	qmi_service_free(data->dms);
 	data->dms = NULL;
 
@@ -193,6 +199,13 @@ static void cleanup_services(struct gobi_data *data)
 
 	qmi_service_free(data->uim);
 	data->uim = NULL;
+
+	for (i = 0; i < MAX_CONTEXTS; i++) {
+		qmi_service_free(data->context_services[i].wds_ipv4);
+		qmi_service_free(data->context_services[i].wds_ipv6);
+	}
+
+	memset(&data->context_services, 0, sizeof(data->context_services));
 }
 
 static void gobi_remove(struct ofono_modem *modem)
@@ -489,6 +502,7 @@ static void discover_cb(void *user_data)
 	struct gobi_data *data = ofono_modem_get_data(modem);
 	uint16_t major;
 	uint16_t minor;
+	int i;
 
 	DBG("");
 
@@ -538,6 +552,13 @@ static void discover_cb(void *user_data)
 	if (data->features & GOBI_UIM)
 		add_service_request(data, &data->uim, QMI_SERVICE_UIM);
 
+	for (i = 0; i < (data->n_premux ? data->n_premux : 1); i++) {
+		add_service_request(data, &data->context_services[i].wds_ipv4,
+							QMI_SERVICE_WDS);
+		add_service_request(data, &data->context_services[i].wds_ipv6,
+							QMI_SERVICE_WDS);
+	}
+
 	if (qmi_qmux_device_create_client(data->device, QMI_SERVICE_DMS,
 					request_service_cb, modem, NULL) > 0)
 		return;
-- 
2.45.2


  reply	other threads:[~2024-07-09 22:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-09 22:50 [PATCH 01/11] gobi: Limit number of premultiplexed contexts to 4 Denis Kenzior
2024-07-09 22:50 ` Denis Kenzior [this message]
2024-07-09 22:50 ` [PATCH 03/11] qmi: Enable _auto_ use for some classes Denis Kenzior
2024-07-09 22:50 ` [PATCH 04/11] qmi: gprs-context: Declare qmi_service objects using _auto_ Denis Kenzior
2024-07-09 22:50 ` [PATCH 05/11] qmi: Pass two dedicated WDS services to gprs-context Denis Kenzior
2024-07-09 22:50 ` [PATCH 06/11] qmi: gprs-context: Remove parsing of unused TLVs Denis Kenzior
2024-07-09 22:50 ` [PATCH 07/11] qmi: gprs-context: Treat IP family TLV as mandatory Denis Kenzior
2024-07-09 22:50 ` [PATCH 08/11] qmi: gprs-context: Set up WDS service for IPv6 Denis Kenzior
2024-07-09 22:50 ` [PATCH 09/11] qmi: gprs-context: refactor detach_shutdown path Denis Kenzior
2024-07-09 22:50 ` [PATCH 10/11] qmi: gprs-context: refactor deactivate_primary Denis Kenzior
2024-07-09 22:50 ` [PATCH 11/11] qmi: gprs-context: Dual-Stack context activation support Denis Kenzior
2024-07-11 17:53 ` [PATCH 01/11] gobi: Limit number of premultiplexed contexts to 4 patchwork-bot+ofono

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=20240709225047.1427626-2-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@lists.linux.dev \
    /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.