Merge remote-tracking branch 'cros/upstream' into 'cros/master'

Change-Id: Ibdb8248df171bf94d866343e35dad63d0c461811
diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py
index a8f1369..5273e88 100644
--- a/build-aux/mbim-codegen/Message.py
+++ b/build-aux/mbim-codegen/Message.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 #
 # This program is free software; you can redistribute it and/or modify it under
diff --git a/build-aux/mbim-codegen/ObjectList.py b/build-aux/mbim-codegen/ObjectList.py
index 386a0f5..a23fc07 100644
--- a/build-aux/mbim-codegen/ObjectList.py
+++ b/build-aux/mbim-codegen/ObjectList.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 #
 # This program is free software; you can redistribute it and/or modify it under
diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py
index 84570de..3e2d2e9 100644
--- a/build-aux/mbim-codegen/Struct.py
+++ b/build-aux/mbim-codegen/Struct.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil -*-
 #
 # This program is free software; you can redistribute it and/or modify it under
diff --git a/build-aux/mbim-codegen/utils.py b/build-aux/mbim-codegen/utils.py
index 46ec902..0622eb3 100644
--- a/build-aux/mbim-codegen/utils.py
+++ b/build-aux/mbim-codegen/utils.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 #
 # This program is free software; you can redistribute it and/or modify it under
diff --git a/configure.ac b/configure.ac
index f2aa35d..31b6d88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
 dnl The libmbim version number
 m4_define([mbim_major_version], [1])
 m4_define([mbim_minor_version], [17])
-m4_define([mbim_micro_version], [0])
+m4_define([mbim_micro_version], [1])
 m4_define([mbim_version],
           [mbim_major_version.mbim_minor_version.mbim_micro_version])
 
@@ -98,6 +98,8 @@
 AC_SUBST(MBIMPROXY_CFLAGS)
 AC_SUBST(MBIMPROXY_LIBS)
 
+AM_PATH_PYTHON([], [], [PYTHON=python])
+
 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
 AC_SUBST(GLIB_MKENUMS)
 
diff --git a/src/libmbim-glib/generated/Makefile.am b/src/libmbim-glib/generated/Makefile.am
index ce69402..2834b99 100644
--- a/src/libmbim-glib/generated/Makefile.am
+++ b/src/libmbim-glib/generated/Makefile.am
@@ -94,7 +94,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-basic-connect.h && \
 		rm -f mbim-basic-connect.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-basic-connect.json \
 			--output mbim-basic-connect
 
@@ -103,7 +103,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-sms.h && \
 		rm -f mbim-sms.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-sms.json \
 			--output mbim-sms
 
@@ -112,7 +112,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-ussd.h && \
 		rm -f mbim-ussd.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-ussd.json \
 			--output mbim-ussd
 
@@ -121,7 +121,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-auth.h && \
 		rm -f mbim-auth.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-auth.json \
 			--output mbim-auth
 
@@ -130,7 +130,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-phonebook.h && \
 		rm -f mbim-phonebook.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-phonebook.json \
 			--output mbim-phonebook
 
@@ -139,7 +139,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-stk.h && \
 		rm -f mbim-stk.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-stk.json \
 			--output mbim-stk
 
@@ -148,7 +148,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-dss.h && \
 		rm -f mbim-dss.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-dss.json \
 			--output mbim-dss
 
@@ -157,7 +157,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-ms-firmware-id.h && \
 		rm -f mbim-ms-firmware-id.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-ms-firmware-id.json \
 			--output mbim-ms-firmware-id
 
@@ -166,7 +166,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-ms-host-shutdown.h && \
 		rm -f mbim-ms-host-shutdown.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-ms-host-shutdown.json \
 			--output mbim-ms-host-shutdown
 
@@ -175,7 +175,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-proxy-control.h && \
 		rm -f mbim-proxy-control.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-proxy-control.json \
 			--output mbim-proxy-control
 
@@ -184,7 +184,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-qmi.h && \
 		rm -f mbim-qmi.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-qmi.json \
 			--output mbim-qmi
 
@@ -193,7 +193,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-atds.h && \
 		rm -f mbim-atds.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-atds.json \
 			--output mbim-atds
 
@@ -202,7 +202,7 @@
 	$(AM_V_GEN)  \
 		rm -f mbim-intel-firmware-update.h && \
 		rm -f mbim-intel-firmware-update.c && \
-		$(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
+		$(PYTHON) $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \
 			--input $(top_srcdir)/data/mbim-service-intel-firmware-update.json \
 			--output mbim-intel-firmware-update
 
diff --git a/src/libmbim-glib/mbim-enums.h b/src/libmbim-glib/mbim-enums.h
index d3d4fbc..7fc0baa 100644
--- a/src/libmbim-glib/mbim-enums.h
+++ b/src/libmbim-glib/mbim-enums.h
@@ -390,11 +390,20 @@
  * @MBIM_NW_ERROR_CONGESTION: Congestion.
  * @MBIM_NW_ERROR_GSM_AUTHENTICATION_UNACCEPTABLE: GSM authentication unacceptable.
  * @MBIM_NW_ERROR_NOT_AUTHORIZED_FOR_CSG: Not authorized for this CSG.
+ * @MBIM_NW_ERROR_INSUFFICIENT_RESOURCES: Insufficient resources.
  * @MBIM_NW_ERROR_MISSING_OR_UNKNOWN_APN: Missing or unknown access point name.
+ * @MBIM_NW_ERROR_UNKNOWN_PDP_ADDRESS_OR_TYPE: Unknown PDP address or PDP type.
+ * @MBIM_NW_ERROR_USER_AUTHENTICATION_FAILED: User authentication failed.
+ * @MBIM_NW_ERROR_ACTIVATION_REJECTED_BY_GGSN_OR_GW: Activation rejected by GGSN, Serving GW or PDN GW.
+ * @MBIM_NW_ERROR_ACTIVATION_REJECTED_UNSPECIFIED: Activation rejected, unspecified.
  * @MBIM_NW_ERROR_SERVICE_OPTION_NOT_SUPPORTED: Service option not supported.
  * @MBIM_NW_ERROR_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED: Requested service option not subscribed.
  * @MBIM_NW_ERROR_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER: Service option temporarily out of order.
  * @MBIM_NW_ERROR_NO_PDP_CONTEXT_ACTIVATED: No PDP context activated.
+ * @MBIM_NW_ERROR_PDP_TYPE_IPV4_ONLY_ALLOWED: PDP type IPv4 only allowed.
+ * @MBIM_NW_ERROR_PDP_TYPE_IPV6_ONLY_ALLOWED: PDP type IPv6 only allowed.
+ * @MBIM_NW_ERROR_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED: Maximum number of PDP contexts reached.
+ * @MBIM_NW_ERROR_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN: Requested APN not supported in current RAT and PLMN combination.
  * @MBIM_NW_ERROR_SEMANTICALLY_INCORRECT_MESSAGE: Semantically incorrect message.
  * @MBIM_NW_ERROR_INVALID_MANDATORY_INFORMATION: Invalid mandatory information.
  * @MBIM_NW_ERROR_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED: Message type non-existent or not implemented.
@@ -403,45 +412,58 @@
  * @MBIM_NW_ERROR_CONDITIONAL_IE_ERROR: Conditional IE error.
  * @MBIM_NW_ERROR_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE: Message not compatible with protocol state.
  * @MBIM_NW_ERROR_PROTOCOL_ERROR_UNSPECIFIED: Protocol error, unspecified.
+ * @MBIM_NW_ERROR_APN_RESTRICTION_VALUE_INCOMPATIBLE_WITH_ACTIVE_PDP_CONTEXT: APN restriction value incompatible with active PDP context.
+ * @MBIM_NW_ERROR_MULTIPLE_ACCESSES_TO_A_PDN_CONNECTION_NOT_ALLOWED: Multiple accesses to a PDN connection not allowed.
  *
  *  Network errors.
  */
 typedef enum {
-    MBIM_NW_ERROR_UNKNOWN                                             = 0,
-    MBIM_NW_ERROR_IMSI_UNKNOWN_IN_HLR                                 = 2,
-    MBIM_NW_ERROR_ILLEGAL_MS                                          = 3,
-    MBIM_NW_ERROR_IMSI_UNKNOWN_IN_VLR                                 = 4,
-    MBIM_NW_ERROR_IMEI_NOT_ACCEPTED                                   = 5,
-    MBIM_NW_ERROR_ILLEGAL_ME                                          = 6,
-    MBIM_NW_ERROR_GPRS_NOT_ALLOWED                                    = 7,
-    MBIM_NW_ERROR_GPRS_AND_NON_GPRS_NOT_ALLOWED                       = 8,
-    MBIM_NW_ERROR_MS_IDENTITY_NOT_DERIVED_BY_NETWORK                  = 9,
-    MBIM_NW_ERROR_IMPLICITLY_DETACHED                                 = 10,
-    MBIM_NW_ERROR_PLMN_NOT_ALLOWED                                    = 11,
-    MBIM_NW_ERROR_LOCATION_AREA_NOT_ALLOWED                           = 12,
-    MBIM_NW_ERROR_ROAMING_NOT_ALLOWED_IN_LOCATION_AREA                = 13,
-    MBIM_NW_ERROR_GPRS_NOT_ALLOWED_IN_PLMN                            = 14,
-    MBIM_NW_ERROR_NO_CELLS_IN_LOCATION_AREA                           = 15,
-    MBIM_NW_ERROR_MSC_TEMPORARILY_NOT_REACHABLE                       = 16,
-    MBIM_NW_ERROR_NETWORK_FAILURE                                     = 17,
-    MBIM_NW_ERROR_MAC_FAILURE                                         = 20,
-    MBIM_NW_ERROR_SYNCH_FAILURE                                       = 21,
-    MBIM_NW_ERROR_CONGESTION                                          = 22,
-    MBIM_NW_ERROR_GSM_AUTHENTICATION_UNACCEPTABLE                     = 23,
-    MBIM_NW_ERROR_NOT_AUTHORIZED_FOR_CSG                              = 25,
-    MBIM_NW_ERROR_MISSING_OR_UNKNOWN_APN                              = 27,
-    MBIM_NW_ERROR_SERVICE_OPTION_NOT_SUPPORTED                        = 32,
-    MBIM_NW_ERROR_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED             = 33,
-    MBIM_NW_ERROR_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER             = 34,
-    MBIM_NW_ERROR_NO_PDP_CONTEXT_ACTIVATED                            = 40,
-    MBIM_NW_ERROR_SEMANTICALLY_INCORRECT_MESSAGE                      = 95,
-    MBIM_NW_ERROR_INVALID_MANDATORY_INFORMATION                       = 96,
-    MBIM_NW_ERROR_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED        = 97,
-    MBIM_NW_ERROR_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE     = 98,
-    MBIM_NW_ERROR_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99,
-    MBIM_NW_ERROR_CONDITIONAL_IE_ERROR                                = 100,
-    MBIM_NW_ERROR_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE          = 101,
-    MBIM_NW_ERROR_PROTOCOL_ERROR_UNSPECIFIED                          = 111
+    MBIM_NW_ERROR_UNKNOWN                                                    = 0,
+    MBIM_NW_ERROR_IMSI_UNKNOWN_IN_HLR                                        = 2,
+    MBIM_NW_ERROR_ILLEGAL_MS                                                 = 3,
+    MBIM_NW_ERROR_IMSI_UNKNOWN_IN_VLR                                        = 4,
+    MBIM_NW_ERROR_IMEI_NOT_ACCEPTED                                          = 5,
+    MBIM_NW_ERROR_ILLEGAL_ME                                                 = 6,
+    MBIM_NW_ERROR_GPRS_NOT_ALLOWED                                           = 7,
+    MBIM_NW_ERROR_GPRS_AND_NON_GPRS_NOT_ALLOWED                              = 8,
+    MBIM_NW_ERROR_MS_IDENTITY_NOT_DERIVED_BY_NETWORK                         = 9,
+    MBIM_NW_ERROR_IMPLICITLY_DETACHED                                        = 10,
+    MBIM_NW_ERROR_PLMN_NOT_ALLOWED                                           = 11,
+    MBIM_NW_ERROR_LOCATION_AREA_NOT_ALLOWED                                  = 12,
+    MBIM_NW_ERROR_ROAMING_NOT_ALLOWED_IN_LOCATION_AREA                       = 13,
+    MBIM_NW_ERROR_GPRS_NOT_ALLOWED_IN_PLMN                                   = 14,
+    MBIM_NW_ERROR_NO_CELLS_IN_LOCATION_AREA                                  = 15,
+    MBIM_NW_ERROR_MSC_TEMPORARILY_NOT_REACHABLE                              = 16,
+    MBIM_NW_ERROR_NETWORK_FAILURE                                            = 17,
+    MBIM_NW_ERROR_MAC_FAILURE                                                = 20,
+    MBIM_NW_ERROR_SYNCH_FAILURE                                              = 21,
+    MBIM_NW_ERROR_CONGESTION                                                 = 22,
+    MBIM_NW_ERROR_GSM_AUTHENTICATION_UNACCEPTABLE                            = 23,
+    MBIM_NW_ERROR_NOT_AUTHORIZED_FOR_CSG                                     = 25,
+    MBIM_NW_ERROR_INSUFFICIENT_RESOURCES                                     = 26,
+    MBIM_NW_ERROR_MISSING_OR_UNKNOWN_APN                                     = 27,
+    MBIM_NW_ERROR_UNKNOWN_PDP_ADDRESS_OR_TYPE                                = 28,
+    MBIM_NW_ERROR_USER_AUTHENTICATION_FAILED                                 = 29,
+    MBIM_NW_ERROR_ACTIVATION_REJECTED_BY_GGSN_OR_GW                          = 30,
+    MBIM_NW_ERROR_ACTIVATION_REJECTED_UNSPECIFIED                            = 31,
+    MBIM_NW_ERROR_SERVICE_OPTION_NOT_SUPPORTED                               = 32,
+    MBIM_NW_ERROR_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED                    = 33,
+    MBIM_NW_ERROR_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER                    = 34,
+    MBIM_NW_ERROR_NO_PDP_CONTEXT_ACTIVATED                                   = 40,
+    MBIM_NW_ERROR_PDP_TYPE_IPV4_ONLY_ALLOWED                                 = 50,
+    MBIM_NW_ERROR_PDP_TYPE_IPV6_ONLY_ALLOWED                                 = 51,
+    MBIM_NW_ERROR_MAXIMUM_NUMBER_OF_PDP_CONTEXTS_REACHED                     = 65,
+    MBIM_NW_ERROR_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN        = 66,
+    MBIM_NW_ERROR_SEMANTICALLY_INCORRECT_MESSAGE                             = 95,
+    MBIM_NW_ERROR_INVALID_MANDATORY_INFORMATION                              = 96,
+    MBIM_NW_ERROR_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED               = 97,
+    MBIM_NW_ERROR_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE            = 98,
+    MBIM_NW_ERROR_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED        = 99,
+    MBIM_NW_ERROR_CONDITIONAL_IE_ERROR                                       = 100,
+    MBIM_NW_ERROR_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE                 = 101,
+    MBIM_NW_ERROR_PROTOCOL_ERROR_UNSPECIFIED                                 = 111,
+    MBIM_NW_ERROR_APN_RESTRICTION_VALUE_INCOMPATIBLE_WITH_ACTIVE_PDP_CONTEXT = 112,
+    MBIM_NW_ERROR_MULTIPLE_ACCESSES_TO_A_PDN_CONNECTION_NOT_ALLOWED          = 113
 } MbimNwError;
 
 /**