[PATCH v6 7/7] gobi: Pass QMI qmux device options to 'qmi_qmux_device_new'.
Grant Erickson <[email protected]> Wed, 19 Mar 2025 12:22:34 -0700
| Newsgroups | dev.linux.lists.ofono |
|---|---|
| Message-ID | <c5f03c791a3a9aa06dcbb36a4aedd9ba92270079.1742411889.git.gerickson@nuovations.com> |
If the QMI minimum service request period property is set on the modem
object, then set the appropriate QMI QMUX device option quirk and
value.
---
plugins/gobi.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/plugins/gobi.c b/plugins/gobi.c
index 027aa91d6ade..dfc7402e36aa 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -842,9 +842,19 @@ error:
__shutdown_device(modem);
}
+/*
+ * Enable the modem. The following modem properties are optionally set:
+ *
+ * RequestThrottleTimeUs
+ * The minimum period, in microseconds, in which back-to-back *
+ * modem service requests may be sent.
+ *
+ */
static int gobi_enable(struct ofono_modem *modem)
{
struct gobi_data *data = ofono_modem_get_data(modem);
+ struct qmi_qmux_device_options options = { QMI_QMUX_DEVICE_QUIRK_NONE, 0 };
+ int min_req_period_us;
const char *device;
DBG("%p", modem);
@@ -853,7 +863,17 @@ static int gobi_enable(struct ofono_modem *modem)
if (!device)
return -EINVAL;
- data->device = qmi_qmux_device_new(device);
+ /*
+ * If the QMI minimum service request period property is set, then
+ * set the appropriate QMI QMUX device quirk and value.
+ */
+ min_req_period_us = ofono_modem_get_integer(modem, "RequestThrottleTimeUs");
+ if (min_req_period_us > 0) {
+ options.quirks |= QMI_QMUX_DEVICE_QUIRK_REQ_RATE_LIMIT;
+ options.min_req_period_us = min_req_period_us;
+ }
+
+ data->device = qmi_qmux_device_new(device, &options);
if (!data->device)
return -EIO;
--
2.45.0