From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 19/23] qmi: lte: Drop use of qmi_service_create_shared
Date: Fri, 7 Jun 2024 17:47:19 -0500 [thread overview]
Message-ID: <20240607224746.903769-19-denkenz@gmail.com> (raw)
In-Reply-To: <20240607224746.903769-1-denkenz@gmail.com>
---
drivers/qmimodem/lte.c | 47 ++++++++++--------------------------------
plugins/gobi.c | 4 +++-
2 files changed, 14 insertions(+), 37 deletions(-)
diff --git a/drivers/qmimodem/lte.c b/drivers/qmimodem/lte.c
index 5466eac7c204..d2d1048b5515 100644
--- a/drivers/qmimodem/lte.c
+++ b/drivers/qmimodem/lte.c
@@ -162,10 +162,10 @@ error:
ofono_lte_remove(lte);
}
-static void create_wds_cb(struct qmi_service *service, void *user_data)
+static int qmimodem_lte_probe(struct ofono_lte *lte,
+ unsigned int vendor, void *data)
{
- struct ofono_lte *lte = user_data;
- struct lte_data *ldd = ofono_lte_get_data(lte);
+ struct qmi_service *wds = data;
struct qmi_param *param;
struct {
uint8_t type;
@@ -174,49 +174,25 @@ static void create_wds_cb(struct qmi_service *service, void *user_data)
.type = QMI_WDS_PROFILE_TYPE_3GPP,
.family = QMI_WDS_PROFILE_FAMILY_EMBEDDED,
};
+ struct lte_data *ldd;
DBG("");
- if (!service) {
- ofono_error("Failed to request WDS service");
- ofono_lte_remove(lte);
- return;
- }
-
- ldd->wds = service;
-
- /* Query the default profile */
param = qmi_param_new();
-
- /* Profile type */
qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p);
- /* Get default profile */
- if (qmi_service_send(ldd->wds, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER,
- param, get_default_profile_cb, lte, NULL) > 0)
- return;
-
- qmi_param_free(param);
-
- ofono_error("Failed to query default profile");
- ofono_lte_register(lte);
-}
-
-static int qmimodem_lte_probe(struct ofono_lte *lte,
- unsigned int vendor, void *data)
-{
- struct qmi_device *device = data;
- struct lte_data *ldd;
-
- DBG("qmimodem lte probe");
+ if (!qmi_service_send(wds, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER,
+ param, get_default_profile_cb, lte, NULL)) {
+ qmi_param_free(param);
+ qmi_service_free(wds);
+ return -EIO;
+ }
ldd = l_new(struct lte_data, 1);
+ ldd->wds = wds;
ofono_lte_set_data(lte, ldd);
- qmi_service_create_shared(device, QMI_SERVICE_WDS,
- create_wds_cb, lte, NULL);
-
return 0;
}
@@ -229,7 +205,6 @@ static void qmimodem_lte_remove(struct ofono_lte *lte)
ofono_lte_set_data(lte, NULL);
qmi_service_free(ldd->wds);
-
l_free(ldd);
}
diff --git a/plugins/gobi.c b/plugins/gobi.c
index 7c3b352eb274..0e5e6badabd6 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -811,7 +811,9 @@ static void gobi_post_sim(struct ofono_modem *modem)
DBG("%p", modem);
- ofono_lte_create(modem, 0, "qmimodem", data->device);
+ if (data->features & GOBI_NAS)
+ ofono_lte_create(modem, 0, "qmimodem",
+ qmi_service_clone(data->wds));
if (data->features & GOBI_NAS)
ofono_radio_settings_create(modem, 0, "qmimodem", data->device);
--
2.45.0
next prev parent reply other threads:[~2024-06-07 22:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 22:47 [PATCH 01/23] gobi: Remove phonebook and stk atom creation Denis Kenzior
2024-06-07 22:47 ` [PATCH 02/23] qmi: lookup shared family directly by type Denis Kenzior
2024-06-07 22:47 ` [PATCH 03/23] core: allow multiple args in atom constructors Denis Kenzior
2024-06-07 22:47 ` [PATCH 04/23] unit: Update unit tests to the new API Denis Kenzior
2024-06-07 22:47 ` [PATCH 05/23] core: Support register on probe flag Denis Kenzior
2024-06-07 22:47 ` [PATCH 06/23] qmi: introduce qmi_service_clone Denis Kenzior
2024-06-07 22:47 ` [PATCH 07/23] gobi: request needed services at .enable() Denis Kenzior
2024-06-07 22:47 ` [PATCH 08/23] qmi: devinfo: Drop use of qmi_service_create_shared Denis Kenzior
2024-06-07 22:47 ` [PATCH 09/23] qmi: sim-legacy: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 10/23] qmi: voicecall: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 11/23] qmi: call-barring: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 12/23] qmi: call-forwarding: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 13/23] qmi: call-settings: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 14/23] qmi: ussd: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 15/23] qmi: location-reporting: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 16/23] qmi: sms: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 17/23] qmi: netreg: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 18/23] qmi: netmon: " Denis Kenzior
2024-06-07 22:47 ` Denis Kenzior [this message]
2024-06-07 22:47 ` [PATCH 20/23] qmi: gprs-context: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 21/23] qmi: sim: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 22/23] qmi: gprs: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 23/23] qmi: radio-settings: " 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=20240607224746.903769-19-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox