libmctp: Split padding in pktbuf into header and trailer
The astlpc binding will shortly make use of a medium-specific trailer to
implement a CRC-32 integrity check over packet data. Allow for
medium-specific trailer data in the pktbuf in order to remove the need
for a bounce-buffer. The binding will trim the pktbuf to the payload
length before passing the instance up the stack.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ib215a552ff218b007f7f119c5235fbc75d9ca6cb
diff --git a/core.c b/core.c
index 7b1d072..19202e8 100644
--- a/core.c
+++ b/core.c
@@ -90,13 +90,13 @@
struct mctp_pktbuf *buf;
size_t size;
- size = binding->pkt_size + binding->pkt_pad;
+ size = binding->pkt_size + binding->pkt_header + binding->pkt_trailer;
/* todo: pools */
buf = __mctp_alloc(sizeof(*buf) + size);
buf->size = size;
- buf->start = binding->pkt_pad;
+ buf->start = binding->pkt_header;
buf->end = buf->start + len;
buf->mctp_hdr_off = buf->start;
buf->next = NULL;