modemmanger: add modemmanager 1.6.0

This commit is contained in:
Stefan Eichenberger 2016-09-16 17:01:10 +02:00
parent 8c57fd44d7
commit 1e9a8e94ce
7 changed files with 171 additions and 11 deletions

View File

@ -4,12 +4,12 @@ BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES # We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "nrhw15" BBFILE_COLLECTIONS += "nmrouter"
BBFILE_PATTERN_nrhw15 = "^${LAYERDIR}/" BBFILE_PATTERN_nmrouter = "^${LAYERDIR}/"
BBFILE_PRIORITY_nrhw15 = "1" BBFILE_PRIORITY_nmrouter = "10"
# This should only be incremented on significant changes that will # This should only be incremented on significant changes that will
# cause compatibility issues with other layers # cause compatibility issues with other layers
LAYERVERSION_nrhw15 = "1" LAYERVERSION_nmrouter = "1"
LAYERDEPENDS_nrhw15 = "core" LAYERDEPENDS_nmrouter = "core"

View File

@ -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"

View File

@ -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"

View File

@ -1,11 +1,13 @@
--- a/plugins/huawei/77-mm-huawei-net-port-types.rules 2016-08-23 17:49:52.791022448 +0200 --- 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 +++ 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}=="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}=="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}=="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}=="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}=="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 # GPS NMEA port on MU609
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="05", ENV{ID_MM_HUAWEI_GPS_PORT}="1" SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="05", ENV{ID_MM_HUAWEI_GPS_PORT}="1"

View File

@ -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);

View File

@ -1,5 +0,0 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append = " \
file://add-me909s-support.patch \
"

View File

@ -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"