diff options
Diffstat (limited to 'services/smbios-mdrv2/src/dimm.cpp')
-rw-r--r-- | services/smbios-mdrv2/src/dimm.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/services/smbios-mdrv2/src/dimm.cpp b/services/smbios-mdrv2/src/dimm.cpp index fdd7ca7..db4170a 100644 --- a/services/smbios-mdrv2/src/dimm.cpp +++ b/services/smbios-mdrv2/src/dimm.cpp @@ -23,6 +23,9 @@ namespace phosphor namespace smbios { +using DeviceType = + sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm::DeviceType; + static constexpr uint16_t maxOldDimmSize = 0x7fff; void Dimm::memoryInfoUpdate(void) { @@ -64,12 +67,12 @@ void Dimm::memoryInfoUpdate(void) dimmDeviceLocator(memoryInfo->deviceLocator, memoryInfo->length, dataIn); dimmType(memoryInfo->memoryType); dimmTypeDetail(memoryInfo->typeDetail); - memorySpeed(memoryInfo->speed); + maxMemorySpeedInMhz(memoryInfo->speed); dimmManufacturer(memoryInfo->manufacturer, memoryInfo->length, dataIn); dimmSerialNum(memoryInfo->serialNum, memoryInfo->length, dataIn); dimmPartNum(memoryInfo->partNum, memoryInfo->length, dataIn); memoryAttributes(memoryInfo->attributes); - memoryConfClockSpeed(memoryInfo->confClockSpeed); + memoryConfiguredSpeedInMhz(memoryInfo->confClockSpeed); return; } @@ -120,11 +123,10 @@ std::string Dimm::memoryDeviceLocator(std::string value) void Dimm::dimmType(const uint8_t type) { - std::map<uint8_t, const char *>::const_iterator it = - dimmTypeTable.find(type); + std::map<uint8_t, DeviceType>::const_iterator it = dimmTypeTable.find(type); if (it == dimmTypeTable.end()) { - memoryType("Unknown Memory Type"); + memoryType(DeviceType::Unknown); } else { @@ -132,7 +134,7 @@ void Dimm::dimmType(const uint8_t type) } } -std::string Dimm::memoryType(std::string value) +DeviceType Dimm::memoryType(DeviceType value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: memoryType(value); @@ -158,10 +160,10 @@ std::string Dimm::memoryTypeDetail(std::string value) memoryTypeDetail(value); } -uint16_t Dimm::memorySpeed(uint16_t value) +uint16_t Dimm::maxMemorySpeedInMhz(uint16_t value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: - memorySpeed(value); + maxMemorySpeedInMhz(value); } void Dimm::dimmManufacturer(const uint8_t positionNum, const uint8_t structLen, @@ -212,10 +214,10 @@ uint8_t Dimm::memoryAttributes(uint8_t value) memoryAttributes(value); } -uint16_t Dimm::memoryConfClockSpeed(uint16_t value) +uint16_t Dimm::memoryConfiguredSpeedInMhz(uint16_t value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: - memoryConfClockSpeed(value); + memoryConfiguredSpeedInMhz(value); } } // namespace smbios |