i2c: Add binding for MCTP over I2C transport
Implements DSP0237. This has a fixed neighbor table (currently 4
entries), with neighbors learned on reception, or set with
mctp_i2c_set_neighbour().
Change-Id: I9b1e2c3673149cd0b9fee0d8113f3cac0e336bc7
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/meson.build b/meson.build
index aa11c32..fa6ff81 100644
--- a/meson.build
+++ b/meson.build
@@ -38,6 +38,14 @@
'libmctp-astlpc.h',
]
+i2c_sources = [
+ 'i2c.c',
+]
+
+i2c_headers = [
+ 'libmctp-i2c.h',
+]
+
libmctp_sources = sources
libmctp_headers = headers
@@ -49,6 +57,10 @@
libmctp_sources += astlpc_sources
libmctp_headers += astlpc_headers
endif
+if get_option('bindings').contains('i2c')
+ libmctp_sources += i2c_sources
+ libmctp_headers += i2c_headers
+endif
compiler = meson.get_compiler('c')
@@ -156,11 +168,17 @@
link_with: libmctp,
)
+# TODO: these should depend on the -internal.h headers so they rebuild
+# on changes, unclear how to do that.
sizeof_mctp = compiler.sizeof('struct mctp',
include_directories: libmctp_include_dir,
prefix: '#include "core-internal.h"')
+sizeof_binding_i2c = compiler.sizeof('struct mctp_binding_i2c',
+ include_directories: libmctp_include_dir,
+ prefix: '#include "i2c-internal.h"')
sizes_h = configure_file(configuration: {
'sizeof_struct_mctp': sizeof_mctp,
+ 'sizeof_binding_i2c': sizeof_binding_i2c,
},
input: 'libmctp-sizes.h.in',
output: 'libmctp-sizes.h',