Update language in ipmbbridge to be more inclusive
Use more inclusive terminology inside of ipmbbridge repo.
Tested: No functional change. Verified on Intel system that ipmb.service
runs and Ipmb channel still gets published on DBus.
Change-Id: I70577a3b28e209a38bcd3d2ec99dd17b09a2d723
Signed-off-by: Matt Simmering <matthew.simmering@intel.com>
diff --git a/README b/README
index f901e51..c83d1b2 100644
--- a/README
+++ b/README
@@ -58,7 +58,7 @@
type : This points to the ChannelType. It can be ME or ipmb channel.
slave-path : The ipmb device path.
-bmc-addr : This is BMC slave address to communicate between BMC and device.
-remote-addr : This is Remote/requestor slave address to communicate between BMC and device.
+bmc-addr : This is BMC target address to communicate between BMC and device.
+remote-addr : This is Remote/requestor target address to communicate between BMC and device.
devIndex : This devIndex used to identify the particular device/host.
diff --git a/ipmbbridged.cpp b/ipmbbridged.cpp
index a6efc7c..1907c75 100644
--- a/ipmbbridged.cpp
+++ b/ipmbbridged.cpp
@@ -266,7 +266,7 @@
uint8_t targetAddr = ipmbIsResponse(&(ipmbPkt->hdr))
? ipmbPkt->hdr.Header.Resp.address
: ipmbPkt->hdr.Header.Req.address;
- boost::asio::async_write(i2cSlaveDescriptor, boost::asio::buffer(*buffer),
+ boost::asio::async_write(i2cTargetDescriptor, boost::asio::buffer(*buffer),
[this, buffer, retriesAttempted,
targetAddr](const boost::system::error_code& ec,
size_t /* bytesSent */) {
@@ -353,8 +353,8 @@
IPMB_PKT* ipmbPkt = reinterpret_cast<IPMB_PKT*>(buffer.data());
IPMB_HEADER* ipmbFrame = &(ipmbPkt->hdr);
- lseek(ipmbi2cSlaveFd, 0, SEEK_SET);
- ssize_t r = read(ipmbi2cSlaveFd, buffer.data(), ipmbMaxFrameLength);
+ lseek(ipmbi2cTargetFd, 0, SEEK_SET);
+ ssize_t r = read(ipmbi2cTargetFd, buffer.data(), ipmbMaxFrameLength);
// Handle error cases.
if (r < 0)
@@ -417,7 +417,7 @@
// prepare generic response
auto ipmbResponse = IpmbResponse(
- rqSA, ipmbRespNetFn(netFn), lun, ipmbBmcSlaveAddress, seq,
+ rqSA, ipmbRespNetFn(netFn), lun, ipmbBmcTargetAddress, seq,
ipmbRsLun, cmd, ipmbIpmiInvalidCmd, {});
auto buffer = ipmbResponse.ipmbToi2cConstruct();
@@ -454,7 +454,7 @@
return;
}
- uint8_t bmcSlaveAddress = getBmcSlaveAddress();
+ uint8_t bmcTargetAddress = getBmcTargetAddress();
if (payload.size() > ipmbMaxDataSize)
{
@@ -463,8 +463,8 @@
// prepare generic response
auto ipmbResponse = IpmbResponse(
- address, netfn, rqLun, bmcSlaveAddress, seq, ipmbRsLun, cmd,
- ipmbIpmiCmdRespNotProvided, {});
+ address, netfn, rqLun, bmcTargetAddress, seq, ipmbRsLun,
+ cmd, ipmbIpmiCmdRespNotProvided, {});
auto buffer = ipmbResponse.ipmbToi2cConstruct();
if (buffer)
@@ -491,8 +491,8 @@
// payload is empty after constructor invocation
auto ipmbResponse = IpmbResponse(address, netfn, rqLun,
- bmcSlaveAddress, seq, lun, cmd, cc,
- payload);
+ bmcTargetAddress, seq, lun, cmd,
+ cc, payload);
auto buffer = ipmbResponse.ipmbToi2cConstruct();
if (!buffer)
@@ -511,7 +511,7 @@
}
end:
- i2cSlaveDescriptor.async_wait(
+ i2cTargetDescriptor.async_wait(
boost::asio::posix::descriptor_base::wait_read,
[this](const boost::system::error_code& ec) {
if (ec)
@@ -526,21 +526,21 @@
}
IpmbChannel::IpmbChannel(boost::asio::io_context& io,
- uint8_t ipmbBmcSlaveAddress,
- uint8_t ipmbRqSlaveAddress, uint8_t channelIdx,
+ uint8_t ipmbBmcTargetAddress,
+ uint8_t ipmbRqTargetAddress, uint8_t channelIdx,
std::shared_ptr<IpmbCommandFilter> commandFilter) :
- i2cSlaveDescriptor(io),
- ipmbBmcSlaveAddress(ipmbBmcSlaveAddress),
- ipmbRqSlaveAddress(ipmbRqSlaveAddress), channelIdx(channelIdx),
+ i2cTargetDescriptor(io),
+ ipmbBmcTargetAddress(ipmbBmcTargetAddress),
+ ipmbRqTargetAddress(ipmbRqTargetAddress), channelIdx(channelIdx),
commandFilter(commandFilter)
{}
-int IpmbChannel::ipmbChannelInit(const char* ipmbI2cSlave)
+int IpmbChannel::ipmbChannelInit(const char* ipmbI2cTarget)
{
- // extract bus id from slave path and save
- std::string ipmbI2cSlaveStr(ipmbI2cSlave);
- auto findHyphen = ipmbI2cSlaveStr.find("-");
- std::string busStr = ipmbI2cSlaveStr.substr(findHyphen + 1);
+ // extract bus id from target path and save
+ std::string ipmbI2cTargetStr(ipmbI2cTarget);
+ auto findHyphen = ipmbI2cTargetStr.find("-");
+ std::string busStr = ipmbI2cTargetStr.substr(findHyphen + 1);
try
{
ipmbBusId = std::stoi(busStr);
@@ -548,13 +548,13 @@
catch (const std::invalid_argument&)
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "ipmbChannelInit: invalid bus id in slave-path config");
+ "ipmbChannelInit: invalid bus id in target-path config");
return -1;
}
- // Check if sysfs has device. If not, enable I2C slave driver by command
+ // Check if sysfs has device. If not, enable I2C target driver by command
// echo "ipmb-dev 0x1010" > /sys/bus/i2c/devices/i2c-0/new_device
- bool hasSysfs = std::filesystem::exists(ipmbI2cSlave);
+ bool hasSysfs = std::filesystem::exists(ipmbI2cTarget);
if (!hasSysfs)
{
std::string deviceFileName = "/sys/bus/i2c/devices/i2c-" + busStr +
@@ -572,18 +572,18 @@
deviceFile.close();
}
- // open fd to i2c slave device for read write
- ipmbi2cSlaveFd = open(ipmbI2cSlave, O_RDWR | O_NONBLOCK | O_CLOEXEC);
- if (ipmbi2cSlaveFd < 0)
+ // open fd to i2c target device for read write
+ ipmbi2cTargetFd = open(ipmbI2cTarget, O_RDWR | O_NONBLOCK | O_CLOEXEC);
+ if (ipmbi2cTargetFd < 0)
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "ipmbChannelInit: error opening ipmbI2cSlave");
+ "ipmbChannelInit: error opening ipmbI2cTarget");
return -1;
}
- i2cSlaveDescriptor.assign(ipmbi2cSlaveFd);
+ i2cTargetDescriptor.assign(ipmbi2cTargetFd);
- i2cSlaveDescriptor.async_wait(
+ i2cTargetDescriptor.async_wait(
boost::asio::posix::descriptor_base::wait_read,
[this](const boost::system::error_code& ec) {
if (ec)
@@ -599,16 +599,16 @@
return 0;
}
-int IpmbChannel::ipmbChannelUpdateSlaveAddress(const uint8_t newBmcSlaveAddr)
+int IpmbChannel::ipmbChannelUpdateTargetAddress(const uint8_t newBmcTargetAddr)
{
- if (ipmbi2cSlaveFd > 0)
+ if (ipmbi2cTargetFd > 0)
{
- i2cSlaveDescriptor.close();
- close(ipmbi2cSlaveFd);
- ipmbi2cSlaveFd = 0;
+ i2cTargetDescriptor.close();
+ close(ipmbi2cTargetFd);
+ ipmbi2cTargetFd = 0;
}
- // disable old I2C slave driver by command:
+ // disable old I2C target driver by command:
// echo "0x1010" > /sys/bus/i2c/devices/i2c-0/delete_device
std::string deviceFileName;
std::string para;
@@ -620,19 +620,19 @@
if (!deviceFile.good())
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "ipmbChannelUpdateSlaveAddress: error opening deviceFile to delete "
+ "ipmbChannelUpdateTargetAddress: error opening deviceFile to delete "
"sysfs");
return -1;
}
deviceFile << para;
deviceFile.close();
- // enable new I2C slave driver by command:
+ // enable new I2C target driver by command:
// echo "ipmb-dev 0x1012" > /sys/bus/i2c/devices/i2c-0/new_device
deviceFileName = "/sys/bus/i2c/devices/i2c-" + std::to_string(ipmbBusId) +
"/new_device";
std::ostringstream hex;
- uint16_t addr = 0x1000 + (newBmcSlaveAddr >> 1);
+ uint16_t addr = 0x1000 + (newBmcTargetAddr >> 1);
hex << std::hex << static_cast<uint16_t>(addr);
const std::string& addressHexStr = hex.str();
para = "ipmb-dev 0x" + addressHexStr;
@@ -640,26 +640,26 @@
if (!deviceFile.good())
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "ipmbChannelUpdateSlaveAddress: error opening deviceFile to create "
+ "ipmbChannelUpdateTargetAddress: error opening deviceFile to create "
"sysfs");
return -1;
}
deviceFile << para;
deviceFile.close();
- // open fd to i2c slave device
- std::string ipmbI2cSlaveStr = "/dev/ipmb-" + std::to_string(ipmbBusId);
- ipmbi2cSlaveFd = open(ipmbI2cSlaveStr.c_str(), O_RDWR | O_NONBLOCK);
- if (ipmbi2cSlaveFd < 0)
+ // open fd to i2c target device
+ std::string ipmbI2cTargetStr = "/dev/ipmb-" + std::to_string(ipmbBusId);
+ ipmbi2cTargetFd = open(ipmbI2cTargetStr.c_str(), O_RDWR | O_NONBLOCK);
+ if (ipmbi2cTargetFd < 0)
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "ipmbChannelInit: error opening ipmbI2cSlave");
+ "ipmbChannelInit: error opening ipmbI2cTarget");
return -1;
}
- // start to receive i2c data as slave
- i2cSlaveDescriptor.assign(ipmbi2cSlaveFd);
- i2cSlaveDescriptor.async_wait(
+ // start to receive i2c data as target
+ i2cTargetDescriptor.assign(ipmbi2cTargetFd);
+ i2cTargetDescriptor.async_wait(
boost::asio::posix::descriptor_base::wait_read,
[this](const boost::system::error_code& ec) {
if (ec)
@@ -672,7 +672,7 @@
processI2cEvent();
});
- ipmbBmcSlaveAddress = newBmcSlaveAddr;
+ ipmbBmcTargetAddress = newBmcTargetAddr;
return 0;
}
@@ -682,14 +682,14 @@
return ipmbBusId;
}
-uint8_t IpmbChannel::getBmcSlaveAddress()
+uint8_t IpmbChannel::getBmcTargetAddress()
{
- return ipmbBmcSlaveAddress;
+ return ipmbBmcTargetAddress;
}
-uint8_t IpmbChannel::getRqSlaveAddress()
+uint8_t IpmbChannel::getRqTargetAddress()
{
- return ipmbRqSlaveAddress;
+ return ipmbRqTargetAddress;
}
uint8_t IpmbChannel::getDevIndex()
@@ -734,7 +734,7 @@
for (; i2cRetryCnt < ipmbI2cNumberOfRetries; i2cRetryCnt++)
{
- boost::asio::async_write(i2cSlaveDescriptor,
+ boost::asio::async_write(i2cTargetDescriptor,
boost::asio::buffer(buffer), yield[ec]);
if (ec)
@@ -814,7 +814,7 @@
for (const auto& channelConfig : data["channels"])
{
const std::string& typeConfig = channelConfig["type"];
- const std::string& slavePath = channelConfig["slave-path"];
+ const std::string& targetPath = channelConfig["slave-path"];
uint8_t bmcAddr = channelConfig["bmc-addr"];
uint8_t reqAddr = channelConfig["remote-addr"];
@@ -828,7 +828,7 @@
auto channel = ipmbChannels.emplace(
ipmbChannels.end(), io, bmcAddr, reqAddr,
((devIndex << 2) | static_cast<uint8_t>(type)), commandFilter);
- if (channel->ipmbChannelInit(slavePath.c_str()) < 0)
+ if (channel->ipmbChannelInit(targetPath.c_str()) < 0)
{
phosphor::logging::log<phosphor::logging::level::ERR>(
"initializeChannels: channel initialization failed");
@@ -873,12 +873,12 @@
return returnStatus(ipmbResponseStatus::busy);
}
- uint8_t bmcSlaveAddress = channel->getBmcSlaveAddress();
- uint8_t rqSlaveAddress = channel->getRqSlaveAddress();
+ uint8_t bmcTargetAddress = channel->getBmcTargetAddress();
+ uint8_t rqTargetAddress = channel->getRqTargetAddress();
// construct the request to add it to outstanding request list
std::shared_ptr<IpmbRequest> request = std::make_shared<IpmbRequest>(
- rqSlaveAddress, netfn, ipmbRsLun, bmcSlaveAddress, seqNum, lun, cmd,
+ rqTargetAddress, netfn, ipmbRsLun, bmcTargetAddress, seqNum, lun, cmd,
dataReceived);
if (!request->timer)
@@ -891,23 +891,23 @@
return channel->requestAdd(yield, request);
};
-void addUpdateSlaveAddrHandler()
+void addUpdateTargetAddrHandler()
{
- // callback to handle dbus signal of updating slave addr
- std::function<void(sdbusplus::message_t&)> updateSlaveAddrHandler =
+ // callback to handle dbus signal of updating target addr
+ std::function<void(sdbusplus::message_t&)> updateTargetAddrHandler =
[](sdbusplus::message_t& message) {
- uint8_t reqChannel, busId, slaveAddr;
+ uint8_t reqChannel, busId, targetAddr;
// valid source of signal, check whether from multi-node manager
std::string pathName = message.get_path();
if (pathName != "/xyz/openbmc_project/MultiNode/Status")
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "addUpdateSlaveAddrHandler: invalid obj path");
+ "addUpdateTargetAddrHandler: invalid obj path");
return;
}
- message.read(reqChannel, busId, slaveAddr);
+ message.read(reqChannel, busId, targetAddr);
IpmbChannel* channel = getChannel(reqChannel);
@@ -915,29 +915,29 @@
channel->getChannelType() != ipmbChannelType::ipmb)
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "addUpdateSlaveAddrHandler: invalid channel");
+ "addUpdateTargetAddrHandler: invalid channel");
return;
}
if (busId != channel->getBusId())
{
phosphor::logging::log<phosphor::logging::level::ERR>(
- "addUpdateSlaveAddrHandler: invalid busId");
+ "addUpdateTargetAddrHandler: invalid busId");
return;
}
- if (channel->getBmcSlaveAddress() == slaveAddr)
+ if (channel->getBmcTargetAddress() == targetAddr)
{
phosphor::logging::log<phosphor::logging::level::INFO>(
- "addUpdateSlaveAddrHandler: channel bmc slave addr is "
+ "addUpdateTargetAddrHandler: channel bmc target addr is "
"unchanged, do nothing");
return;
}
- channel->ipmbChannelUpdateSlaveAddress(slaveAddr);
+ channel->ipmbChannelUpdateTargetAddress(targetAddr);
};
static auto match = std::make_unique<sdbusplus::bus::match_t>(
static_cast<sdbusplus::bus_t&>(*conn),
- "type='signal',member='updateBmcSlaveAddr',", updateSlaveAddrHandler);
+ "type='signal',member='updateBmcSlaveAddr',", updateTargetAddrHandler);
}
void addSendBroadcastHandler()
@@ -959,12 +959,12 @@
return;
}
- uint8_t bmcSlaveAddress = channel->getBmcSlaveAddress();
+ uint8_t bmcTargetAddress = channel->getBmcTargetAddress();
uint8_t seqNum = 0; // seqNum is not used in broadcast msg
uint8_t targetAddr = broadcastAddress;
std::shared_ptr<IpmbRequest> request = std::make_shared<IpmbRequest>(
- targetAddr, netFn, ipmbRsLun, bmcSlaveAddress, seqNum, lun, cmd,
+ targetAddr, netFn, ipmbRsLun, bmcTargetAddress, seqNum, lun, cmd,
dataReceived);
std::shared_ptr<std::vector<uint8_t>> buffer =
@@ -1005,7 +1005,7 @@
return -1;
}
- addUpdateSlaveAddrHandler();
+ addUpdateTargetAddrHandler();
addSendBroadcastHandler();
diff --git a/ipmbbridged.hpp b/ipmbbridged.hpp
index 04277e5..aa6a200 100644
--- a/ipmbbridged.hpp
+++ b/ipmbbridged.hpp
@@ -262,16 +262,16 @@
class IpmbChannel
{
public:
- IpmbChannel(boost::asio::io_context& io, uint8_t ipmbBmcSlaveAddress,
- uint8_t ipmbRqSlaveAddress, uint8_t channelIdx,
+ IpmbChannel(boost::asio::io_context& io, uint8_t ipmbBmcTargetAddress,
+ uint8_t ipmbRqTargetAddress, uint8_t channelIdx,
std::shared_ptr<IpmbCommandFilter> commandFilter);
IpmbChannel(const IpmbChannel&) = delete;
IpmbChannel& operator=(const IpmbChannel&) = delete;
- int ipmbChannelInit(const char* ipmbI2cSlave);
+ int ipmbChannelInit(const char* ipmbI2cTarget);
- int ipmbChannelUpdateSlaveAddress(const uint8_t newBmcSlaveAddr);
+ int ipmbChannelUpdateTargetAddress(const uint8_t newBmcTargetAddr);
bool seqNumGet(uint8_t& seq);
@@ -283,9 +283,9 @@
uint8_t getChannelIdx();
- uint8_t getBmcSlaveAddress();
+ uint8_t getBmcTargetAddress();
- uint8_t getRqSlaveAddress();
+ uint8_t getRqTargetAddress();
void addFilter(const uint8_t respNetFn, const uint8_t cmd);
@@ -299,12 +299,12 @@
std::shared_ptr<IpmbRequest> requestToSend);
private:
- boost::asio::posix::stream_descriptor i2cSlaveDescriptor;
+ boost::asio::posix::stream_descriptor i2cTargetDescriptor;
- int ipmbi2cSlaveFd;
+ int ipmbi2cTargetFd;
- uint8_t ipmbBmcSlaveAddress;
- uint8_t ipmbRqSlaveAddress;
+ uint8_t ipmbBmcTargetAddress;
+ uint8_t ipmbRqTargetAddress;
uint8_t ipmbBusId;
uint8_t channelIdx;
diff --git a/ipmbdefines.hpp b/ipmbdefines.hpp
index cce5859..b786300 100644
--- a/ipmbdefines.hpp
+++ b/ipmbdefines.hpp
@@ -37,7 +37,7 @@
uint8_t checksum1; /// @brief checksum computed on first two bytes
/// of IPMB_HEADER
/** @brief IPMB Header */
- uint8_t rqSA; /// @brief requester's slave address, LS bit=0
+ uint8_t rqSA; /// @brief requester's target address, LS bit=0
uint8_t rqSeqLUN; /// @brief requester's sequence number and logical
/// unit number
uint8_t cmd; /// @brief command required by the network identify the
@@ -53,7 +53,7 @@
uint8_t checksum1; /// @brief checksum computed on first two bytes
/// of IPMB_HEADER
/** @brief IPMB Header */
- uint8_t rsSA; /// @brief responder's slave address, LS bit=0
+ uint8_t rsSA; /// @brief responder's target address, LS bit=0
uint8_t rsSeqLUN; /// @brief responder's sequence number and logical
/// unit number
uint8_t cmd; /// @brief command required by the network identify the