summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch45
1 files changed, 20 insertions, 25 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch
index e456c10ad..88da437fc 100644
--- a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch
+++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch
@@ -1,8 +1,9 @@
-From cb330f4bf1f519032ee50d60f473c28df7b772d8 Mon Sep 17 00:00:00 2001
+From 40303196d9f07b71042cd7ba87dcab6fdad29422 Mon Sep 17 00:00:00 2001
From: Nikhil Potade <nikhil.potade@linux.intel.com>
Date: Tue, 19 Feb 2019 14:16:20 +0800
-Subject: [PATCH] Smbus changes for libmctp
+Subject: [PATCH 1/1] Smbus changes for libmctp
+Signed-off-by: James Feist <james.feist@linux.intel.com>
---
CMakeLists.txt | 6 ++++--
core.c | 2 ++
@@ -16,7 +17,7 @@ index a5b1042..249b12b 100644
@@ -2,8 +2,9 @@ cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
add_definitions (-DMCTP_LOG_STDERR)
- add_definitions (-DMCTP_FILEIO)
+ add_definitions (-DMCTP_HAVE_FILEIO)
+add_definitions (-DMCTP_DEFAULT_ALLOC)
-add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
@@ -33,7 +34,7 @@ index a5b1042..249b12b 100644
+ include)
diff --git a/core.c b/core.c
-index b855ced..8be7407 100644
+index 61356e9..622bc5e 100644
--- a/core.c
+++ b/core.c
@@ -17,6 +17,7 @@
@@ -44,16 +45,16 @@ index b855ced..8be7407 100644
struct mctp_bus {
mctp_eid_t eid;
struct mctp_binding *binding;
-@@ -50,6 +51,7 @@ struct mctp {
- */
- struct mctp_msg_ctx msg_ctxs[16];
+@@ -56,6 +57,7 @@ struct mctp {
+ ROUTE_BRIDGE,
+ } route_policy;
};
+/* clang-format on */
#ifndef BUILD_ASSERT
#define BUILD_ASSERT(x) \
diff --git a/libmctp.h b/libmctp.h
-index f0633e3..cec7c00 100644
+index b36a943..4f211f9 100644
--- a/libmctp.h
+++ b/libmctp.h
@@ -15,6 +15,7 @@ extern "C" {
@@ -64,16 +65,15 @@ index f0633e3..cec7c00 100644
struct mctp_hdr {
uint8_t ver;
uint8_t dest;
-@@ -30,12 +31,47 @@ struct mctp_hdr {
+@@ -30,19 +31,56 @@ struct mctp_hdr {
#define MCTP_HDR_SEQ_MASK (0x3)
#define MCTP_HDR_TAG_SHIFT (0)
#define MCTP_HDR_TAG_MASK (0x7)
+/* clang-format on */
- /* Maximum size of *payload* data in a MCTP packet
- * @todo: dynamic sixing based on channel implementation.
- */
- #define MCTP_MTU 64
+ /* Baseline maximum size of a MCTP packet */
+ #define MCTP_BMTU_PAYLOAD 64
+ #define MCTP_BMTU (MCTP_BMTU_PAYLOAD + sizeof(struct mctp_hdr))
+#define MCTP_CONTROL_MESSAGE_TYPE 0x00
+
@@ -111,23 +111,18 @@ index f0633e3..cec7c00 100644
+
/* packet buffers */
- /* Allow a little space before the MCTP header in the packet, for bindings that
-@@ -46,12 +82,14 @@ struct mctp_hdr {
- #define MCTP_PKTBUF_SIZE (MCTP_PKTBUF_BINDING_PAD + \
- (sizeof(struct mctp_hdr) + MCTP_MTU))
-
+/* clang-format off */
struct mctp_pktbuf {
- unsigned char data[MCTP_PKTBUF_SIZE];
- uint8_t start, end;
- uint8_t mctp_hdr_off;
+ size_t start, end, size;
+ size_t mctp_hdr_off;
struct mctp_pktbuf *next;
+ unsigned char data[];
};
+/* clang-format on */
- struct mctp_pktbuf *mctp_pktbuf_alloc(uint8_t len);
- void mctp_pktbuf_free(struct mctp_pktbuf *pkt);
-@@ -85,6 +123,7 @@ int mctp_message_tx(struct mctp *mctp, mctp_eid_t eid,
+ struct mctp_binding;
+
+@@ -90,6 +128,7 @@ int mctp_message_tx(struct mctp *mctp, mctp_eid_t eid,
void *msg, size_t msg_len);
/* hardware bindings */
@@ -135,7 +130,7 @@ index f0633e3..cec7c00 100644
struct mctp_binding {
const char *name;
uint8_t version;
-@@ -93,6 +132,7 @@ struct mctp_binding {
+@@ -101,6 +140,7 @@ struct mctp_binding {
int (*tx)(struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
};