summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/mctp
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-11-05 13:23:18 -0700
committerKhem Raj <raj.khem@gmail.com>2021-11-06 12:54:03 -0700
commitee9ee2d73a2ddfec2125c7a7ae1885ec035ce2dc (patch)
treee7ccbacf67042314f12c3f729a2b82335f3d8659 /meta-networking/recipes-support/mctp
parentfc9a72ed804253a39d2a4fcef62202abcbb23567 (diff)
downloadmeta-openembedded-ee9ee2d73a2ddfec2125c7a7ae1885ec035ce2dc.tar.gz
mctp: Fix build with 5.15+ kernel headers
Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/mctp')
-rw-r--r--meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch84
-rw-r--r--meta-networking/recipes-support/mctp/mctp_git.bb8
2 files changed, 90 insertions, 2 deletions
diff --git a/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch b/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
new file mode 100644
index 000000000..83bf19770
--- /dev/null
+++ b/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
@@ -0,0 +1,84 @@
1From 653eccc918ef993186c312694c288b2a5b39248e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 5 Nov 2021 13:14:55 -0700
4Subject: [PATCH] build: Adjust for kernel mctp.h
5
6Starting 5.15 kernel has mctp.h as well and provides some of the
7defintions, therefore move the ones we need to provide in this header
8outside the conditional check so its always provided regardless of
9header coming from kernel or not.
10
11Include linux/if_link.h so it can pre-define IFLA_MCTP_UNSPEC and other
12defines and there is a check for conditionally providing them here but
13kernel does not have such a check, so if linux/if_link.h is included
14after this header then we end up with duplicate defines
15
16linux/if_link.h:1267:2: error: redefinition of enumerator 'IFLA_MCTP_UNSPEC'
17 IFLA_MCTP_UNSPEC,
18 ^
19../git/src/mctp.h:74:2: note: previous definition is here
20 IFLA_MCTP_UNSPEC,
21 ^
22
23Upstream-Status: Submitted [https://github.com/CodeConstruct/mctp/pull/2]
24Signed-off-by: Khem Raj <raj.khem@gmail.com>
25---
26 src/mctp.h | 21 +++++++++++----------
27 1 file changed, 11 insertions(+), 10 deletions(-)
28
29diff --git a/src/mctp.h b/src/mctp.h
30index 4f73def..e602168 100644
31--- a/src/mctp.h
32+++ b/src/mctp.h
33@@ -19,6 +19,7 @@
34 #if HAVE_LINUX_MCTP_H
35 #include <linux/mctp.h>
36 #endif
37+#include <linux/if_link.h>
38
39 #ifndef AF_MCTP
40 #define AF_MCTP 45
41@@ -33,10 +34,6 @@
42
43 #ifndef MCTP_NET_ANY
44
45-#ifndef MAX_ADDR_LEN
46-#define MAX_ADDR_LEN 32
47-#endif
48-
49 typedef uint8_t mctp_eid_t;
50
51 struct mctp_addr {
52@@ -53,6 +50,16 @@ struct sockaddr_mctp {
53 uint8_t __smctp_pad1;
54 };
55
56+#define MCTP_NET_ANY 0
57+#define MCTP_ADDR_ANY 0xff
58+#define MCTP_TAG_OWNER 0x08
59+
60+#endif /* MCTP_NET_ANY */
61+
62+#ifndef MAX_ADDR_LEN
63+#define MAX_ADDR_LEN 32
64+#endif
65+
66 struct sockaddr_mctp_ext {
67 struct sockaddr_mctp smctp_base;
68 int smctp_ifindex;
69@@ -61,12 +68,6 @@ struct sockaddr_mctp_ext {
70 unsigned char smctp_haddr[MAX_ADDR_LEN];
71 };
72
73-#define MCTP_NET_ANY 0
74-#define MCTP_ADDR_ANY 0xff
75-#define MCTP_TAG_OWNER 0x08
76-
77-#endif /* MCTP_NET_ANY */
78-
79 #ifndef IFLA_MCTP_MAX
80
81 /* From if_link.h */
82--
832.33.1
84
diff --git a/meta-networking/recipes-support/mctp/mctp_git.bb b/meta-networking/recipes-support/mctp/mctp_git.bb
index ebfa84d89..50d84d204 100644
--- a/meta-networking/recipes-support/mctp/mctp_git.bb
+++ b/meta-networking/recipes-support/mctp/mctp_git.bb
@@ -5,9 +5,13 @@ LICENSE = "GPLv2"
5 5
6LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21"
7 7
8SRCREV = "a8658290b7914f67146a982671b09f2270ba1654" 8PV = "0.1+git${SRCPV}"
9 9
10SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https" 10SRCREV = "072bafe725c50329f99cf9d3b2624e8799e8163a"
11
12SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https \
13 file://0001-build-Adjust-for-kernel-mctp.h.patch \
14 "
11 15
12S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"
13 17