@@ -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;