From 1e9a8e94ce43c62be8a0940766512ec4116a9085 Mon Sep 17 00:00:00 2001 From: Stefan Eichenberger Date: Fri, 16 Sep 2016 17:01:10 +0200 Subject: [PATCH] modemmanger: add modemmanager 1.6.0 --- conf/layer.conf | 10 +-- .../libmbim/libmbim_1.14.0.bb | 18 ++++ recipes-connectivity/libqmi/libqmi_1.16.0.bb | 19 +++++ .../modemmanager/add-me909s-support.patch | 4 +- .../modemmanager/disable-dhcp-on-me909u.patch | 82 +++++++++++++++++++ .../modemmanager/modemmanager_%.bbappend | 5 -- .../modemmanager/modemmanager_1.6.0.bb | 44 ++++++++++ 7 files changed, 171 insertions(+), 11 deletions(-) create mode 100644 recipes-connectivity/libmbim/libmbim_1.14.0.bb create mode 100644 recipes-connectivity/libqmi/libqmi_1.16.0.bb create mode 100644 recipes-connectivity/modemmanager/modemmanager/disable-dhcp-on-me909u.patch delete mode 100644 recipes-connectivity/modemmanager/modemmanager_%.bbappend create mode 100644 recipes-connectivity/modemmanager/modemmanager_1.6.0.bb diff --git a/conf/layer.conf b/conf/layer.conf index 8f15885..5bfbda6 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -4,12 +4,12 @@ BBPATH .= ":${LAYERDIR}" # We have recipes-* directories, add to BBFILES BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "nrhw15" -BBFILE_PATTERN_nrhw15 = "^${LAYERDIR}/" -BBFILE_PRIORITY_nrhw15 = "1" +BBFILE_COLLECTIONS += "nmrouter" +BBFILE_PATTERN_nmrouter = "^${LAYERDIR}/" +BBFILE_PRIORITY_nmrouter = "10" # This should only be incremented on significant changes that will # cause compatibility issues with other layers -LAYERVERSION_nrhw15 = "1" +LAYERVERSION_nmrouter = "1" -LAYERDEPENDS_nrhw15 = "core" +LAYERDEPENDS_nmrouter = "core" diff --git a/recipes-connectivity/libmbim/libmbim_1.14.0.bb b/recipes-connectivity/libmbim/libmbim_1.14.0.bb new file mode 100644 index 0000000..55b191c --- /dev/null +++ b/recipes-connectivity/libmbim/libmbim_1.14.0.bb @@ -0,0 +1,18 @@ +SUMMARY = "libmbim is library for talking to WWAN devices by MBIM protocol" +DESCRIPTION = "libmbim is a glib-based library for talking to WWAN modems and devices which speak the Mobile Interface Broadband Model (MBIM) protocol" +HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libmbim/" +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM = " \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ +" + +DEPENDS = "glib-2.0 libgudev" + +inherit autotools pkgconfig + +SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz" +SRC_URI[md5sum] = "2ed809e65c85353d3ab59e372890e549" +SRC_URI[sha256sum] = "ca8d52a95a18cbabae8f15f83f1572316e888b6504f946e6645d24405127ab5b" + +FILES_${PN}_append = " ${datadir}/bash-completion" diff --git a/recipes-connectivity/libqmi/libqmi_1.16.0.bb b/recipes-connectivity/libqmi/libqmi_1.16.0.bb new file mode 100644 index 0000000..e697ddd --- /dev/null +++ b/recipes-connectivity/libqmi/libqmi_1.16.0.bb @@ -0,0 +1,19 @@ +SUMMARY = "libqmi is a library for talking to WWAN devices by QMI protocol" +DESCRIPTION = "libqmi is a glib-based library for talking to WWAN modems and devices which speak the Qualcomm MSM Interface (QMI) protocol" +HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libqmi" +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM = " \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ +" + +DEPENDS = "glib-2.0" + +inherit autotools pkgconfig + +SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz" +SRC_URI[md5sum] = "4970c110f160b33637a3515004c637b2" +SRC_URI[sha256sum] = "7ab6bb47fd23bf4d3fa17424e40ea5552d08b19e5ee4f125f21f316c8086ba2a" + +FILES_${PN}_append = " ${datadir}/bash-completion" + diff --git a/recipes-connectivity/modemmanager/modemmanager/add-me909s-support.patch b/recipes-connectivity/modemmanager/modemmanager/add-me909s-support.patch index 5d906fa..64d7923 100644 --- a/recipes-connectivity/modemmanager/modemmanager/add-me909s-support.patch +++ b/recipes-connectivity/modemmanager/modemmanager/add-me909s-support.patch @@ -1,11 +1,13 @@ --- a/plugins/huawei/77-mm-huawei-net-port-types.rules 2016-08-23 17:49:52.791022448 +0200 +++ b/plugins/huawei/77-mm-huawei-net-port-types.rules 2016-08-23 17:50:02.675217020 +0200 -@@ -11,6 +11,8 @@ +@@ -11,6 +11,10 @@ SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1" SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_HUAWEI_MODEM_PORT}="1" SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="06", ATTRS{bInterfaceProtocol}=="10", ENV{ID_MM_HUAWEI_MODEM_PORT}="1" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="06", ATTRS{bInterfaceProtocol}=="12", ENV{ID_MM_HUAWEI_AT_PORT}="1" ++SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="10", ENV{ID_MM_HUAWEI_MODEM_PORT}="1" ++SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="13", ENV{ID_MM_HUAWEI_AT_PORT}="1" # GPS NMEA port on MU609 SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="05", ENV{ID_MM_HUAWEI_GPS_PORT}="1" diff --git a/recipes-connectivity/modemmanager/modemmanager/disable-dhcp-on-me909u.patch b/recipes-connectivity/modemmanager/modemmanager/disable-dhcp-on-me909u.patch new file mode 100644 index 0000000..680aaf4 --- /dev/null +++ b/recipes-connectivity/modemmanager/modemmanager/disable-dhcp-on-me909u.patch @@ -0,0 +1,82 @@ +diff --git a/plugins/huawei/77-mm-huawei-net-port-types.rules b/plugins/huawei/77-mm-huawei-net-port-types.rules +index f60f1f8..d35f2d5 100644 +--- a/plugins/huawei/77-mm-huawei-net-port-types.rules ++++ b/plugins/huawei/77-mm-huawei-net-port-types.rules +@@ -6,6 +6,9 @@ ENV{ID_VENDOR_ID}!="12d1", GOTO="mm_huawei_port_types_end" + # MU609 does not support getportmode (crashes modem with default firmware) + ATTRS{idProduct}=="1573", ENV{ID_MM_HUAWEI_DISABLE_GETPORTMODE}="1" + ++# MU909u does not support DHCP properly, it can happen that the Ethernet frames do not attach the Ethernet header afterwards. ++ATTRS{idProduct}=="1573", ENV{ID_MM_HUAWEI_DISABLE_DHCP}="1" ++ + # Mark the modem and at port flags for ModemManager + SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_HUAWEI_MODEM_PORT}="1" + SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1" +diff --git a/plugins/huawei/mm-broadband-bearer-huawei.c b/plugins/huawei/mm-broadband-bearer-huawei.c +index 60a91e5..11782c3 100644 +--- a/plugins/huawei/mm-broadband-bearer-huawei.c ++++ b/plugins/huawei/mm-broadband-bearer-huawei.c +@@ -465,17 +465,34 @@ connect_3gpp_context_step (Connect3gppContext *ctx) + g_object_ref (ctx->self)); + return; + +- case CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG: +- mm_base_modem_at_command_full (ctx->modem, +- ctx->primary, +- "^DHCP?", +- 3, +- FALSE, +- FALSE, +- NULL, +- (GAsyncReadyCallback)connect_dhcp_check_ready, +- g_object_ref (ctx->self)); +- return; ++ case CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG: { ++ GUdevClient *client; ++ GUdevDevice *data_device; ++ ++ // ME909u has a problem with DHCP over AT. If it's done right after NDSIDUP ++ // the modem doesn't send the Ethernet header anymore which confuses the network stack ++ client = g_udev_client_new (NULL); ++ data_device = (g_udev_client_query_by_subsystem_and_name ( ++ client, ++ "tty", ++ mm_port_get_device (&ctx->primary->parent.parent))); ++ if (!data_device || !g_udev_device_get_property_as_boolean (data_device, "ID_MM_HUAWEI_DISABLE_DHCP")) { ++ mm_base_modem_at_command_full (ctx->modem, ++ ctx->primary, ++ "^DHCP?", ++ 3, ++ FALSE, ++ FALSE, ++ NULL, ++ (GAsyncReadyCallback)connect_dhcp_check_ready, ++ g_object_ref (ctx->self)); ++ return; ++ } ++ ++ mm_info("This device (%s) does not support DHCP over AT", mm_port_get_device (ctx->data)); ++ ctx->step ++; ++ /* Fall down to the next step */ ++ } + + case CONNECT_3GPP_CONTEXT_STEP_LAST: + /* Clear context */ +@@ -489,6 +506,17 @@ connect_3gpp_context_step (Connect3gppContext *ctx) + mm_bearer_connect_result_new (ctx->data, ctx->ipv4_config, NULL), + (GDestroyNotify)mm_bearer_connect_result_unref); + } ++ else { ++ MMBearerIpConfig *ipv4_config; ++ ++ ipv4_config = mm_bearer_ip_config_new (); ++ mm_bearer_ip_config_set_method (ipv4_config, MM_BEARER_IP_METHOD_DHCP); ++ g_simple_async_result_set_op_res_gpointer ( ++ ctx->result, ++ mm_bearer_connect_result_new (ctx->data, ipv4_config, NULL), ++ (GDestroyNotify)mm_bearer_connect_result_unref); ++ g_object_unref (ipv4_config); ++ } + } + + connect_3gpp_context_complete_and_free (ctx); diff --git a/recipes-connectivity/modemmanager/modemmanager_%.bbappend b/recipes-connectivity/modemmanager/modemmanager_%.bbappend deleted file mode 100644 index 31aecaa..0000000 --- a/recipes-connectivity/modemmanager/modemmanager_%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI_append = " \ - file://add-me909s-support.patch \ - " diff --git a/recipes-connectivity/modemmanager/modemmanager_1.6.0.bb b/recipes-connectivity/modemmanager/modemmanager_1.6.0.bb new file mode 100644 index 0000000..2c626d3 --- /dev/null +++ b/recipes-connectivity/modemmanager/modemmanager_1.6.0.bb @@ -0,0 +1,44 @@ +SUMMARY = "ModemManager is a daemon controlling broadband devices/connections" +DESCRIPTION = "ModemManager is a DBus-activated daemon which controls mobile broadband (2G/3G/4G) devices and connections" +HOMEPAGE = "http://www.freedesktop.org/wiki/Software/ModemManager/" +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM = " \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ +" + +inherit autotools gettext gtk-doc systemd + +DEPENDS = "glib-2.0 libmbim libqmi polkit libgudev dbus-glib" + +SRC_URI = " \ + http://www.freedesktop.org/software/ModemManager/ModemManager-${PV}.tar.xz \ + file://add-me909s-support.patch \ + file://disable-dhcp-on-me909u.patch \ + " + +SRC_URI[md5sum] = "d9d93d2961ee35b4cd8a75a6a8631cb4" +SRC_URI[sha256sum] = "a94f4657a8fa6835e2734fcc6edf20aa8c8d452f62299d7748541021c3eb2445" + +S = "${WORKDIR}/ModemManager-${PV}" + +FILES_${PN} += " \ + ${datadir}/icons \ + ${datadir}/polkit-1 \ + ${datadir}/bash-completion \ + ${libdir}/ModemManager \ + ${systemd_unitdir}/system \ +" + +FILES_${PN}-dev += " \ + ${datadir}/dbus-1 \ + ${libdir}/ModemManager/*.la \ +" + +FILES_${PN}-staticdev += " \ + ${libdir}/ModemManager/*.a \ +" + +FILES_${PN}-dbg += "${libdir}/ModemManager/.debug" + +SYSTEMD_SERVICE_${PN} = "ModemManager.service"