Customize ipmbbridge as per upstream IPMB driver
Mqueue slave driver is not upstream and there is a new IPMB
driver which is upstream in kernel and this application has
been modified as per driver packet format.
Also using same node for sending IPMB data to device. No need to
define master device.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Change-Id: I8286c41970f680aae2c452331739fa934e41fd4a
diff --git a/ipmbbridged.hpp b/ipmbbridged.hpp
index d781e17..e264195 100644
--- a/ipmbbridged.hpp
+++ b/ipmbbridged.hpp
@@ -66,12 +66,13 @@
constexpr size_t ipmbResponseDataHeaderLength = 4;
constexpr size_t ipmbRequestDataHeaderLength = 3;
constexpr size_t ipmbAddressSize = 1;
+constexpr size_t ipmbPktLenSize = 1;
constexpr size_t ipmbChecksumSize = 1;
constexpr size_t ipmbChecksum2StartOffset = 3;
constexpr size_t ipmbMinFrameLength = 7;
-constexpr size_t ipmbMaxFrameLength = ipmbConnectionHeaderLength +
- ipmbResponseDataHeaderLength +
- ipmbChecksumSize + ipmbMaxDataSize;
+constexpr size_t ipmbMaxFrameLength =
+ ipmbPktLenSize + ipmbConnectionHeaderLength + ipmbResponseDataHeaderLength +
+ ipmbChecksumSize + ipmbMaxDataSize;
/**
* @brief Ipmb misc
@@ -265,7 +266,7 @@
IpmbChannel(const IpmbChannel &) = delete;
IpmbChannel &operator=(IpmbChannel const &) = delete;
- int ipmbChannelInit(const char *ipmbI2cSlave, const char *ipmbI2cMaster);
+ int ipmbChannelInit(const char *ipmbI2cSlave);
int ipmbChannelUpdateSlaveAddress(const uint8_t newBmcSlaveAddr);
@@ -291,10 +292,8 @@
std::shared_ptr<IpmbRequest> requestToSend);
private:
- boost::asio::ip::tcp::socket i2cSlaveSocket;
- boost::asio::posix::stream_descriptor i2cMasterSocket;
+ boost::asio::posix::stream_descriptor i2cSlaveDescriptor;
- int ipmbi2cMasterFd;
int ipmbi2cSlaveFd;
uint8_t ipmbBmcSlaveAddress;