I revised my earlier removal of PPP from the ModemManager build to be more complete. I'd like to remove it from the enums, but these are generated by meson and it'll still pick up #ifdefed out items - I couldn't find a mechanism to make this work.

Also a patch against the Makefile in OpenWrt to use this and update from 1.20.2
to 1.20.4. Also note the previous patch I posted with the handling of .conf files vs no MBIM.

To be clear on this, even on largely well behaved modems, timeouts can still occur, or a reset can happen at the "wrong" time, or other race conditions, causing a trigger into PPP mode when it is not required. For my use, attempting
to use PPP is never the answer - we need to fall back to an error condition, or
retry etc - cycling on trying to use PPP results in grief, from painful and extensive experience of this.
--- a/configure.ac	2022-01-17 09:25:41.729736671 -0500
+++ b/configure.ac	2022-01-17 09:28:49.502051780 -0500
@@ -424,6 +424,19 @@
         ;;
 esac
 
+AC_ARG_WITH(ppp, AS_HELP_STRING([--without-ppp], [Build without PPP support]), [], [with_ppp=yes])
+AM_CONDITIONAL(WITH_PPP, test "x$with_ppp" = "xyes")
+case $with_ppp in
+    yes)
+	AC_DEFINE(WITH_PPP, 1, [Define if you want PPP support])
+	;;
+    *)
+        with_ppp=no
+        ;;
+esac
+
+
+
 dnl-----------------------------------------------------------------------------
 dnl QRTR support (both as libqrtr-glib and libqmi-glib apis)
 dnl
--- a/src/mm-base-modem.c	2021-11-26 03:38:54.000000000 -0500
+++ b/src/mm-base-modem.c	2022-01-17 09:47:59.022589306 -0500
@@ -387,9 +387,11 @@
             } else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_SECONDARY)) {
                 mm_obj_dbg (port, "AT port flagged as secondary");
                 at_pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
+#ifdef WITH_PPP
             } else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_PPP)) {
                 mm_obj_dbg (port, "AT port flagged as PPP");
                 at_pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
+#endif
             }
         }
         /* The plugin may specify NONE_NO_GENERIC to avoid the generic
@@ -1316,12 +1318,14 @@
                 }
             }
 
+#ifdef WITH_PPP
             if (flags & MM_PORT_SERIAL_AT_FLAG_PPP) {
                 if (!data_at_primary)
                     data_at_primary = MM_PORT_SERIAL_AT (candidate);
                 else
                     data_at = g_list_append (data_at, candidate);
             }
+#endif
 
             /* Explicitly flagged secondary ports trump NONE ports for secondary */
             if (flags & MM_PORT_SERIAL_AT_FLAG_SECONDARY) {
@@ -1468,7 +1473,11 @@
         mm_port_serial_at_set_flags (secondary, MM_PORT_SERIAL_AT_FLAG_SECONDARY);
     if (data_at_primary) {
         flags = mm_port_serial_at_get_flags (data_at_primary);
-        mm_port_serial_at_set_flags (data_at_primary, flags | MM_PORT_SERIAL_AT_FLAG_PPP);
+        mm_port_serial_at_set_flags (data_at_primary, flags
+#ifdef WITH_PPP
+        | MM_PORT_SERIAL_AT_FLAG_PPP
+#endif
+        );
     }
 
     /* sort ports by name */
--- a/src/mm-port-serial-at.c	2021-09-17 09:11:50.000000000 -0400
+++ b/src/mm-port-serial-at.c	2022-01-17 09:47:42.214537693 -0500
@@ -477,7 +477,9 @@
     /* MM_PORT_SERIAL_AT_FLAG_NONE_NO_GENERIC is not expected */
     g_return_if_fail (flags <= (MM_PORT_SERIAL_AT_FLAG_PRIMARY |
                                 MM_PORT_SERIAL_AT_FLAG_SECONDARY |
+#ifdef WITH_PPP
                                 MM_PORT_SERIAL_AT_FLAG_PPP |
+#endif
                                 MM_PORT_SERIAL_AT_FLAG_GPS_CONTROL));
 
     self->priv->flags = flags;
--- a/src/mm-broadband-bearer.c	2022-01-17 11:08:06.117783177 -0500
+++ b/src/mm-broadband-bearer.c	2022-01-17 11:09:32.294015077 -0500
@@ -219,10 +219,12 @@
     /* Keep port open during connection */
     ctx->close_data_on_exit = FALSE;
 
+#ifdef WITH_PPP
     /* Generic CDMA connections are done over PPP always */
     g_assert (MM_IS_PORT_SERIAL_AT (ctx->data));
     config = mm_bearer_ip_config_new ();
     mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_PPP);
+#endif
 
     /* Assume only IPv4 is given */
     g_task_return_pointer (
--- a/src/mm-base-bearer.c	2022-01-17 11:07:54.961753033 -0500
+++ b/src/mm-base-bearer.c	2022-01-17 11:08:45.977890644 -0500
@@ -541,6 +541,7 @@
         MM_GDBUS_BEARER (self),
         mm_bearer_ip_config_get_dictionary (ipv6_config));
 
+#ifdef WITH_PPP
     /* If PPP is involved in the requested IP config, we must ignore
      * all disconnection reports found via CGACT? polling or CGEV URCs.
      * In this case, upper layers should always explicitly disconnect
@@ -550,6 +551,7 @@
         mm_obj_dbg (self, "PPP is required for connection, will ignore disconnection reports");
         self->priv->ignore_disconnection_reports = TRUE;
     }
+#endif
 
     /* Update the property value */
     self->priv->status = MM_BEARER_STATUS_CONNECTED;
--- a/meson.build	2022-07-12 16:58:55.295094430 -0400
+++ b/meson.build	2022-07-12 17:00:20.375095193 -0400
@@ -248,6 +248,10 @@
 endif
 config_h.set('WITH_QMI', enable_qmi)
 
+# PPP support (enabled by default)
+enable_ppp = get_option('ppp')
+config_h.set('WITH_PPP', enable_ppp)
+
 # QRTR support (both as qrtr-glib and qmi-glib apis)
 enable_qrtr = get_option('qrtr')
 if enable_qrtr
--- a/meson_options.txt	2022-07-12 16:59:02.383094494 -0400
+++ b/meson_options.txt	2022-07-12 16:59:26.071094706 -0400
@@ -17,6 +17,7 @@
 option('mbim', type: 'boolean', value: true, description: 'enable MBIM support')
 option('qmi', type: 'boolean', value: true, description: 'enable QMI support')
 option('qrtr', type: 'boolean', value: true, description: 'enable QRTR support')
+option('ppp', type: 'boolean', value: true, description: 'enable PPP support')
 
 option('dist_version', type: 'string', value: '', description: 'define the custom version (like distribution package name and revision')
 
--- a/src/mm-port-serial-at.h	2023-02-01 09:56:28.321034159 -0500
+++ b/src/mm-port-serial-at.h	2023-02-01 10:13:26.421239298 -0500
@@ -48,7 +48,9 @@
     /* Use port for command and status if the primary port is connected */
     MM_PORT_SERIAL_AT_FLAG_SECONDARY       = 1 << 1,
     /* This port should be used for PPP */
+//#ifdef WITH_PPP
     MM_PORT_SERIAL_AT_FLAG_PPP             = 1 << 2,
+//#endif
     /* This port should be used for GPS control */
     MM_PORT_SERIAL_AT_FLAG_GPS_CONTROL     = 1 << 3,
     /* Helper flag to allow plugins specify that generic tags shouldn't be
--- a/plugins/option/mm-plugin-option.c	2023-02-01 10:31:33.901616160 -0500
+++ b/plugins/option/mm-plugin-option.c	2023-02-01 10:32:21.673802870 -0500
@@ -74,10 +74,12 @@
      * the modem/data port, per mail with Option engineers.  Only this port
      * will emit responses to dialing commands.
      */
+#ifdef WITH_PPP
     usbif = mm_kernel_device_get_interface_number (port);
     if (usbif == 0)
         pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY | MM_PORT_SERIAL_AT_FLAG_PPP;
-
+#endif
+
     return mm_base_modem_grab_port (modem,
                                     port,
                                     MM_PORT_TYPE_AT, /* we only allow AT ports here */
--- a/plugins/option/mm-plugin-hso.c	2023-02-01 10:33:09.285988753 -0500
+++ b/plugins/option/mm-plugin-hso.c	2023-02-01 10:33:36.434094674 -0500
@@ -147,8 +147,10 @@
             pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
         else if (g_object_get_data (G_OBJECT (probe), TAG_HSO_AT_GPS_CONTROL))
             pflags = MM_PORT_SERIAL_AT_FLAG_GPS_CONTROL;
+#ifdef WITH_PPP
         else if (g_object_get_data (G_OBJECT (probe), TAG_HSO_AT_MODEM))
             pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
+#endif
         else if (g_object_get_data (G_OBJECT (probe), TAG_HSO_GPS)) {
             /* Not an AT port, but the port to grab GPS traces */
             g_assert (port_type == MM_PORT_TYPE_UNKNOWN);
--- a/plugins/huawei/mm-plugin-huawei.c	2023-02-01 10:27:27.420649188 -0500
+++ b/plugins/huawei/mm-plugin-huawei.c	2023-02-01 10:30:45.545426945 -0500
@@ -448,9 +448,11 @@
         mm_obj_dbg (probe, "port mode hint for AT port: %s", mm_huawei_port_mode_get_string (port_mode));
         if (port_mode == MM_HUAWEI_PORT_MODE_PCUI)
             at_port_flags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
+#ifdef WITH_PPP
         else if (port_mode == MM_HUAWEI_PORT_MODE_MODEM)
             at_port_flags = MM_PORT_SERIAL_AT_FLAG_PPP;
-
+#endif
+
         if (at_port_flags != MM_PORT_SERIAL_AT_FLAG_NONE) {
             n_ports_with_hints++;
             g_object_set_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS, GUINT_TO_POINTER (at_port_flags));
@@ -489,9 +491,12 @@
         mm_obj_dbg (probe, "%s interface description: %s", mm_port_probe_get_port_name (probe), description);
 
         lower_description = g_ascii_strdown (description, -1);
+#ifdef WITH_PPP
         if (strstr (lower_description, "modem"))
             at_port_flags = MM_PORT_SERIAL_AT_FLAG_PPP;
-        else if (strstr (lower_description, "pcui")) {
+        else
+#endif
+        if (strstr (lower_description, "pcui")) {
             at_port_flags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
             *primary_flagged = TRUE;
         }
@@ -530,9 +535,11 @@
         }
         else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_SECONDARY))
             at_port_flags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
+#ifdef WITH_PPP
         else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_PPP))
             at_port_flags = MM_PORT_SERIAL_AT_FLAG_PPP;
-
+#endif
+
         if (at_port_flags != MM_PORT_SERIAL_AT_FLAG_NONE) {
             n_ports_with_hints++;
             g_object_set_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS, GUINT_TO_POINTER (at_port_flags));
@@ -580,12 +587,14 @@
         if (!mm_port_probe_is_at (probe))
             continue;
 
+#ifdef WITH_PPP
         usbif = mm_kernel_device_get_property_as_int_hex (mm_port_probe_peek_port (probe), "ID_USB_INTERFACE_NUM");
         if (usbif == 0) {
             mm_obj_dbg (self, "fallback port type hint applied to interface 0");
             g_object_set_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS, GUINT_TO_POINTER (MM_PORT_SERIAL_AT_FLAG_PPP));
             return 1;
         }
+#endif
     }
     return 0;
 }
--- a/plugins/sierra/mm-common-sierra.c	2023-02-01 10:06:56.327504152 -0500
+++ b/plugins/sierra/mm-common-sierra.c	2023-02-01 10:07:38.191699475 -0500
@@ -45,9 +45,11 @@
 
     /* Is it a GSM secondary port? */
     if (g_object_get_data (G_OBJECT (probe), TAG_SIERRA_APP_PORT)) {
+#ifdef WITH_PPP
         if (g_object_get_data (G_OBJECT (probe), TAG_SIERRA_APP1_PPP_OK))
             pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
         else
+#endif
             pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
     } else if (ptype == MM_PORT_TYPE_AT)
         pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
--- a/plugins/cinterion/mm-plugin-cinterion.c	2023-02-01 10:25:40.840228518 -0500
+++ b/plugins/cinterion/mm-plugin-cinterion.c	2023-02-01 10:26:21.456389058 -0500
@@ -163,11 +163,13 @@
                     mm_port_probe_get_port_subsys (probe),
                     mm_port_probe_get_port_name (probe));
         pflags = MM_PORT_SERIAL_AT_FLAG_PRIMARY;
+#ifdef WITH_PPP
     } else if (g_object_get_data (G_OBJECT (probe), TAG_CINTERION_MODEM_PORT)) {
         mm_obj_dbg (self, "port '%s/%s' flagged as PPP",
                     mm_port_probe_get_port_subsys (probe),
                     mm_port_probe_get_port_name (probe));
         pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
+#endif
     }
 
     return mm_base_modem_grab_port (modem,
--- a/src/mm-broadband-bearer.c	2023-02-01 11:45:46.875071380 -0500
+++ a/src/mm-broadband-bearer.c	2023-02-01 11:46:59.742983935 -0500
@@ -775,9 +775,13 @@
 
     /* If no specific IP retrieval requested, set the default implementation
      * (PPP if data port is AT, DHCP otherwise) */
+#ifdef WITH_PPP
     ip_method = MM_IS_PORT_SERIAL_AT (ctx->data) ?
                     MM_BEARER_IP_METHOD_PPP :
                     MM_BEARER_IP_METHOD_DHCP;
+#else
+    ip_method =   MM_BEARER_IP_METHOD_DHCP;
+#endif
 
     if (ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4 ||
             ctx->ip_family & MM_BEARER_IP_FAMILY_IPV4V6) {
--- ../openwrt-master/feeds/packages/net/modemmanager/Makefile	2023-02-01 09:11:21.071462749 -0500
+++ feeds-awc/packages/net/modemmanager/Makefile	2023-02-01 11:54:15.799242774 -0500
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
-PKG_SOURCE_VERSION:=1.20.2
-PKG_RELEASE:=1
+PKG_SOURCE_VERSION:=1.20.4
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
-PKG_MIRROR_HASH:=f138effc693456c5040ec22e17c0a8b41143c3b17b62437462995c297a9150dc
+PKG_MIRROR_HASH:=62806c19f6b7faef6db6a924fab1aa54
 
 PKG_MAINTAINER:=Nicholas Smith <nicho...@nbembedded.com>
 PKG_LICENSE:=GPL-2.0-or-later
@@ -41,7 +41,7 @@
 	$(INTL_DEPENDS) \
 	+glib2 \
 	+dbus \
-	+ppp \
+	+MODEMMANAGER_WITH_PPP:ppp \
 	+MODEMMANAGER_WITH_MBIM:libmbim \
 	+MODEMMANAGER_WITH_QMI:libqmi \
 	+MODEMMANAGER_WITH_QRTR:libqrtr-glib
@@ -68,6 +68,7 @@
 	-Dmbim=$(if $(CONFIG_MODEMMANAGER_WITH_MBIM),true,false) \
 	-Dqmi=$(if $(CONFIG_MODEMMANAGER_WITH_QMI),true,false) \
 	-Dqrtr=$(if $(CONFIG_MODEMMANAGER_WITH_QRTR),true,false) \
+	-Dppp=$(if $(CONFIG_MODEMMANAGER_WITH_PPP),true,false) \
 	-Dat_command_via_dbus=$(if $(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),true,false)
 
 define Build/InstallDev

Reply via email to