Correction of VPD using ECC
ECC algorithm corrects VPD data in 32:1 bit ratio in the
event of corruption.
Main Test Cases:
1) Check correction of KW in records.
2) Check correction while writing and reading VPD.
3) Check for Module VPD correction.
Signed-off-by: Giridhari Krishna <giridharikrishnan@gmail.com>
Change-Id: I48a3db18df9d3a2aecde814610ab1b357e6f310d
diff --git a/vpd-parser/ipz_parser.cpp b/vpd-parser/ipz_parser.cpp
index 4f2b30e..d923aa6 100644
--- a/vpd-parser/ipz_parser.cpp
+++ b/vpd-parser/ipz_parser.cpp
@@ -15,14 +15,14 @@
std::variant<kwdVpdMap, Store> IpzVpdParser::parse()
{
- Impl p(vpd, inventoryPath);
+ Impl p(vpd, inventoryPath, vpdFilePath, vpdStartOffset);
Store s = p.run();
return s;
}
void IpzVpdParser::processHeader()
{
- Impl p(vpd, inventoryPath);
+ Impl p(vpd, inventoryPath, vpdFilePath, vpdStartOffset);
p.checkVPDHeader();
}
@@ -34,4 +34,4 @@
} // namespace parser
} // namespace ipz
} // namespace vpd
-} // namespace openpower
+} // namespace openpower
\ No newline at end of file
diff --git a/vpd-parser/ipz_parser.hpp b/vpd-parser/ipz_parser.hpp
index 5a0865c..e431cd3 100644
--- a/vpd-parser/ipz_parser.hpp
+++ b/vpd-parser/ipz_parser.hpp
@@ -31,9 +31,16 @@
/**
* @brief Constructor
+ * @param[in] - VpdVector - vpd buffer
+ * @param[in] - path - Inventory Path
+ * @param[in] - vpdFilePath - VPD H/w path
+ * @param[in] - vpdStartOffset - VPD starting offset
*/
- IpzVpdParser(const Binary& VpdVector, const std::string& path) :
- vpd(VpdVector), inventoryPath(path)
+ IpzVpdParser(const Binary& VpdVector, const std::string& path,
+ const std::string& vpdFilePath, uint32_t vpdStartOffset) :
+ vpd(VpdVector),
+ inventoryPath(path), vpdFilePath(vpdFilePath),
+ vpdStartOffset(vpdStartOffset)
{
}
@@ -63,6 +70,13 @@
/*Inventory path of the FRU */
const std::string inventoryPath;
+
+ /* VPD Path */
+ const std::string vpdFilePath;
+
+ /* Offset */
+ uint32_t vpdStartOffset;
+
}; // class IpzVpdParser
} // namespace parser
diff --git a/vpd-parser/parser_factory.cpp b/vpd-parser/parser_factory.cpp
index 1afe96a..04d4960 100644
--- a/vpd-parser/parser_factory.cpp
+++ b/vpd-parser/parser_factory.cpp
@@ -24,9 +24,9 @@
{
namespace factory
{
-interface::ParserInterface*
- ParserFactory::getParser(const Binary& vpdVector,
- const std::string& inventoryPath)
+interface::ParserInterface* ParserFactory::getParser(
+ const Binary& vpdVector, const std::string& inventoryPath,
+ const std::string& vpdFilePath, uint32_t vpdStartOffset)
{
vpdType type = vpdTypeCheck(vpdVector);
@@ -34,7 +34,8 @@
{
case IPZ_VPD:
{
- return new IpzVpdParser(vpdVector, inventoryPath);
+ return new IpzVpdParser(vpdVector, inventoryPath, vpdFilePath,
+ vpdStartOffset);
}
case KEYWORD_VPD:
diff --git a/vpd-parser/parser_factory.hpp b/vpd-parser/parser_factory.hpp
index 97a96b8..983b8fd 100644
--- a/vpd-parser/parser_factory.hpp
+++ b/vpd-parser/parser_factory.hpp
@@ -31,10 +31,13 @@
* @brief A method to get object of concrete parser class.
* @param[in] - vpd file to check for the type.
* @param[in] - InventoryPath to call out FRU in case PEL is logged.
+ * @param[in] - vpdFilePath for VPD HW path.
+ * @param[in] - vpdStartOffset for starting offset of VPD.
* @return - Pointer to concrete parser class object.
*/
static interface::ParserInterface*
- getParser(const Binary& vpdVector, const std::string& inventoryPath);
+ getParser(const Binary& vpdVector, const std::string& inventoryPath,
+ const std::string& vpdFilePath, uint32_t vpdStartOffset);
/**
* @brief A method to delete the parser object.