From 3123085e724c365636572c4ad0dedfd96a36a303 Mon Sep 17 00:00:00 2001 From: Mike Engel Date: Thu, 16 Mar 2017 12:53:54 +0100 Subject: [PATCH] meta-digi-dey: Add fix to return correct error code. This commit fixes an issue with ModemManager to return the correct error code when an invalid QMI command is send to the modem. There are two ways to get the UIM/SIM status, one with the "DMS" service that works on most devices from 2015 and earlier, and a new way with the "UIM" service that works on many 2015+ devices. Perhaps the EC21 is new enough that it requires the UIM service, but ModemManager doesn't recognize the error code that it's returning. There are two ways to get the UIM/SIM status, one with the "DMS" service that works on most devices from 2015 and earlier, and a new way with the "UIM" service that works on many 2015+ devices. Perhaps the EC21 is new enough that it requires the UIM service, but ModemManager doesn't recognize the error code that it's returning. Signed-off-by: Mike Engel https://jira.digi.com/browse/DEL-3748 --- ...Add-fix-to-return-correct-error-code.patch | 25 +++++++++++++++++++ .../modemmanager/modemmanager_%.bbappend | 5 +++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0001-meta-digi-dey-Add-fix-to-return-correct-error-code.patch diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0001-meta-digi-dey-Add-fix-to-return-correct-error-code.patch b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0001-meta-digi-dey-Add-fix-to-return-correct-error-code.patch new file mode 100644 index 000000000..fd5d39bbd --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/0001-meta-digi-dey-Add-fix-to-return-correct-error-code.patch @@ -0,0 +1,25 @@ +From: Mike Engel +Date: Wed, 15 Mar 2017 18:01:06 +0100 +Subject: [PATCH] meta-digi-dey: Add fix to return correct error code. + +Signed-off-by: Mike Engel +--- + .../meta-digi-dey/recipes-connectivity/modemmanager/mm-broadband-modem-qmi.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c +index bc13925..f60d0f4 100644 +--- a/src/mm-broadband-modem-qmi.c ++++ b/src/mm-broadband-modem-qmi.c +@@ -1740,7 +1740,10 @@ dms_uim_get_pin_status_ready (QmiClientDms *client, + /* We get InvalidQmiCommand on newer devices which don't like the legacy way */ + if (g_error_matches (error, + QMI_PROTOCOL_ERROR, +- QMI_PROTOCOL_ERROR_INVALID_QMI_COMMAND)) { ++ QMI_PROTOCOL_ERROR_INVALID_QMI_COMMAND) || ++ g_error_matches (error, ++ QMI_PROTOCOL_ERROR, ++ QMI_PROTOCOL_ERROR_NOT_SUPPORTED)) { + g_error_free (error); + qmi_message_dms_uim_get_pin_status_output_unref (output); + /* Flag that the command is unsupported, and try with the new way */ \ No newline at end of file diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend index c490ec1bb..58f94be2e 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend @@ -2,7 +2,10 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" -SRC_URI += "file://cellularifupdown" +SRC_URI += " \ + file://cellularifupdown \ + file://0001-meta-digi-dey-Add-fix-to-return-correct-error-code.patch \ +" # 'polkit' depends on 'consolekit', and this requires 'x11' distro feature. So # remove 'polkit' support to be able to build ModemManager on a framebuffer