core: Reuse buffers for tx, allow message pools

Use new m_msg_alloc/m_msg_free operations for whole-message
MCTP buffers. m_realloc is no longer used, instead the maximum
sized buffer is allocated for each reassembly.
This allows applications to keep a pool of MCTP message buffers.

Don't create a queue of packets to transmit, instead reuse a single
binding-provided tx_storage buffer for each transmitted packet, which
can be static for bindings that have a known maximum packet size.

Asynchronous users/bindings can no longer rely on the core for queueing
TX packets, instead they should test mctp_is_tx_ready() prior to calling
mctp_message_tx(). The stack will return -EBUSY from mctp_message_tx()
if there is already a message pending to send.

Bindings must be updated to add the tx_storage member, and the core will
no longer free packets passed to mctp_bus_rx().

Change-Id: I2598bb91026ccef01b268c52b06c0f8e20bebb1e
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/libmctp-alloc.h b/libmctp-alloc.h
index 2532cfa..0167454 100644
--- a/libmctp-alloc.h
+++ b/libmctp-alloc.h
@@ -5,8 +5,12 @@
 
 #include <stdlib.h>
 
+struct mctp;
+
 void *__mctp_alloc(size_t size);
 void __mctp_free(void *ptr);
-void *__mctp_realloc(void *ptr, size_t size);
+
+void *__mctp_msg_alloc(size_t size, struct mctp *mctp);
+void __mctp_msg_free(void *ptr, struct mctp *mctp);
 
 #endif /* _LIBMCTP_ALLOC_H */