Populate Protocol property in Item.Drive interface
By populating this property, bmcweb can populate the "Protocol"
property in the Drive schema.
Tested:
$ busctl get-property xyz.openbmc_project.eStoraged \
/xyz/openbmc_project/inventory/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Drive Protocol
s "xyz.openbmc_project.Inventory.Item.Drive.DriveProtocol.eMMC"
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I2bd19190c445ce57f3d867ffbb437c1a4a370b51
diff --git a/include/estoraged.hpp b/include/estoraged.hpp
index 077b12e..57a1c26 100644
--- a/include/estoraged.hpp
+++ b/include/estoraged.hpp
@@ -47,6 +47,7 @@
* @param[in] eraseMaxGeometry - max geometry to erase if it's specified
* @param[in] eraseMinGeometry - min geometry to erase if it's specified
* @param[in] driveType - type of drive, e.g. HDD vs SSD
+ * @param[in] driveProtocol - protocol used to communicate with drive
* @param[in] cryptInterface - (optional) pointer to CryptsetupInterface
* object
* @param[in] fsInterface - (optional) pointer to FilesystemInterface
@@ -58,6 +59,7 @@
const std::string& partNumber, const std::string& serialNumber,
const std::string& locationCode, uint64_t eraseMaxGeometry,
uint64_t eraseMinGeometry, const std::string& driveType,
+ const std::string& driveProtocol,
std::unique_ptr<CryptsetupInterface> cryptInterface =
std::make_unique<Cryptsetup>(),
std::unique_ptr<FilesystemInterface> fsInterface =
diff --git a/include/util.hpp b/include/util.hpp
index 7cc778a..e1050ed 100644
--- a/include/util.hpp
+++ b/include/util.hpp
@@ -19,15 +19,17 @@
uint64_t eraseMaxGeometry;
uint64_t eraseMinGeometry;
std::string driveType;
+ std::string driveProtocol;
DeviceInfo(std::filesystem::path& deviceFile,
std::filesystem::path& sysfsDir, std::string& luksName,
std::string& locationCode, uint64_t eraseMaxGeometry,
- uint64_t eraseMinGeometry, std::string& driveType) :
+ uint64_t eraseMinGeometry, std::string& driveType,
+ std::string& driveProtocol) :
deviceFile(deviceFile),
sysfsDir(sysfsDir), luksName(luksName), locationCode(locationCode),
eraseMaxGeometry(eraseMaxGeometry), eraseMinGeometry(eraseMinGeometry),
- driveType(driveType)
+ driveType(driveType), driveProtocol(driveProtocol)
{}
};