summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-12-19 13:54:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-12-20 15:47:14 +0000
commite52d5e692f20eb820924a409289bd5603f176485 (patch)
treefc55a779dd977a799a8f1d2eea6421f29402fe19
parent26fe17e505ac334c93cceba5e8ac21a63632216c (diff)
downloadpoky-e52d5e692f20eb820924a409289bd5603f176485.tar.gz
ofono: fix the build when toolchain has old linux headers
Whilst our default toolchain has modern kernel headers (6.12, at time of writing), some external toolchains may use old kernel headers. As ofono's rmnet module uses kernel defines which were added in 5.14, add some compatibility defines in case they are not set. (From OE-Core rev: 0313ea48a75480c2bcc6d35035f74a4dcf22f263) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/ofono/ofono/rmnet.patch45
-rw-r--r--meta/recipes-connectivity/ofono/ofono_2.14.bb1
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/ofono/ofono/rmnet.patch b/meta/recipes-connectivity/ofono/ofono/rmnet.patch
new file mode 100644
index 0000000000..11dfd5db18
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono/rmnet.patch
@@ -0,0 +1,45 @@
1From git@z Thu Jan 1 00:00:00 1970
2Subject: [PATCH] rmnet: Handle toolchains with old kernel headers
3From: Richard Purdie <richard.purdie@linuxfoundation.org>
4Date: Thu, 19 Dec 2024 13:47:15 +0000
5Message-Id: <e2b6a94dd9a3789e31dafadfc70c53b565d1db04.camel@linuxfoundation.org>
6MIME-Version: 1.0
7Content-Type: text/plain; charset="utf-8"
8Content-Transfer-Encoding: 7bit
9
10The RMNET_FLAGS_*GRESS_MAP_CKSUMV5 defines were added to the kernel in
115.14[1] and some toolchains use older headers, so add fallback defines
12in case they are needed.
13
14[1] linux b6e5d27e32ef6089d316ce7e1ecaf595584d4b84
15
16Upstream-Status: Submitted [https://lore.kernel.org/ofono/e2b6a94dd9a3789e31dafadfc70c53b565d1db04.camel@linuxfoundation.org/T/#u]
17Signed-off-by: Ross Burton <ross.burton@arm.com>
18---
19 src/rmnet.c | 10 ++++++++++
20 1 file changed, 10 insertions(+)
21
22diff --git a/src/rmnet.c b/src/rmnet.c
23index 42b03249..9a7f52fb 100644
24--- a/src/rmnet.c
25+++ b/src/rmnet.c
26@@ -27,6 +27,16 @@
27 #define MAX_MUX_IDS 254U
28 #define DEFAULT_MTU 1400U
29
30+/*
31+ * These were added in 5.14 so define them here if the toolchain's kernel headers are old.
32+ */
33+#ifndef RMNET_FLAGS_INGRESS_MAP_CKSUMV5
34+#define RMNET_FLAGS_INGRESS_MAP_CKSUMV5 (1U << 4)
35+#endif
36+#ifndef RMNET_FLAGS_EGRESS_MAP_CKSUMV5
37+#define RMNET_FLAGS_EGRESS_MAP_CKSUMV5 (1U << 5)
38+#endif
39+
40 struct rmnet_request {
41 uint32_t parent_ifindex;
42 rmnet_new_interfaces_func_t new_cb;
43--
442.43.0
45
diff --git a/meta/recipes-connectivity/ofono/ofono_2.14.bb b/meta/recipes-connectivity/ofono/ofono_2.14.bb
index 0a695c978c..5d11d6cb45 100644
--- a/meta/recipes-connectivity/ofono/ofono_2.14.bb
+++ b/meta/recipes-connectivity/ofono/ofono_2.14.bb
@@ -9,6 +9,7 @@ DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info ell"
9 9
10SRC_URI = "\ 10SRC_URI = "\
11 ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ 11 ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
12 file://rmnet.patch \
12 file://ofono \ 13 file://ofono \
13" 14"
14SRC_URI[sha256sum] = "983cbfd5e1e1a410ba7ad2db7f50fadc91e50b29f1ede40cdc73f941da7ba95f" 15SRC_URI[sha256sum] = "983cbfd5e1e1a410ba7ad2db7f50fadc91e50b29f1ede40cdc73f941da7ba95f"