NVMeContext: Split out NVMeMCTPContext
The MCTP-oriented implementation of NVMeContext requires linking against
a libmctp build that provides an SMBus binding implementation. The SMBus
binding implementation isn't upstream, and neither are the kernel
interfaces it relies on.
Later, an NVMe MI Basic implementation will be introduced. NVMe MI Basic
only requires support for SMBus block reads rather than MCTP, though is
not as fully featured as the MCTP interface and is not required to be
supported by implementers of the NVMe specification.
For now, reduce NVMeContext to a base class that NVMeMCTPContext
extends and only use the NVMeMCTPContext type where explicitly
required. This opens up the opportunity to make MCTP support a
build-time configurable option.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I6920f79ca389481f3be43ee9a0d336bf8f72d55b
diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index d744ece..6c10eb5 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -15,6 +15,7 @@
*/
#include <NVMeContext.hpp>
+#include <NVMeMCTPContext.hpp>
#include <NVMeSensor.hpp>
#include <boost/asio/deadline_timer.hpp>
@@ -127,7 +128,7 @@
}
else
{
- context = std::make_shared<NVMeContext>(io, rootBus);
+ context = std::make_shared<NVMeMCTPContext>(io, rootBus);
nvmeDeviceMap[rootBus] = context;
}