API,core: Add reference from binding to mctp core
All of the prototype binding implementations so far have added a
reference to the core struct mctp from their binding.
This change adds a the struct mctp pointer to struct mctp_binding, so it
doesn't need to be included in every implementation.
This also allows us to drop the struct mctp * argument where we have a
reference to a binding.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
diff --git a/libmctp.h b/libmctp.h
index c477a2a..291b639 100644
--- a/libmctp.h
+++ b/libmctp.h
@@ -82,12 +82,12 @@
const char *name;
uint8_t version;
struct mctp_bus *bus;
+ struct mctp *mctp;
int (*tx)(struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
};
-void mctp_bus_rx(struct mctp *mctp, struct mctp_binding *binding,
- struct mctp_pktbuf *pkt);
+void mctp_bus_rx(struct mctp_binding *binding, struct mctp_pktbuf *pkt);
/* environment-specific allocation */
void mctp_set_alloc_ops(void *(*alloc)(size_t),