From a48e66c618b210675eca43bdb747afa7d75c6d76 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Wed, 15 Mar 2017 11:02:46 +0100 Subject: [PATCH] meta-digi-dey: Added libqmi patch to DMS version miss match. This commit fixes an issue with the Quectel EC21/EC25 due to a wrong reported DMS version which will cause ModemManager not to read the SIM card. Signed-off-by: Mike Engel https://jira.digi.com/browse/DEL-3748 --- ...bqmi-patch-to-DMS-version-miss-match.patch | 74 +++++++++++++++++++ .../libqmi/libqmi_%.bbappend | 8 ++ 2 files changed, 82 insertions(+) create mode 100755 meta-digi-dey/recipes-connectivity/libqmi/libqmi/0001-meta-digi-dey-Added-libqmi-patch-to-DMS-version-miss-match.patch create mode 100644 meta-digi-dey/recipes-connectivity/libqmi/libqmi_%.bbappend diff --git a/meta-digi-dey/recipes-connectivity/libqmi/libqmi/0001-meta-digi-dey-Added-libqmi-patch-to-DMS-version-miss-match.patch b/meta-digi-dey/recipes-connectivity/libqmi/libqmi/0001-meta-digi-dey-Added-libqmi-patch-to-DMS-version-miss-match.patch new file mode 100755 index 000000000..edcfdb07f --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/libqmi/libqmi/0001-meta-digi-dey-Added-libqmi-patch-to-DMS-version-miss-match.patch @@ -0,0 +1,74 @@ +From: Mike Engel +Date: Wed, 15 Mar 2017 18:20:25 +0100 +Subject: [PATCH] meta-digi-dey: Added libqmi patch to DMS version miss match. + +Signed-off-by: Mike Engel +--- + .../src/libqmi-glib/qmi-device.c | 32 +++++++++++++++++----- + 1 file changed, 25 insertions(+), 7 deletions(-) + +diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c +index 5cee156..ef636f0 100644 +--- a/src/libqmi-glib/qmi-device.c ++++ b/src/libqmi-glib/qmi-device.c +@@ -485,8 +485,10 @@ check_message_supported (QmiDevice *self, + GError **error) + { + const QmiMessageCtlGetVersionInfoOutputServiceListService *info; +- guint major = 0; +- guint minor = 0; ++ guint message_major = 0; ++ guint message_minor = 0; ++ guint device_major = 0; ++ guint device_minor = 0; + + /* If we didn't check supported services, just assume it is supported */ + if (!self->priv->supported_services) +@@ -498,7 +500,7 @@ check_message_supported (QmiDevice *self, + + /* If we cannot get in which version this message was introduced, we'll just + * assume it's supported */ +- if (!qmi_message_get_version_introduced (message, &major, &minor)) ++ if (!qmi_message_get_version_introduced (message, &message_major, &message_minor)) + return TRUE; + + /* Get version info. It MUST exist because we allowed creating a client +@@ -506,18 +508,34 @@ check_message_supported (QmiDevice *self, + info = find_service_version_info (self, qmi_message_get_service (message)); + g_assert (info != NULL); + g_assert (info->service == qmi_message_get_service (message)); ++ device_major = info->major_version; ++ device_minor = info->minor_version; ++ ++ /* Some device firmware versions (Quectel EC21) lie about their supported ++ * DMS version, so assume a reasonable DMS version if the WDS version is ++ * high enough */ ++ if (info->service == QMI_SERVICE_DMS && device_major == 1 && device_minor == 0) { ++ const QmiMessageCtlGetVersionInfoOutputServiceListService *wds; ++ ++ wds = find_service_version_info (self, QMI_SERVICE_WDS); ++ g_assert (wds != NULL); ++ if (wds->major_version >= 1 && wds->minor_version >= 9) { ++ device_major = 1; ++ device_minor = 3; ++ } ++ } + + /* If the version of the message is greater than the version of the service, + * report unsupported */ +- if (major > info->major_version || +- (major == info->major_version && +- minor > info->minor_version)) { ++ if (message_major > device_major || ++ (message_major == device_major && ++ message_minor > device_minor)) { + g_set_error (error, + QMI_CORE_ERROR, + QMI_CORE_ERROR_UNSUPPORTED, + "QMI service '%s' version '%u.%u' required, got version '%u.%u'", + qmi_service_get_string (qmi_message_get_service (message)), +- major, minor, ++ message_major, message_minor, + info->major_version, + info->minor_version); + return FALSE; diff --git a/meta-digi-dey/recipes-connectivity/libqmi/libqmi_%.bbappend b/meta-digi-dey/recipes-connectivity/libqmi/libqmi_%.bbappend new file mode 100644 index 000000000..ba7df7d50 --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/libqmi/libqmi_%.bbappend @@ -0,0 +1,8 @@ +# Copyright (C) 2017 Digi International Inc. + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +SRC_URI += " \ + file://0001-meta-digi-dey-Added-libqmi-patch-to-DMS-version-miss-match.patch \ +" +