[PATCH] modem-helpers-mbim: map more MbimNwError to MMMobileEquipmentError
Ben Chan
benchan at chromium.org
Sat Jun 2 05:16:14 UTC 2018
Commit XXXXXXXXX in libmim ("libmbim-glib: add additional cause codes to
MbimNwError") added additional cause codes to MbimNwError. This patch
maps some of those MbimNwError to MMMobileEquipmentError.
This patch requires libmbim >= 1.7.0
---
Hi Dan / Aleksander,
This is the follow-up MM patch for the corresponding libmbim patch:
https://lists.freedesktop.org/archives/libmbim-devel/2018-June/000993.html
Once the libmbim patch is committed, could you help adjust the commit
hash above in the commit message before committing this patch?
Thanks,
Ben
configure.ac | 2 +-
src/mm-modem-helpers-mbim.c | 28 ++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 9bf26ed2..ef104d34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -317,7 +317,7 @@ dnl-----------------------------------------------------------------------------
dnl MBIM support (enabled by default)
dnl
-LIBMBIM_VERSION=1.16.0
+LIBMBIM_VERSION=1.17.0
AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes])
AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
diff --git a/src/mm-modem-helpers-mbim.c b/src/mm-modem-helpers-mbim.c
index 36d55023..0da5588f 100644
--- a/src/mm-modem-helpers-mbim.c
+++ b/src/mm-modem-helpers-mbim.c
@@ -239,10 +239,30 @@ mm_mobile_equipment_error_from_mbim_nw_error (MbimNwError nw_error)
return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED,
"Not authorized for this CSG");
+ case MBIM_NW_ERROR_INSUFFICIENT_RESOURCES:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_INSUFFICIENT_RESOURCES,
+ "Insufficient resources");
case MBIM_NW_ERROR_MISSING_OR_UNKNOWN_APN:
return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_MISSING_OR_UNKNOWN_APN,
"Missing or unknown APN");
+ case MBIM_NW_ERROR_UNKNOWN_PDP_ADDRESS_OR_TYPE:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN_PDP_ADDRESS_OR_TYPE,
+ "Unknown PDP address or type");
+ case MBIM_NW_ERROR_USER_AUTHENTICATION_FAILED:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_USER_AUTHENTICATION_FAILED,
+ "User authentication failed");
+ case MBIM_NW_ERROR_ACTIVATION_REJECTED_BY_GGSN_OR_GW:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_BY_GGSN_OR_GW,
+ "Activation rejected by GGSN or GW");
+ case MBIM_NW_ERROR_ACTIVATION_REJECTED_UNSPECIFIED:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_ACTIVATION_REJECTED_UNSPECIFIED,
+ "Activation rejected; unspecified");
case MBIM_NW_ERROR_SERVICE_OPTION_NOT_SUPPORTED:
return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED,
@@ -255,6 +275,14 @@ mm_mobile_equipment_error_from_mbim_nw_error (MbimNwError nw_error)
return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER,
"Service option temporarily out of order");
+ case MBIM_NW_ERROR_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED,
+ "Maximum number of PDP contexts reached");
+ case MBIM_NW_ERROR_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN:
+ return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
+ MM_MOBILE_EQUIPMENT_ERROR_GPRS_REQUESTED_APN_NOT_SUPPORTED,
+ "Requested APN not supported");
default:
return g_error_new (MM_MOBILE_EQUIPMENT_ERROR,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN,
--
2.17.1.1185.g55be947832-goog
More information about the ModemManager-devel
mailing list